From: Andrew Waterman Date: Fri, 11 Sep 2015 22:13:52 +0000 (-0700) Subject: Simplify register_base_instructions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00e04a6b0b875f5c4dd51fcf24ca6bb031f59769;p=riscv-isa-sim.git Simplify register_base_instructions --- diff --git a/riscv/processor.cc b/riscv/processor.cc index 962e9cd..8870cc9 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -557,17 +557,13 @@ void processor_t::register_extension(extension_t* x) void processor_t::register_base_instructions() { - std::map> opcodes; - #define DECLARE_INSN(name, match, mask) \ - opcodes[#name] = std::make_pair(match, mask); + insn_bits_t name##_match = (match), name##_mask = (mask); #include "encoding.h" #undef DECLARE_INSN #define DEFINE_INSN(name) \ - if (!opcodes.count(#name)) \ - throw std::logic_error("opcode for " #name " not found"); \ - REGISTER_INSN(this, name, opcodes[#name].first, opcodes[#name].second) + REGISTER_INSN(this, name, name##_match, name##_mask) #include "insn_list.h" #undef DEFINE_INSN