(number key ifields mask-length length mask eg-insn)
)
-; Traverse the ifield list to collect all base (non-derived) ifields
-; used in it.
-
-(define (ifields-base-ifields ifld-list)
- (collect ifld-base-ifields ifld-list)
-)
-
; Return enum cgen_fmt_type value for FMT.
; ??? Not currently used.
(map isa-base-insn-bitsize
(map current-isa-lookup
(collect (lambda (ifld)
- (bitset-attr->list (atlist-attr-value (obj-atlist ifld) 'ISA #f)))
+ (atlist-attr-value (obj-atlist ifld) 'ISA #f))
fld-list))))))
(if (= 1 (length isa-base-bitsizes))
(min (car isa-base-bitsizes) (compute-insn-length fld-list))
; Compute an iformat descriptor used to build an <iformat> object for INSN.
;
-; If COMPUTE-SFORMAT? is #t compile the semantics and compute the semantic
-; format (same as instruction format except that operands are used to
+; If COMPUTE-SFORMAT? is #t compute the semantic format
+; (same as instruction format except that operands are used to
; distinguish insns).
; Attributes derivable from the semantics are also computed.
; This is all done at the same time to minimize the number of times the
; semantic code is traversed.
+; The semantics of INSN must already be canonicalized and stored in
+; canonical-semantics.
;
; The result is (descriptor compiled-semantics attrs).
-; `descriptor' is #f for insns with an empty field list
-; (this happens for virtual insns).
-; `compiled-semantics' is #f if COMPUTE-SFORMAT? is #f.
+; `descriptor' and `compiled-semantics' are #f for insns with an empty
+; field list. This happens for virtual insns.
; `attrs' is an <attr-list> object of attributes derived from the semantics.
;
; ??? We never traverse the semantics of virtual insns.
; Field list is unspecified.
(list #f #f atlist-empty)
- ; FIXME: error checking (e.g. missing or overlapping bits)
- (let* ((sem (insn-semantics insn))
+ (let* ((sem (insn-canonical-semantics insn))
; Compute list of input and output operands if asked for.
(sem-ops (if compute-sformat?
(semantic-compile #f ; FIXME: context
(if sem
(semantic-attrs #f ; FIXME: context
insn sem)
- atlist-empty))))
- )
+ atlist-empty)))))
+
(let ((compiled-sem (csem-code sem-ops))
(in-ops (csem-inputs sem-ops))
(out-ops (csem-outputs sem-ops))
(attrs (csem-attrs sem-ops))
(cti? (or (atlist-cti? (csem-attrs sem-ops))
- (insn-cti? insn))))
+ (insn-cti-attr? insn))))
+
(list (make <fmt-desc>
cti? sorted-ifields in-ops out-ops
(if (and in-ops out-ops)
; intelligent processing of it later.
(for-each (lambda (insn)
- (logit 3 "Scanning operands of " (obj:name insn) ": "
+ (logit 2 "Scanning operands of " (obj:name insn) ": "
(insn-syntax insn) " ...\n")
(let ((sem-ops (ifmt-analyze insn compute-sformat?)))
(insn-set-fmt-desc! insn (car sem-ops))
)
(for-each (lambda (insn)
- (logit 3 "Processing format for " (obj:name insn) ": "
+ (logit 2 "Processing format for " (obj:name insn) ": "
(insn-syntax insn) " ...\n")
(let ((fmt-desc (insn-fmt-desc insn)))