]> sourceware.org Git - cgen.git/commitdiff
2000-11-24 Ben Elliston <bje@redhat.com>
authorBen Elliston <bje@air.not.au>
Fri, 24 Nov 2000 04:25:32 +0000 (04:25 +0000)
committerBen Elliston <bje@air.not.au>
Fri, 24 Nov 2000 04:25:32 +0000 (04:25 +0000)
* sim-cpu.scm (-gen-hardware-struct): New function.
(-gen-hardware-types): If with-multiple-isa is specified, emit all
hardware elements wich have share one or more ISAs with the ISAs
being kept.

ChangeLog
sim-cpu.scm

index 4084c52ba32c4d701a186f15bd7ec1c082c839a9..3e6b4fc6a7a8c1f09b459e840a6e4f7888b3aac7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2000-11-24  Ben Elliston  <bje@redhat.com>
 
+       * sim-cpu.scm (-gen-hardware-struct): New function.
+       (-gen-hardware-types): If with-multiple-isa is specified, emit all
+       hardware elements wich have share one or more ISAs with the ISAs
+       being kept.
+
        * sim.scm (-with-multiple-isa?): New symbol.
        (with-multiple-isa?): New function.
        (option-init!): Initialise -with-multiple-isa?.
index 3399f17c26c197a815261278e9703905060c1d26..b3b744f266f337135e517f84342586ca860e2acc 100644 (file)
   (and (register? hw) (not (obj-has-attr? hw 'VIRTUAL)))
 )
 
+; Subroutine of -gen-hardware-types to generate the struct containing
+; hardware elements of one isa.
+
+(define (-gen-hardware-struct hw-list)
+  (if (null? hw-list)
+      ; If struct is empty, leave it out to simplify generated code.
+      ""
+      (string-list-map (lambda (hw)
+                        (string-list
+                         (gen-decl hw)
+                         (gen-obj-sanitize hw
+                                           (string-list
+                                            (send hw 'gen-get-macro)
+                                            (send hw 'gen-set-macro)))))
+                      (find hw-need-storage? hw-list)))
+  )
+
 ; Return C type declarations of all of the hardware elements.
 ; The name of the type is prepended with the cpu family name.
 
    "typedef struct {\n"
    "  /* Hardware elements.  */\n"
    "  struct {\n"
-   (string-list-map (lambda (hw)
-                     (string-list
-                      (gen-decl hw)
-                      (gen-obj-sanitize hw
-                                        (string-list
-                                         (send hw 'gen-get-macro)
-                                         (send hw 'gen-set-macro)))
-                      ))
-                   (find hw-need-storage? (current-hw-list)))
+   (-gen-hardware-struct 
+    (find (lambda (hw)
+           (or (not (with-multiple-isa?))
+               (>= (count-common
+                    (current-keep-isa-name-list)
+                    (bitset-attr->list (obj-attr-value hw 'ISA)))
+                   1)))
+         (current-hw-list))
+    )
    "  } hardware;\n"
    "#define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)\n"
    ;"  /* CPU profiling state information.  */\n"
This page took 0.026796 seconds and 5 git commands to generate.