OSDN Git Service

* snapshot of work toward more complete support of derived-operands
authorfche <fche>
Tue, 22 Aug 2000 19:14:30 +0000 (19:14 +0000)
committerfche <fche>
Tue, 22 Aug 2000 19:14:30 +0000 (19:14 +0000)
2000-08-22  Frank Ch. Eigler  <fche@redhat.com>

* Makefile.in (DIST_COMMON): Regenerated.
* ifield.scm (derived-ifield needed-iflds): New method.
* iformat.scm (-ifmt-lookup-sfmt!): Use base ifields for
sfmts built from derived-ifields.
* operand.scm (-derived-parse-encoding): Give derived-ifield a fixed
type symbol 'derived-ifield, not an unparseable string.
* utils-sim.scm (op-needed-iflds) Handler 'derived-ifield case.
(-sfmt-contents): Add tracing.

From Doug Evans <dje@transmeta.com>:
* sim.scm (operand cxmake-get): Result is a <c-expr>, not a string of
C code.

cgen/ChangeLog
cgen/Makefile.in
cgen/ifield.scm
cgen/iformat.scm
cgen/operand.scm
cgen/sim.scm
cgen/utils-sim.scm

index fcce2cb..c712d17 100644 (file)
@@ -1,3 +1,18 @@
+2000-08-22  Frank Ch. Eigler  <fche@redhat.com>
+
+       * Makefile.in (DIST_COMMON): Regenerated.
+       * ifield.scm (derived-ifield needed-iflds): New method.
+       * iformat.scm (-ifmt-lookup-sfmt!): Use base ifields for
+       sfmts built from derived-ifields.
+       * operand.scm (-derived-parse-encoding): Give derived-ifield a fixed
+       type symbol 'derived-ifield, not an unparseable string.
+       * utils-sim.scm (op-needed-iflds) Handler 'derived-ifield case.
+       (-sfmt-contents): Add tracing.
+
+       From Doug Evans <dje@transmeta.com>:
+       * sim.scm (operand cxmake-get): Result is a <c-expr>, not a string of
+       C code.
+
 2000-08-20  Doug Evans  <dje@casey.transmeta.com>
 
        * rtl-c.scm (rtl-c-expr-with-estate): New fn.
index e42cf2e..53bbad9 100644 (file)
@@ -84,8 +84,8 @@ CLEANFILES = tmp-*
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_CLEAN_FILES = 
-DIST_COMMON =  README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
-Makefile.in NEWS aclocal.m4 configure configure.in
+DIST_COMMON =  README AUTHORS ChangeLog INSTALL Makefile.am Makefile.in \
+NEWS aclocal.m4 configure configure.in
 
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
index 0a47f02..768c834 100644 (file)
@@ -971,6 +971,15 @@ Define an instruction multi-field, all arguments specified.
              nil)
 )
 
+
+(method-make!
+ <derived-ifield> 'needed-iflds
+ (lambda (self)
+   (find (lambda (ifld) (not (ifld-constant? ifld)))
+        (elm-get self 'subfields)))
+)
+
+
 (method-make!
  <derived-ifield> 'make!
  (lambda (self name comment attrs owner subfields)
index 1717f38..5ddef25 100644 (file)
                                 (-fmt-desc-cti? fmt-desc)
                                 (-fmt-desc-in-ops fmt-desc)
                                 (-fmt-desc-out-ops fmt-desc)
-                                (-fmt-desc-used-iflds fmt-desc))))
+                                (ifields-base-ifields (-fmt-desc-used-iflds fmt-desc)))))
          (logit 3 "Creating sformat " (number->string sfmt-index) ".\n")
          (insn-set-sfmt! insn sfmt)
          (append! sfmt-list (list sfmt))
index 03a5217..0c58743 100644 (file)
   (let ((iflds (-parse-insn-format "anyof encoding" encoding)))
     (make <derived-ifield>
          operand-name
-         (string-append "<derived-ifield> for " operand-name)
+         'derived-ifield ; (string-append "<derived-ifield> for " operand-name)
          atlist-empty
          #f ; owner
          iflds ; subfields
                                                  (length args)))
                       )))
            (elm-set! result 'hw-name (obj:name (hardware-for-mode mode-obj)))
+           ;(elm-set! result 'hw-name (obj:name parsed-encoding))
+           ;(elm-set! result 'hw-name base-ifield)
            (elm-set! result 'index parsed-encoding)
            ; (elm-set! result 'index (hw-index-derived)) ; A temporary dummy
            (logit 1 "new derived-operand; name=" name " hw-name= " (op:hw-name result) 
index 7f2b6b0..439e5cf 100644 (file)
           ((op:getter self)
            (let ((args (car (op:getter self)))
                  (expr (cadr (op:getter self))))
-             (rtl-c mode expr
-                    (if (= (length args) 0)
-                        nil
-                        (list (list (car args) 'UINT index)))
-                    #:rtl-cover-fns? #t)))
+             (rtl-c-expr mode expr
+                         (if (= (length args) 0)
+                             nil
+                             (list (list (car args) 'UINT index)))
+                         #:rtl-cover-fns? #t)))
           (else
            (send (op:type self) 'cxmake-get estate mode index selector)))))
 )
index e0951ad..d24d775 100644 (file)
 
 (define (op-needed-iflds op sfmt)
   (let ((indx (op:index op)))
-    (if (and (eq? (hw-index:type indx) 'ifield)
-            (not (= (ifld-length (hw-index:value indx)) 0)))
-       (hw-needed-iflds (op:type op) op sfmt)
-       nil))
-)
+    (logit 4 "op-needed-iflds op=" (obj:name op) " indx=" (obj:name indx)
+          " indx-type=" (hw-index:type indx) " sfmt=" (obj:name sfmt) "\n")
+    (cond
+     ((and 
+       (eq? (hw-index:type indx) 'ifield)
+       (not (= (ifld-length (hw-index:value indx)) 0)))
+      (hw-needed-iflds (op:type op) op sfmt))
+     ((eq? (hw-index:type indx) 'derived-ifield)
+      (ifld-needed-iflds indx))
+     (else nil)))
+  ;;;; EUREKA ******
+  )
 \f
 ; Operand extraction (ARGBUF) support code.
 ;
                           (else
                            #f))))
        )
+    (logit 4 
+          "-sfmt-contents sfmt=" (obj:name sfmt) 
+          " needed-iflds=" (string-map obj:name needed-iflds)
+          " extracted-ops=" (string-map obj:name extracted-ops)
+          " in-ops=" (string-map obj:name in-ops)
+          " out-ops=" (string-map obj:name out-ops)
+          "\n")
     (cons sfmt
          (sort
           ; Compute list of all things we need to record at extraction time.