* html.scm (gen-insn-docs): Call it.
* sem-frags.scm (sem-find-common-frags, -frag-test-data): Ditto.
* iformat.scm (ifmt-analyze): Minor simplification.
2009-06-21 Doug Evans <dje@sebabeach.org>
+ * rtl-xform.scm (rtx-simplify-insn): New function.
+ * html.scm (gen-insn-docs): Call it.
+ * sem-frags.scm (sem-find-common-frags, -frag-test-data): Ditto.
+ * iformat.scm (ifmt-analyze): Minor simplification.
+
* semantics.scm (semantic-compile): Change arg sem-code-list to
sem-code.
(semantic-attrs): Ditto.
; First simplify the semantics, e.g. do constant folding.
; For insns built up from macros, often this will remove a lot of clutter.
(for-each (lambda (insn)
- (insn-set-tmp! insn (rtx-simplify #f insn
- (insn-semantics insn)
- (insn-build-known-values insn))))
+ (insn-set-tmp! insn (rtx-simplify-insn #f insn)))
(current-insn-list))
(let ((machs (current-mach-list))
(list #f #f atlist-empty)
; FIXME: error checking (e.g. missing or overlapping bits)
- (let* (; A list of the various bits of semantic code.
- (sem (insn-semantics insn))
+ (let* ((sem (insn-semantics insn))
; Compute list of input and output operands if asked for.
(sem-ops (if compute-sformat?
(semantic-compile #f ; FIXME: context
insn sem)
(csem-make #f #f #f
- (if (insn-semantics insn)
+ (if sem
(semantic-attrs #f ; FIXME: context
insn sem)
atlist-empty))))
(semantics . #f)
; The processed form of the above.
- ; Each element of rtl is replaced with the associated object.
+ ; This remains #f for virtual insns (FIXME: keep?).
(compiled-semantics . #f)
; The mapping of the semantics onto the host.
)
; Simplify an rtl expression.
+;
; EXPR must be in source form.
; The result is a possibly simplified EXPR, still in source form.
;
-; CONTEXT is a <context> object, used for error messages.
+; CONTEXT is a <context> object or #f, used for error messages.
; OWNER is the owner of the expression (e.g. <insn>) or #f if there is none.
;
; KNOWN is an alist of known values. Each element is (name . value) where
#f #f known 0)
#f)
)
+
+;; Return an insn's semantics simplified.
+;; CONTEXT is a <context> object or #f, used for error messages.
+
+(define (rtx-simplify-insn context insn)
+ (rtx-simplify context insn (insn-semantics insn)
+ (insn-build-known-values insn))
+)
\f
;; rtx-solve (and supporting cast)
(begin
(logit 2 "Simplifying/canonicalizing rtl ...\n")
(map (lambda (insn)
- ; Must pass canonicalized and macro-expanded rtl.
- (rtx-simplify #f insn (insn-semantics insn)
- (insn-build-known-values insn)))
+ (rtx-simplify-insn #f insn))
insn-list))
insn-list)
)
(define (-frag-test-data)
(cons
(map (lambda (insn)
- ; Must pass canonicalized and macro-expanded rtl.
- (rtx-simplify #f insn (insn-semantics insn)
- (insn-build-known-values insn)))
+ (rtx-simplify-insn #f insn))
(non-multi-insns (non-alias-insns (current-insn-list))))
(non-multi-insns (non-alias-insns (current-insn-list))))
)