From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12005 invoked by alias); 22 Feb 2007 16:08:22 -0000 Received: (qmail 11993 invoked by uid 22791); 22 Feb 2007 16:08:22 -0000 X-Spam-Check-By: sourceware.org Received: from Unknown (HELO elsdt-razorfish.arc.com) (194.202.198.226) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Feb 2007 16:08:08 +0000 Received: from elsdt-razorfish.arc.com (localhost.localdomain [127.0.0.1]) by elsdt-razorfish.arc.com (8.12.11.20060308/8.12.11) with ESMTP id l1MG7tVQ031607 for ; Thu, 22 Feb 2007 16:07:55 GMT Received: (from joernr@localhost) by elsdt-razorfish.arc.com (8.12.11.20060308/8.12.11/Submit) id l1MG7tQd031605 for cgen@sources.redhat.com; Thu, 22 Feb 2007 16:07:55 GMT Date: Thu, 22 Feb 2007 16:08:00 -0000 From: Joern Rennecke To: cgen@sources.redhat.com Subject: insert evaluation for multi-ifields broken Message-ID: <20070222160755.GB8064@elsdt-razorfish.arc.com> References: <20070214182926.GA18550@elsdt-razorfish.arc.com> <45D36856.8010208@redhat.com> <20070214201406.GD18550@elsdt-razorfish.arc.com> <45D619DD.7010602@redhat.com> <20070219033843.GA31910@elsdt-razorfish.arc.com> <45D9C06A.4030903@redhat.com> <20070219155503.GB13511@elsdt-razorfish.arc.com> <20070219160735.GJ27135@redhat.com> <20070219181352.GC13511@elsdt-razorfish.arc.com> <45D9EA38.5040002@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <45D9EA38.5040002@redhat.com> User-Agent: Mutt/1.4.1i Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2007-q1/txt/msg00059.txt.bz2 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 655 When I want to put a constant into a multi-ifield, the exact instructions how to set the subfields are apparently ignored, and the total value is copied into the subfields. I have found this while working on my machine desscription, and I could reproduce this with a small synthetic testcase, attached as foo.cpu. I've put tis file into the cgen/cpu directory, and then with the cgen directory as the cwd, invoked guile and evaluated: (load "dev.scm") (load-sim) (cload #:arch "foo" #:machs "foo") (cgen-decode.c) note that the expected value to check entire_insn against is 0x1324, but generated test is: if ((entire_insn & 0xffff) == 0x12424) --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="foo.cpu" Content-length: 1324 (include "simplify.inc") (define-arch (name foo) ; name of cpu family (comment "") (default-alignment aligned) (insn-lsb0? #f) (machs foo) (isas foo) ) (define-isa (name foo) ; The default size of an instruction in bits (default-insn-bitsize 16) (base-insn-bitsize 16) (default-insn-word-bitsize 16) ) (define-cpu (name foo) (comment "") (endian either) (word-bitsize 16) ; Generated files have an "f" suffix. (file-transform "f") ) (define-mach (name foo) (comment "") (cpu foo) ) (dnf f-a "op a" () 0 4) (dnf f-b "op a" () 4 4) (dnf f-c "op a" () 8 4) (dnf f-d "op a" () 12 4) (dnmf f-ac "op ac" () UINT (f-a f-c) (sequence () ; insert (set (ifield f-c) (and (ifield f-ac) (const 15))) (set (ifield f-a) (srl (ifield f-ac) (const 4))) ) (sequence () ; extract (set (ifield f-ac) (or (ifield f-c) (sll (ifield f-a) 4))) ) ) (define-pmacro (dni xname xcomment xsyntax xformat xattrs xsemantics) (define-insn (name xname) (comment xcomment) (.splice attrs (.unsplice xattrs)) (syntax xsyntax) (format xformat) (semantics xsemantics) ) ) (dnh h-pc "program counter" (PC PROFILE) (pc) () () ()) (dni swi "" "swi" (+ (f-ac 18) (f-b 3) (f-d 4)) () (sequence () (set pc (c-call SI "foo_trap" pc 0))) ) --opJtzjQTFsWo+cga--