diff options
author | Andrew Waterman <andrew@sifive.com> | 2023-01-13 14:49:29 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2023-01-13 15:11:53 -0800 |
commit | 39acd8e2eaf65e97dc4dbb31534285dcf591766a (patch) | |
tree | 4e5b2f55f5d063146d71daf23716edec280fae06 /riscv/isa_parser.h | |
parent | 5badd68ae1694d6c089a33a106a0c12bbee2bb9a (diff) | |
download | riscv-isa-sim-39acd8e2eaf65e97dc4dbb31534285dcf591766a.zip riscv-isa-sim-39acd8e2eaf65e97dc4dbb31534285dcf591766a.tar.gz riscv-isa-sim-39acd8e2eaf65e97dc4dbb31534285dcf591766a.tar.bz2 |
Simplify isa_parser_t::extension_enabled
Now that we guarantee that max_isa and extension_table are synchronized,
we only need to check the latter.
Diffstat (limited to 'riscv/isa_parser.h')
-rw-r--r-- | riscv/isa_parser.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/riscv/isa_parser.h b/riscv/isa_parser.h index 0575d92..4be81d8 100644 --- a/riscv/isa_parser.h +++ b/riscv/isa_parser.h @@ -87,10 +87,7 @@ public: return extension_enabled(isa_extension_t(ext)); } bool extension_enabled(isa_extension_t ext) const { - if (ext >= 'A' && ext <= 'Z') - return (max_isa >> (ext - 'A')) & 1; - else - return extension_table[ext]; + return extension_table[ext]; } const std::unordered_map<std::string, extension_t*> & get_extensions() const { return extensions; } |