]> sourceware.org Git - cgen.git/commitdiff
* more 16/32-bit insn set support; simulator (sid)
authorFrank Ch. Eigler <fche@redhat.com>
Thu, 12 Jul 2001 02:54:39 +0000 (02:54 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Thu, 12 Jul 2001 02:54:39 +0000 (02:54 +0000)
2001-07-11  Frank Ch. Eigler  <fche@redhat.com>

* sid-cpu.scm (-gen-mach-params): New proc to emit ...CHUNK_BITSIZE...
(cgen-desc.h): Call it.
* sid-decode.scm (-gen-decode-fn): Use base-insn-bitsize as
decode-size.
* utils-sim.scm (-gen-decode-insn-entry): For SID only, prepare
entire_insn for extraction, if it's shorter than base-insn-bitsize.

ChangeLog
sid-cpu.scm
sid-decode.scm
utils-sim.scm

index 0804e891fb7de5ca5b779a092685954d2b9532aa..66f2ece5699699b30987acf351c90c5d937819f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-07-11  Frank Ch. Eigler  <fche@redhat.com>
+
+       * sid-cpu.scm (-gen-mach-params): New proc to emit ...CHUNK_BITSIZE...
+       (cgen-desc.h): Call it.
+       * sid-decode.scm (-gen-decode-fn): Use base-insn-bitsize as
+       decode-size.
+       * utils-sim.scm (-gen-decode-insn-entry): For SID only, prepare
+       entire_insn for extraction, if it's shorter than base-insn-bitsize.
+
 2001-07-11  Frank Ch. Eigler  <fche@redhat.com>
 
        * desc-cpu.scm (-gen-mach-table-defns): Emit fourth field: the
index 98434b45f95f13fe9e805eb022b908c1f616295e..16ef839e2106e3b8fc2ace72b2d98983c5187f3f 100644 (file)
       ))
 )
 
+
+; Emit a macro that specifies the word-bitsize for each machine.
+(define (-gen-mach-params)
+  (string-map (lambda (mach) 
+               (string-append
+                "#define MACH_" (string-upcase (gen-sym mach)) "_INSN_CHUNK_BITSIZE "
+                (number->string (cpu-insn-chunk-bitsize (mach-cpu mach))) "\n"))
+             (current-mach-list))
+)
+
+
 ; Generate <cpu>-desc.h.
 
 (define (cgen-desc.h)
@@ -77,6 +88,7 @@ namespace @arch@ {
 
    -gen-attr-decls
    -gen-insn-attr-decls
+   -gen-mach-params
 
    "
 } // end @arch@ namespace
index adb31572c9d6fdd9e8dec66b7af2920494e02526..d2ae1305d6af1c1aae9c138bd483750f2d92d21a 100644 (file)
@@ -629,7 +629,7 @@ static void
   ; of the instruction.
   ; ??? Make this a parameter later but only if necessary.
 
-  (let ((decode-bitsize (apply min (map insn-base-mask-length insn-list))))
+  (let ((decode-bitsize (state-base-insn-bitsize)))
 
     ; Compute INITIAL-BITNUMS if not supplied.
     ; 0 is passed for the start bit (it is independent of lsb0?)
index 3ef62cc43854a0d7698c09ed02e8d2daeb618081..fed86deeb604db4e917b4e2571a850574f553875 100644 (file)
 
      (else
       (string-append indent "  case "
-                    (number->string (dtable-entry-index entry))
-                    " : itype = "
-                    (gen-cpu-insn-enum (current-cpu) insn)
-                    "; "
+                    (number->string (dtable-entry-index entry)) " : "
+                    "itype = " (gen-cpu-insn-enum (current-cpu) insn) ";"
+                    ; Compensate for base-insn-size > current-insn-size by adjusting entire_insn.
+                    ; Activate this logic only for sid simulators; they are consistent in
+                    ; interpreting base-insn-bitsize this way.
+                    (if (and (equal? APPLICATION 'SID-SIMULATOR)
+                             (> (state-base-insn-bitsize) (insn-length insn)))
+                        (string-append
+                         " entire_insn = base_insn >> "
+                         (number->string (- (state-base-insn-bitsize) (insn-length insn)))
+                         ";")
+                        "")
                     (if (with-scache?)
                         (if fn?
-                            (string-append "@prefix@_extract_" fmt-name " (this, current_cpu, pc, base_insn, entire_insn);  goto done;\n")
-                            (string-append "goto extract_" fmt-name ";"))
+                            (string-append " @prefix@_extract_" fmt-name " (this, current_cpu, pc, base_insn, entire_insn); goto done;\n")
+                            (string-append "goto extract_" fmt-name ";\n"))
                         "goto done;\n")))))
 )
 
This page took 0.033814 seconds and 5 git commands to generate.