OSDN Git Service

* multi-ifields support in simulators
authorfche <fche>
Wed, 6 Sep 2000 19:24:45 +0000 (19:24 +0000)
committerfche <fche>
Wed, 6 Sep 2000 19:24:45 +0000 (19:24 +0000)
2000-09-06  Frank Ch. Eigler  <fche@redhat.com>

* utils-gen.scm (gen-multi-ifld-extract): Handle case of multi-ifield
with decode proc.

cgen/ChangeLog
cgen/utils-gen.scm

index 61c2010..d1dd07c 100644 (file)
@@ -1,3 +1,8 @@
+2000-09-06  Frank Ch. Eigler  <fche@redhat.com>
+
+       * utils-gen.scm (gen-multi-ifld-extract): Handle case of multi-ifield
+       with decode proc.
+
 2000-09-05  Dave Brolley  <brolley@redhat.com>
 
        * sim.scm (sim-finish!): Honour the definition of FAST_P when calling
index 9546360..8678306 100644 (file)
 
 (define (gen-multi-ifld-extract f indent base-length total-length base-value var-list macro?)
   ; The subfields must have already been extracted.
-  (let* ((extract (rtl-c VOID (multi-ifld-extract f) nil
-                        #:rtl-cover-fns? #f #:ifield-var? #t))
-        (decode-proc (ifld-decode f))
-        (decode (if decode-proc
-                    (rtl-c VOID (cadr decode-proc)
-                           (list (list (caar decode-proc) 'UINT extract)
-                                 (list (cadar decode-proc) 'IAI "pc"))
-                           #:rtl-cover-fns? #f #:ifield-var? #t)
-                    extract)))
+  (let* ((decode-proc (ifld-decode f))
+        (varname (gen-sym f))
+        (decode (string-list
+                 ;; First, the block that extract the multi-ifield into the ifld variable
+                 (rtl-c VOID (multi-ifld-extract f) nil
+                        #:rtl-cover-fns? #f #:ifield-var? #t)
+                 ;; Next, the decode routine that modifies it
+                 (if decode-proc
+                     (string-append
+                      "  " varname " = "
+                      (rtl-c VOID (cadr decode-proc)
+                             (list (list (caar decode-proc) 'UINT varname)
+                                   (list (cadar decode-proc) 'IAI "pc"))
+                             #:rtl-cover-fns? #f #:ifield-var? #t)
+                      ";\n")
+                     "")
+                )))
     (if macro?
        (backslash "\n" decode)
        decode))