OSDN Git Service

* better support multiple-isa devices.
authorfche <fche>
Thu, 7 Feb 2002 18:46:19 +0000 (18:46 +0000)
committerfche <fche>
Thu, 7 Feb 2002 18:46:19 +0000 (18:46 +0000)
2002-01-25  Frank Ch. Eigler  <fche@redhat.com>

        * sid-cpu.scm (-gen-hardware-types): Generate single hardware union
        for multiple-isa configurations.
        * sid-decode.scm (-gen-decode-fn): Tolerate empty insn list.

cgen/ChangeLog
cgen/sid-cpu.scm
cgen/sid-decode.scm

index 03590b1..b2c1448 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-25  Frank Ch. Eigler  <fche@redhat.com>
+
+       * sid-cpu.scm (-gen-hardware-types): Generate single hardware union
+       for multiple-isa configurations.
+       * sid-decode.scm (-gen-decode-fn): Tolerate empty insn list.
+
 2002-02-04  Ben Elliston  <bje@redhat.com>
 
        * cpu/sh.cpu, cpu/sh.opc: New files.
index 938826e..96a4823 100644 (file)
@@ -196,36 +196,7 @@ namespace @arch@ {
 (define (-gen-hardware-types)
   (string-list
    "// CPU state information.\n\n"
-   (if (with-multiple-isa?)
-       (let ((keep-isas (current-keep-isa-name-list))
-            (candidates (find hw-need-storage? (current-hw-list))))
-        (string-list
-         ; First emit a struct that contains all the common elements.
-         ; A common element is one supported by more than isa.
-         (-gen-hardware-struct #f
-                               (find (lambda (hw)
-                                       (> (count-common
-                                           keep-isas
-                                           (bitset-attr->list
-                                            (obj-attr-value hw 'ISA)))
-                                          1))
-                                     candidates))
-         ; Now emit structs for each isa.  These contain entries for elements
-         ; supported by exactly one isa.
-         (string-list-map (lambda (isa)
-                            (-gen-hardware-struct
-                             isa
-                             (find (lambda (hw)
-                                     (= (count-common
-                                         keep-isas
-                                         (bitset-attr->list
-                                          (obj-attr-value hw 'ISA)))
-                                        1))
-                                   candidates)))
-                          keep-isas)
-         ))
-       (-gen-hardware-struct #f (find hw-need-storage? (current-hw-list))))
-   )
+   (-gen-hardware-struct #f (find hw-need-storage? (current-hw-list))))
 )
 
 ; Generate <cpu>-cpu.h
index 65e21a9..5b8ddc6 100644 (file)
@@ -634,12 +634,14 @@ static void
     ; Compute INITIAL-BITNUMS if not supplied.
     ; 0 is passed for the start bit (it is independent of lsb0?)
     (if (null? initial-bitnums)
-       (set! initial-bitnums (decode-get-best-bits insn-list nil
-                                                   0 ; startbit
-                                                   8 ; max
-                                                   decode-bitsize
-                                                   lsb0?)))
-
+       (set! initial-bitnums
+             (if (= 0 (length insn-list)) (list 0) ; dummy value
+                 (decode-get-best-bits insn-list nil
+                                       0 ; startbit
+                                       8 ; max
+                                       decode-bitsize
+                                       lsb0?))))
+       
     ; All set.  gen-decoder does the hard part, we just print out the result. 
     (let ((decode-code (gen-decoder insn-list initial-bitnums
                                    decode-bitsize