diff options
author | Andrew Waterman <andrew@sifive.com> | 2019-10-07 15:03:08 +0200 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-10-08 01:42:03 -0700 |
commit | 64fa7696d2437766d8e2f4de2cf78e2a228d856e (patch) | |
tree | 657b593f234363c8aa538780f8a286ce6afd31cc | |
parent | 03b31362179b8fac3ac5fc1994f40690714b9dc6 (diff) | |
download | spike-64fa7696d2437766d8e2f4de2cf78e2a228d856e.zip spike-64fa7696d2437766d8e2f4de2cf78e2a228d856e.tar.gz spike-64fa7696d2437766d8e2f4de2cf78e2a228d856e.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 6c16ecb..0e36a4b 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) |