From 00e04a6b0b875f5c4dd51fcf24ca6bb031f59769 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 11 Sep 2015 15:13:52 -0700 Subject: [PATCH] Simplify register_base_instructions --- riscv/processor.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 -- 2.30.2