+2003-02-11 Dave Brolley <brolley@redhat.com>
+
+ * desc-cpu.scm (gen-ifld-defns): Add all ifields to the
+ @arch@_cgen-ifld_table.
+ (gen-maybe-multi-ifld): Use the ifield enumerators to index the
+ @arch@_cgen-ifld_table.
+
2003-02-03 Frank Ch. Eigler <fche@redhat.com>
* sid-cpu.scm (-gen-sfrag-engine-fn): Generate more hygienic C++.
(define (gen-ifld-defns)
(logit 2 "Generating ifield table ...\n")
- (let* ((ifld-list (find (lambda (f) (not (has-attr? f 'VIRTUAL)))
- (non-derived-ifields (current-ifld-list))))
+ (let* ((ifld-list (current-ifld-list))
(all-attrs (current-ifld-attr-list))
(num-non-bools (attr-count-non-bools all-attrs)))
(string-list
" { "
(ifld-enum ifld) ", "
"\"" (obj:name ifld) "\", "
- (number->string (ifld-word-offset ifld)) ", "
- (number->string (ifld-word-length ifld)) ", "
- (number->string (ifld-start ifld #f)) ", "
- (number->string (ifld-length ifld)) ", "
+ (if
+ (or (has-attr? ifld 'VIRTUAL)
+ (derived-ifield? ifld))
+ "0, 0, 0, 0,"
+ (string-append
+ (number->string (ifld-word-offset ifld)) ", "
+ (number->string (ifld-word-length ifld)) ", "
+ (number->string (ifld-start ifld #f)) ", "
+ (number->string (ifld-length ifld)) ", "))
(gen-obj-attr-defn 'ifld ifld all-attrs
- num-non-bools gen-A-attr-mask)
+ num-non-bools gen-A-attr-mask)
" },\n")))
ifld-list)
"\
(set! field-ref (string-append "&" (ifld-enum fld) "_MULTI_IFIELD[0]"))
(set! field-count (number->string (length (elm-get fld 'subfields)))))
; else
- (set! field-ref (string-append "&@arch@_cgen_ifld_table[" (ifld-number fld) "]"))))
+ (set! field-ref (string-append "&@arch@_cgen_ifld_table[" (ifld-enum fld) "]"))))
(string-append "{ " field-count ", { (const PTR) " field-ref " } }")))
(define (gen-multi-ifield-nodes)