]> sourceware.org Git - cgen.git/commitdiff
* sid.scm (gen-ifetch): Require BITSIZE to be exactly the size
authorJim Blandy <jimb@sourceware.org>
Tue, 17 May 2005 01:47:16 +0000 (01:47 +0000)
committerJim Blandy <jimb@sourceware.org>
Tue, 17 May 2005 01:47:16 +0000 (01:47 +0000)
fetched by one of our GETIMEM* methods.
* utils-gen.scm (-extract-chunk-specs): Always fetch full
base-insn-sized chunks.

ChangeLog
sid.scm
utils-gen.scm

index b337c221ec4391d19a608fe694ed3e7bd46d9b63..14890c498b05fa935d699669de2c5a24b0d025b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-05-16  Jim Blandy  <jimb@redhat.com>
+
+       * 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  <nickc@redhat.com>
 
        * Update the address and phone number of the FSF organization in
diff --git a/sid.scm b/sid.scm
index dee51b7e2f8cb0ac6fd9bcaa8c53b246a1928882..e40d0d5016d2c4e71e4b1a226f06f49c6c8c8ebb 100644 (file)
--- a/sid.scm
+++ b/sid.scm
 ; 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)
                 (case bitsize
                   ((8) "UQI")
                   ((16) "UHI")
-                  ((24) "USI")
                   ((32) "USI")
                   (else (error "bad bitsize argument to gen-ifetch" bitsize)))
                 " (pc, "
index 9d4c4ff0b98be0b72a949ac50d1178981159d93e..ba4777ac3a10ec5fc216f4d9389311f9952a157f 100644 (file)
          (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)))))
 )
 
This page took 0.034856 seconds and 5 git commands to generate.