From: devans Date: Sat, 21 Nov 2009 18:57:58 +0000 (+0000) Subject: * sim.scm (/operand-number-elaboration-written?): New variable. X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=c7a68c28c9587d964370589f76b561a4725b69f8;p=pf3gnuchains%2Fpf3gnuchains3x.git * sim.scm (/operand-number-elaboration-written?): New variable. (/op-gen-written-update op): New function. (/op-gen-set-trace, /op-gen-set-trace-parallel): Call it. --- diff --git a/cgen/ChangeLog b/cgen/ChangeLog index d820de7456..10caab6d45 100644 --- a/cgen/ChangeLog +++ b/cgen/ChangeLog @@ -1,5 +1,9 @@ 2009-11-21 Doug Evans + * sim.scm (/operand-number-elaboration-written?): New variable. + (/op-gen-written-update op): New function. + (/op-gen-set-trace, /op-gen-set-trace-parallel): Call it. + * read.scm (/cmd-define-rtl-version): Only log rtl version if changed. * operand.scm (op-nub): Delete. diff --git a/cgen/sim.scm b/cgen/sim.scm index d91cbd349f..82b6e0ec65 100644 --- a/cgen/sim.scm +++ b/cgen/sim.scm @@ -1198,6 +1198,33 @@ " = " (cx:c newval) ";\n")) ) +(define /operand-number-elaboration-written? #f) + +;; Return code to update `written'. + +(define (/op-gen-written-update op) + (if (op:cond? op) + ;; FIXME: we don't yet handle a large number of operands + (if (< (op:num op) 32) + (string-append " written |= (1 << " + (number->string (op:num op)) + ");\n") + (begin + ;; FIXME: This creates broken simulators if with-parallel-write?. + (message (if (with-parallel-write?) "Error: " "Warning: ") + (obj:name op) + " operand number " (op:num op) + " is too large (>= 32)\n") + (if (not /operand-number-elaboration-written?) + (begin + (message "This is a current internal cgen limitation.\n") + (if (not (with-parallel-write?)) + (message "The only effect is a loss in profiling capability.\n")) + (set! /operand-number-elaboration-written? #t))) + "")) + "") +) + (define (/op-gen-set-trace op estate mode index selector newval) (string-append " {\n" @@ -1218,11 +1245,7 @@ ;else (send (op:type op) 'gen-set-quiet estate mode index selector (cx:make-with-atlist mode "opval" (cx:atlist newval)))) - (if (op:cond? op) - (string-append " written |= (1 << " - (number->string (op:num op)) - ");\n") - "") + (/op-gen-written-update op) ; TRACE_RESULT_ (cpu, abuf, hwnum, opnum, value); ; For each insn record array of operand numbers [or indices into ; operand instance table]. @@ -1249,11 +1272,7 @@ "") " " /par-operand-macro " (" (gen-sym op) ")" " = opval;\n")) - (if (op:cond? op) - (string-append " written |= (1 << " - (number->string (op:num op)) - ");\n") - "") + (/op-gen-written-update op) ; TRACE_RESULT_ (cpu, abuf, hwnum, opnum, value); ; For each insn record array of operand numbers [or indices into ; operand instance table].