From 5ae3b5f014c30b027de650e5b865baf3d9947931 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 1 Mar 2001 19:15:30 +0000 Subject: [PATCH] * branch probability hinting [cgen/ChangeLog] 2001-03-01 Frank Ch. Eigler * sid.cpu (-op-gen-set-trace[-parallel], -create-virtual-insns!): Emit LIKELY/UNLIKELY branch probability hints. * sid-decode.cpu (-gen-record-args): Ditto. [sid/include/ChangeLog] 2001-03-01 Frank Ch. Eigler * sidconfig.h (LIKELY, UNLIKELY): New conditional cover macros for gcc's __builtin_expect branch probability hinting function. * sidbusutil.h (passthrough_bus, mux_password_bus, harvard_bus): Add some branch probability hints. * sidcpuutil.h (step_pin_handler, stop_after_insns_p, {read,write}_{insn,data}_memory): Ditto. * sidpinutil.h (callback_pin::driven): Remove unnecessary assert from critical path. [eg. sid/component/mapper/ChangeLog] 2001-03-01 Frank Ch. Eigler * compMapper.cxx ({read,write}_strideoffset_any): Added b.p. hints. (write_any, read_any, locate): Ditto. [sid/component/cgen-cpu/ChangeLog] 2001-03-01 Frank Ch. Eigler * cgen-engine.h (set_pbb_engine, chain, get_next_vpc, pbb_find, pbb_find_or_alloc, pbb_before, pbb_after): Add branch probability hints. [eg. sid/component/cgen-cpu/arm7t/ChangeLog] 2001-03-01 Frank Ch. Eigler * arm-decode.cxx, -sem.cxx, -semsw.cxx: Regenerated w/ b.p. hints. * thumb-decode.cxx, -sem.cxx, -semsw.cxx: Ditto. --- ChangeLog | 6 ++++++ sid-decode.scm | 2 +- sid.scm | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8b297c..aaefba8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-03-01 Frank Ch. Eigler + + * sid.cpu (-op-gen-set-trace[-parallel], -create-virtual-insns!): + Emit LIKELY/UNLIKELY branch probability hints. + * sid-decode.cpu (-gen-record-args): Ditto. + 2001-02-02 Patrick Macdonald * desc-cpu.scm (-gen-hash-defines): Rename diff --git a/sid-decode.scm b/sid-decode.scm index 9070c2f..eaf5d79 100644 --- a/sid-decode.scm +++ b/sid-decode.scm @@ -499,7 +499,7 @@ struct @prefix@_scache { iflds) (string-list-map (lambda (op) (-gen-op-extract op sfmt #f)) operands) - " if (current_cpu->trace_extract_p)\n" + " if (UNLIKELY(current_cpu->trace_extract_p))\n" " {\n" " current_cpu->trace_stream \n" " << \"0x\" << hex << pc << dec << \" (" (gen-sym sfmt) ")\\t\"\n" diff --git a/sid.scm b/sid.scm index f08eab8..2de060c 100644 --- a/sid.scm +++ b/sid.scm @@ -1093,7 +1093,7 @@ (if (current-pbb-engine?) "" (string-append - " if (current_cpu->trace_result_p)\n" + " if (UNLIKELY(current_cpu->trace_result_p))\n" " current_cpu->trace_stream << " (send op 'gen-pretty-name mode) (if (send op 'get-index-mode) @@ -1142,7 +1142,7 @@ ; operand instance table]. ; Could just scan the operand table for the operand or hardware number, ; assuming the operand number is stored in `op'. - " if (current_cpu->trace_result_p)\n" + " if (UNLIKELY(current_cpu->trace_result_p))\n" " current_cpu->trace_stream << " (send op 'gen-pretty-name mode) (if (send op 'get-index-mode) @@ -1743,7 +1743,7 @@ // If we don't have to give up control, don't. // Note that we may overrun step_insn_count since we do the test at the // end of the block. This is defined to be ok. - if (current_cpu->stop_after_insns_p (abuf->fields.chain.insn_count)) + if (UNLIKELY(current_cpu->stop_after_insns_p (abuf->fields.chain.insn_count))) BREAK (vpc); } ")) @@ -1761,7 +1761,7 @@ // If we don't have to give up control, don't. // Note that we may overrun step_insn_count since we do the test at the // end of the block. This is defined to be ok. - if (current_cpu->stop_after_insns_p (abuf->fields.chain.insn_count)) + if (UNLIKELY(current_cpu->stop_after_insns_p (abuf->fields.chain.insn_count))) BREAK (vpc); } ")) -- 2.43.5