+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.
(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
; 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