From: Jim Blandy Date: Tue, 17 May 2005 01:47:16 +0000 (+0000) Subject: * sid.scm (gen-ifetch): Require BITSIZE to be exactly the size X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1741d8b73175ad6017f1d9a77eab9dd7085c5e40;p=cgen.git * 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. --- diff --git a/ChangeLog b/ChangeLog index b337c22..14890c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-05-16 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. + 2005-05-10 Nick Clifton * Update the address and phone number of the FSF organization in diff --git a/sid.scm b/sid.scm index dee51b7..e40d0d5 100644 --- a/sid.scm +++ b/sid.scm @@ -184,6 +184,13 @@ ; 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) @@ -191,7 +198,6 @@ (case bitsize ((8) "UQI") ((16) "UHI") - ((24) "USI") ((32) "USI") (else (error "bad bitsize argument to gen-ifetch" bitsize))) " (pc, " diff --git a/utils-gen.scm b/utils-gen.scm index 9d4c4ff..ba4777a 100644 --- a/utils-gen.scm +++ b/utils-gen.scm @@ -308,7 +308,12 @@ (reverse! result) (loop (+ start chunk-length) (- remaining chunk-length) - (cons (cons start (min chunk-length remaining)) + ; 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))))) )