2002-12-19 Doug Evans <dje@sebabeach.org>
+ Back out sim*.scm changes of 2001-04-02 Ben Elliston <bje@redhat.com>
+ Instead do:
+ * sim-decode.scm (-gen-decode-insn-globals): Use @PREFIX@_INSN__MAX
+ as size of IDESC-TABLE-VAR.
+ (@prefix@_init_idesc_table): Ditto.
+ * sim-model.scm (-gen-mach-defns): Ditto.
+ * sim.scm (gen-cpu-insn-enum-decl): Rename last elm from max to -max.
+
+ * utils-scm.scm (-gen-decode-insn-entry): Fix some spacing in output.
+
+ * insn.scm (-parse-insn-format-symbol): Improve error message.
+ (-parse-insn-format): Ditto.
+
* gen-all-sim: New script.
2002-12-16 DJ Delorie <dj@delorie.com>
(let ((e (ienum-lookup-val sym)))
(if e
(ifld-new-value (ienum:fld (cdr e)) (car e))
- (parse-error errtxt "bad format element" sym)))))
+ (parse-error errtxt "bad format element, expecting symbol to be operand or insn enum" sym)))))
)
; Subroutine of -parse-insn-format to parse an (ifield-name value) ifield spec.
(if (and (list? f)
(ifield? (car f)))
(parse-error errtxt "FIXME: <ifield> object in format spec"))
- (parse-error errtxt "bad format element" f)))))
+ (parse-error errtxt "bad format element, neither symbol nor ifield spec" f)))))
(cdr fld-list)))
((=) (begin
(if (or (!= (length fld-list) 2)
(set! syntax (string-drop1 syntax))))
(loop))))
(reverse result))
- )
+)
; Given a list of syntax elements (e.g. the result of syntax-break-out),
; create a syntax string.
teensy bit of cpu in the decoder. Moving it to malloc space is trivial
but won't be done until necessary (we don't currently support the runtime
addition of instructions nor an SMP machine with different cpus). */
-static IDESC " IDESC-TABLE-VAR "[@PREFIX@_INSN_"
- (string-upcase (gen-c-symbol (caar (list-take -1
- (gen-obj-list-enums (non-multi-insns (current-insn-list))))))) " + 1];
+static IDESC " IDESC-TABLE-VAR "[@PREFIX@_INSN__MAX];
/* Commas between elements are contained in the macros.
Some of these are conditionally compiled out. */
{
IDESC *id,*tabend;
const struct insn_sem *t,*tend;
- int tabsize = sizeof (" IDESC-TABLE-VAR ") / sizeof (IDESC);
+ int tabsize = @PREFIX@_INSN__MAX;
IDESC *table = " IDESC-TABLE-VAR ";
memset (table, 0, tabsize * sizeof (IDESC));
; Return C code to define the machine data.
(define (-gen-mach-defns)
- (let* ((insns (gen-obj-list-enums (non-multi-insns (current-insn-list))))
- (last-insn (string-upcase (gen-c-symbol (caar (list-take -1 insns))))))
- (string-list-map
- (lambda (mach)
- (gen-obj-sanitize
- mach
- (string-list "\
+ (string-list-map
+ (lambda (mach)
+ (gen-obj-sanitize
+ mach
+ (string-list "\
static void\n"
(gen-sym mach) "_init_cpu (SIM_CPU *cpu)
{
CPU_PC_FETCH (cpu) = " (gen-sym (mach-cpu mach)) "_h_pc_get;
CPU_PC_STORE (cpu) = " (gen-sym (mach-cpu mach)) "_h_pc_set;
CPU_GET_IDATA (cpu) = @cpu@_get_idata;
- CPU_MAX_INSNS (cpu) = @CPU@_INSN_" last-insn " + 1;
+ CPU_MAX_INSNS (cpu) = @CPU@_INSN__MAX;
CPU_INSN_NAME (cpu) = cgen_insn_name;
CPU_FULL_ENGINE_FN (cpu) = @cpu@_engine_run_full;
#if WITH_FAST
")))
- (current-mach-list)))
+ (current-mach-list))
)
\f
; Top level file generators.
(atlist-attrs (obj-atlist i))))))
(parallel-insns insn-list)))
nil)
- (list '(max))))
+ (list '(-max))))
)
; Return the enum of INSN in cpu family CPU.
(if (with-scache?)
(if fn?
(string-append " @prefix@_extract_" fmt-name " (this, current_cpu, pc, base_insn, entire_insn); goto done;\n")
- (string-append "goto extract_" fmt-name ";\n"))
- "goto done;\n")))))
+ (string-append " goto extract_" fmt-name ";\n"))
+ " goto done;\n")))))
)
; Subroutine of -decode-expr-ifield-tracking.