OSDN Git Service

* sim-cpu.scm (gen-semantic-code): Prepend with setup-semantics
authorhp <hp>
Wed, 19 Jun 2002 22:43:22 +0000 (22:43 +0000)
committerhp <hp>
Wed, 19 Jun 2002 22:43:22 +0000 (22:43 +0000)
code.

cgen/ChangeLog
cgen/sim-cpu.scm

index 8df7564..bafe0b8 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-20  Hans-Peter Nilsson  <hp@axis.com>
+
+       * sim-cpu.scm (gen-semantic-code): Prepend with setup-semantics
+       code.
+
 2002-06-18  Dave Brolley  <brolley@redhat.com>
 
        * cpu/frv.cpu: New cpu description.
index 107c9cb..edfdb29 100644 (file)
@@ -529,15 +529,26 @@ SEM_FN_NAME (@prefix@,init_idesc_table) (SIM_CPU *current_cpu)
 ; Return C code to perform the semantics of INSN.
 
 (define (gen-semantic-code insn)
-  ; Indicate generating code for INSN.
-  ; Use the compiled form if available.
-  ; The case when they're not available is for virtual insns.
-  (let ((sem (insn-compiled-semantics insn)))
-    (if sem
-       (rtl-c-parsed VOID sem nil
-                     #:rtl-cover-fns? #t #:owner insn)
-       (rtl-c VOID (insn-semantics insn) nil
-              #:rtl-cover-fns? #t #:owner insn)))
+  (string-append
+   (if (and (insn-real? insn)
+           (isa-setup-semantics (current-isa)))
+       (string-append
+       "  "
+       (rtl-c VOID (isa-setup-semantics (current-isa)) nil
+              #:rtl-cover-fns? #t
+              #:owner insn)
+       "\n")
+       "")
+
+   ; Indicate generating code for INSN.
+   ; Use the compiled form if available.
+   ; The case when they're not available is for virtual insns.
+   (let ((sem (insn-compiled-semantics insn)))
+     (if sem
+        (rtl-c-parsed VOID sem nil
+                      #:rtl-cover-fns? #t #:owner insn)
+        (rtl-c VOID (insn-semantics insn) nil
+               #:rtl-cover-fns? #t #:owner insn))))
 )
 
 ; Return definition of C function to perform INSN.