From 40a52b69805709bfa535740f438f295b70bb886c Mon Sep 17 00:00:00 2001 From: fche Date: Mon, 29 Jan 2001 18:56:26 +0000 Subject: [PATCH] * belated outward merge 2001-01-26 Frank Ch. Eigler * sid-cpu.scm (gen-parallel-exec-type): Use unsigned long long for writeback tracking. (-gen-write-fn, -gen-sem-case, -gen-sfrag-case): Ditto. * sid-decode.scm (-gen-scache-decls): Exclude writeback tracking field if unnecessary. * sid.scm ( gen-write): Use unsigned long long expression for writeback. (-op-gen-set-trace, -op-gen-set-trace-parallel): Ditto. ( gen-profile-code): Ditto. 2001-01-08 Frank Ch. Eigler * operand.scm ( pretty-sem-name): New field. ( make): Initialize it from hw-name. (op:set-pretty-sem-name!): New function. ( gen-pretty-name): Default to fetching new field. * rtl.scm (hw): Copy hw-name to pretty-sem-name instead. Restore sem-name setting from -rtx-hw-name. --- cgen/ChangeLog | 21 +++++++++++++++++++++ cgen/operand.scm | 12 ++++++++++-- cgen/rtl.scm | 6 ++++-- cgen/sid-cpu.scm | 10 +++++----- cgen/sid-decode.scm | 6 +++++- cgen/sid.scm | 8 ++++---- 6 files changed, 49 insertions(+), 14 deletions(-) diff --git a/cgen/ChangeLog b/cgen/ChangeLog index 8e8e9d6cbb..e51d648cec 100644 --- a/cgen/ChangeLog +++ b/cgen/ChangeLog @@ -1,3 +1,15 @@ +2001-01-26 Frank Ch. Eigler + + * sid-cpu.scm (gen-parallel-exec-type): Use unsigned long long for + writeback tracking. + (-gen-write-fn, -gen-sem-case, -gen-sfrag-case): Ditto. + * sid-decode.scm (-gen-scache-decls): Exclude writeback tracking field + if unnecessary. + * sid.scm ( gen-write): Use unsigned long long expression + for writeback. + (-op-gen-set-trace, -op-gen-set-trace-parallel): Ditto. + ( gen-profile-code): Ditto. + 2001-01-23 Johan Rydberg * doc/rtl.texi (Expressions): Document the (index-of ...) and @@ -5,6 +17,15 @@ 2001-01-08 Frank Ch. Eigler + * operand.scm ( pretty-sem-name): New field. + ( make): Initialize it from hw-name. + (op:set-pretty-sem-name!): New function. + ( gen-pretty-name): Default to fetching new field. + * rtl.scm (hw): Copy hw-name to pretty-sem-name instead. Restore + sem-name setting from -rtx-hw-name. + +2001-01-08 Frank Ch. Eigler + * rtl.scm (hw): Copy hw-name to new operand's sem-name, to simplify its subsequent gen-pretty-name. diff --git a/cgen/operand.scm b/cgen/operand.scm index e0f6d7d60d..a3faf1da62 100644 --- a/cgen/operand.scm +++ b/cgen/operand.scm @@ -1,5 +1,5 @@ ; Operands -; Copyright (C) 2000 Red Hat, Inc. +; Copyright (C) 2000, 2001 Red Hat, Inc. ; This file is part of CGEN. ; See file COPYING.CGEN for details. @@ -27,6 +27,10 @@ ; with function unit input/output arguments. sem-name + ; Pretty name as used in tracing code. + ; Generally this is the same as the hardware element's name. + pretty-sem-name + ; Semantic name of hardware element refered to by this operand. hw-name @@ -97,6 +101,7 @@ (lambda (self name comment attrs hw-name mode-name index handlers getter setter) (elm-set! self 'name name) (elm-set! self 'sem-name name) + (elm-set! self 'pretty-sem-name hw-name) (elm-set! self 'comment comment) (elm-set! self 'attrs attrs) (elm-set! self 'hw-name hw-name) @@ -117,6 +122,7 @@ (define op:sem-name (elm-make-getter 'sem-name)) (define op:set-sem-name! (elm-make-setter 'sem-name)) +(define op:set-pretty-sem-name! (elm-make-setter 'pretty-sem-name)) (define op:hw-name (elm-make-getter 'hw-name)) (define op:mode-name (elm-make-getter 'mode-name)) (define op:selector (elm-make-getter 'selector)) @@ -215,7 +221,9 @@ (method-make! 'gen-pretty-name (lambda (self mode) - (let* ((name (if (elm-bound? self 'sem-name) (elm-get self 'sem-name) (obj:name self))) + (let* ((name (if (elm-bound? self 'pretty-sem-name) (elm-get self 'pretty-sem-name) + (if (elm-bound? self 'sem-name) (elm-get self 'sem-name) + (obj:name self)))) (pname (cond ((string=? "h-memory" (string-take 8 name)) "memory") ((string=? "h-" (string-take 2 name)) (string-drop 2 name)) (else name)))) diff --git a/cgen/rtl.scm b/cgen/rtl.scm index a11fb8ed19..6159c2e55a 100644 --- a/cgen/rtl.scm +++ b/cgen/rtl.scm @@ -1,5 +1,5 @@ ; Basic RTL support. -; Copyright (C) 2000 Red Hat, Inc. +; Copyright (C) 2000, 2001 Red Hat, Inc. ; This file is part of CGEN. ; See file COPYING.CGEN for details. @@ -2031,11 +2031,13 @@ (elm-xset! result 'type hw) (elm-xset! result 'mode mode) + (op:set-pretty-sem-name! result hw-name) + ; The name of the operand must include the index so that multiple copies ; of a hardware object (e.g. h-gr[0], h-gr[14]) can be distinguished. (let ((name (-rtx-hw-name hw hw-name index-arg))) (send result 'set-name! name) - (op:set-sem-name! result hw-name)) + (op:set-sem-name! result name)) ; Empty comment and attribute. ; ??? Stick the arguments in the comment for debugging purposes? diff --git a/cgen/sid-cpu.scm b/cgen/sid-cpu.scm index 83acc061e2..613b721a02 100644 --- a/cgen/sid-cpu.scm +++ b/cgen/sid-cpu.scm @@ -366,7 +366,7 @@ struct @prefix@_parexec { "\ } operands; /* For conditionally written operands, bitmask of which ones were. */ - unsigned written; + unsigned long long written; };\n\n" ) ) @@ -448,7 +448,7 @@ namespace @cpu@ { "") (gen-define-parallel-operand-macro sfmt) " @prefix@_scache* abuf = sem;\n" - " unsigned written = abuf->written;\n" + " unsigned long long written = abuf->written;\n" " PCADDR pc = abuf->addr;\n" " PCADDR npc = 0; // dummy value for branches\n" " sem_status status = SEM_STATUS_NORMAL; // ditto\n" @@ -545,7 +545,7 @@ using namespace @cpu@; " @prefix@_scache* abuf = sem;\n" ; Unconditionally written operands are not recorded here. (if (or (with-profile?) (with-parallel-write?)) - " unsigned written = 0;\n" + " unsigned long long written = 0;\n" "") ; The address of this insn, needed by extraction and semantic code. ; Note that the address recorded in the cpu state struct is not used. @@ -673,7 +673,7 @@ using namespace @cpu@; // FIXME: namespace organization still wip "") ; Unconditionally written operands are not recorded here. (if (or (with-profile?) (with-parallel-write?)) - " unsigned written = 0;\n" + " unsigned long long written = 0;\n" "") ; The address of this insn, needed by extraction and semantic code. ; Note that the address recorded in the cpu state struct is not used. @@ -968,7 +968,7 @@ struct @prefix@_pbb_label { "") ; Unconditionally written operands are not recorded here. (if (or (with-profile?) (with-parallel-write?)) - " unsigned written = 0;\n" + " unsigned long long written = 0;\n" "") ; The address of this insn, needed by extraction and semantic code. ; Note that the address recorded in the cpu state struct is not used. diff --git a/cgen/sid-decode.scm b/cgen/sid-decode.scm index 0c8905547a..9070c2ff76 100644 --- a/cgen/sid-decode.scm +++ b/cgen/sid-decode.scm @@ -298,10 +298,14 @@ struct @prefix@_scache { // argument buffer @prefix@_sem_fields fields; +" (if (or (with-profile?) (with-parallel-write?)) + (string-append " // writeback flags // Only used if profiling or parallel execution support enabled during // file generation. - unsigned written; + unsigned long long written; +") + "") " // decode given instruction void decode (@cpu@_cpu* current_cpu, PCADDR pc, @prefix@_insn_word base_insn, @prefix@_insn_word entire_insn); diff --git a/cgen/sid.scm b/cgen/sid.scm index b33c8cb207..f08eab8f26 100644 --- a/cgen/sid.scm +++ b/cgen/sid.scm @@ -991,7 +991,7 @@ ; all the tests can be collapsed together. Not sure that's a big ; enough win yet. (if (op:cond? self) - (string-append " if (written & (1 << " + (string-append " if (written & (1ULL << " (number->string (op:num self)) "))\n" " {\n" @@ -1081,7 +1081,7 @@ (cx:make-with-atlist mode "opval" (cx:atlist newval)))) (if (and (with-profile?) (op:cond? op)) - (string-append " written |= (1 << " + (string-append " written |= (1ULL << " (number->string (op:num op)) ");\n") "") @@ -1133,7 +1133,7 @@ " " -par-operand-macro " (" (gen-sym op) ")" " = opval;\n" (if (op:cond? op) - (string-append " written |= (1 << " + (string-append " written |= (1ULL << " (number->string (op:num op)) ");\n") "") @@ -1540,7 +1540,7 @@ (string-append " {\n" " int referenced = 0;\n" - " int UNUSED insn_referenced = abuf->written;\n" + " unsigned long long UNUSED insn_referenced = abuf->written;\n" ; Declare variables to hold unit arguments. (string-map (lambda (arg) (gen-arg-decl arg #f)) inputs) -- 2.11.0