diff options
author | Andrew Waterman <andrew@sifive.com> | 2019-10-07 15:03:08 +0200 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2019-10-07 15:03:08 +0200 |
commit | bbe881f3c5435d02eeb7c28515bfb301470f2875 (patch) | |
tree | 40992ac01d7b5e9f2d92612b9921ee8b71380b31 | |
parent | 7cdcdfb01cb2f70aeead3743d767f2fad5c64cbf (diff) | |
download | spike-bbe881f3c5435d02eeb7c28515bfb301470f2875.zip spike-bbe881f3c5435d02eeb7c28515bfb301470f2875.tar.gz spike-bbe881f3c5435d02eeb7c28515bfb301470f2875.tar.bz2 |
Speed up compilation of disasm.cc, especially in clang
-rw-r--r-- | riscv/common.h | 2 | ||||
-rw-r--r-- | riscv/disasm.h | 4 | ||||
-rw-r--r-- | spike_main/disasm.cc | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/riscv/common.h b/riscv/common.h index 8ddd984..3c523d0 100644 --- a/riscv/common.h +++ b/riscv/common.h @@ -6,4 +6,6 @@ #define likely(x) __builtin_expect(x, 1) #define unlikely(x) __builtin_expect(x, 0) +#define NOINLINE __attribute__ ((noinline)) + #endif diff --git a/riscv/disasm.h b/riscv/disasm.h index e465fca..88d0e9b 100644 --- a/riscv/disasm.h +++ b/riscv/disasm.h @@ -30,8 +30,8 @@ struct : public arg_t { class disasm_insn_t { public: - disasm_insn_t(const char* name, uint32_t match, uint32_t mask, - const std::vector<const arg_t*>& args) + NOINLINE disasm_insn_t(const char* name, uint32_t match, uint32_t mask, + const std::vector<const arg_t*>& args) : match(match), mask(mask), args(args), name(strdup(name)) {} ~disasm_insn_t() { free(const_cast<char *>(name)); } diff --git a/spike_main/disasm.cc b/spike_main/disasm.cc index 0dbdbb7..8f778a8 100644 --- a/spike_main/disasm.cc +++ b/spike_main/disasm.cc @@ -1149,7 +1149,7 @@ const disasm_insn_t* disassembler_t::lookup(insn_t insn) const return NULL; } -void disassembler_t::add_insn(disasm_insn_t* insn) +void NOINLINE disassembler_t::add_insn(disasm_insn_t* insn) { size_t idx = HASH_SIZE; if (insn->get_mask() % HASH_SIZE == HASH_SIZE - 1) |