]> sourceware.org Git - cgen.git/commitdiff
* rtl-xform.scm (rtx-simplify-insn): New function.
authorDoug Evans <xdje42@gmail.com>
Mon, 22 Jun 2009 07:02:36 +0000 (07:02 +0000)
committerDoug Evans <xdje42@gmail.com>
Mon, 22 Jun 2009 07:02:36 +0000 (07:02 +0000)
* html.scm (gen-insn-docs): Call it.
* sem-frags.scm (sem-find-common-frags, -frag-test-data): Ditto.
* iformat.scm (ifmt-analyze): Minor simplification.

ChangeLog
html.scm
iformat.scm
insn.scm
rtl-xform.scm
sem-frags.scm

index b359450ac30d52259f6c2aa8933ea939d84608fd..bb3c2f837174aa050b24be24be94e7c1c1730ed3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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.
index f91fc19d6a998bd60fb556ab2bee983204f76d67..43fbe765284e30d0082f561d42550ac7f0534cda 100644 (file)
--- a/html.scm
+++ b/html.scm
@@ -831,9 +831,7 @@ See the input .cpu file(s) for copyright information.
   ; 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))
index e8179c8faaba9d9bb60790714ac1651855ed839a..41139ae4087d4d060ae8bc0ecfa7dd0f34057f4f 100644 (file)
        (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))))
index 445e46560caa724759c49c41fbc17209264b5f1e..a8016865121679828c63e7af26629672b5884280 100644 (file)
--- a/insn.scm
+++ b/insn.scm
@@ -64,7 +64,7 @@
                (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.
index 76c54eddb6e21560f30fbbc1a5c86b7336670efc..707a48dfced1c44a55f37f1d9b35fbfde7540af7 100644 (file)
 )
 
 ; 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)
 
index a56f65d1b84eb8926909ce6d49485108b96abd86..136e03fa383c62801f2db04bbafa6ab3cd5cab3d 100644 (file)
    (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))))
 )
This page took 0.045217 seconds and 5 git commands to generate.