From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14970 invoked by alias); 22 Feb 2007 16:56:26 -0000 Received: (qmail 14778 invoked by uid 22791); 22 Feb 2007 16:56:24 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Feb 2007 16:56:17 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l1MGuFID016646; Thu, 22 Feb 2007 11:56:15 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l1MGu1O5026846; Thu, 22 Feb 2007 11:56:13 -0500 Received: from [127.0.0.1] (vpn-15-70.rdu.redhat.com [10.11.15.70]) by potter.sfbay.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l1MGtwb2016902; Thu, 22 Feb 2007 11:56:00 -0500 Message-ID: <45DDCB1D.6050605@redhat.com> Date: Thu, 22 Feb 2007 16:56:00 -0000 From: Dave Brolley User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) MIME-Version: 1.0 To: Joern Rennecke CC: cgen@sources.redhat.com Subject: Re: insert evaluation for multi-ifields broken 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> <20070222160755.GB8064@elsdt-razorfish.arc.com> In-Reply-To: <20070222160755.GB8064@elsdt-razorfish.arc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00060.txt.bz2 Joern Rennecke wrote: >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. > > This does appear to be broken. This is probably the first time someone has attempted this, since you could use f-a and f-c directly. (dni swi "" "swi" (+ (f-a 1) (f-b 3) (f-c 2) (f-d 4)) () (sequence () (set pc (c-call SI "foo_trap" pc 0))) ) Multi-ifields are generally used in conjuction with an operand. I'm not saying you shouldn't be able to do what you're attempting, just that no one has likely tried it before. Dave >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) > > >------------------------------------------------------------------------ > >(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))) >) > > >