From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15604 invoked by alias); 17 May 2005 01:47:01 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 15424 invoked from network); 17 May 2005 01:46:58 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 17 May 2005 01:46:58 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j4H1kwet005097 for ; Mon, 16 May 2005 21:46:58 -0400 Received: from zenia.home.redhat.com (sebastian-int.corp.redhat.com [172.16.52.221]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j4H1kuO20688; Mon, 16 May 2005 21:46:57 -0400 To: cgen@sources.redhat.com Subject: PATCH: Only fetch "normal" instruction chunk sizes From: Jim Blandy Date: Tue, 17 May 2005 01:47:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-q2/txt/msg00036.txt.bz2 I've committed this. The comments in the code are supposed to explain why the code should be this way; if it's not clear, let me know. 2005-05-13 Jim Blandy * sid.scm (gen-ifetch): Require BITSIZE to be exactly the size fetched by one of our GETIMEM* methods. * utils-gen.scm (-extract-chunk-specs): Always fetch full base-insn-sized chunks. Index: cgen/sid.scm =================================================================== RCS file: /cvs/cvsfiles/devo/cgen/sid.scm,v retrieving revision 1.60.4.1 diff -c -p -r1.60.4.1 sid.scm *** cgen/sid.scm 6 Apr 2005 23:42:15 -0000 1.60.4.1 --- cgen/sid.scm 13 May 2005 07:53:55 -0000 *************** *** 173,178 **** --- 173,185 ---- ; Return C code to fetch a value from instruction memory. ; PC-VAR is the C expression containing the address of the start of the ; instruction. + ; + ; We don't bother trying to handle bitsizes that don't have a + ; corresponding GETIMEM method. Doing so would require us to take + ; endianness into account just to ensure that the requested bits end + ; up at the proper place in the result. It's easier just to make the + ; caller ask us for something we can do directly. + ; ; ??? Aligned/unaligned support? (define (gen-ifetch pc-var bitoffset bitsize) *************** *** 180,186 **** (case bitsize ((8) "UQI") ((16) "UHI") - ((24) "USI") ((32) "USI") (else (error "bad bitsize argument to gen-ifetch" bitsize))) " (pc, " --- 187,192 ---- Index: cgen/utils-gen.scm =================================================================== RCS file: /cvs/cvsfiles/devo/cgen/utils-gen.scm,v retrieving revision 1.22 diff -c -p -r1.22 utils-gen.scm *** cgen/utils-gen.scm 21 Feb 2005 09:06:22 -0000 1.22 --- cgen/utils-gen.scm 13 May 2005 07:53:55 -0000 *************** *** 308,314 **** (reverse! result) (loop (+ start chunk-length) (- remaining chunk-length) ! (cons (cons start (min chunk-length remaining)) result))))) ) --- 308,319 ---- (reverse! result) (loop (+ start chunk-length) (- remaining chunk-length) ! ; Always fetch full CHUNK-LENGTH-sized chunks here, ! ; even if we don't actually need that many bytes. ! ; gen-ifetch only handles "normal" fetch sizes, ! ; and -gen-extract-word already knows how to find what ! ; it needs if we give it too much. ! (cons (cons start chunk-length) result))))) )