aboutsummaryrefslogtreecommitdiff
path: root/disasm/isa_parser.cc
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2024-06-20 16:40:33 -0700
committerAndrew Waterman <andrew@sifive.com>2024-06-20 16:40:33 -0700
commitc6cb05ceb7951d48cc4a94b7b5b25bff82581d56 (patch)
tree157cec632bfc61630c17bebda9d7f6f3850e4779 /disasm/isa_parser.cc
parentfe47d091e1bd833ec0e1250df1414ace63c19cac (diff)
downloadriscv-isa-sim-c6cb05ceb7951d48cc4a94b7b5b25bff82581d56.zip
riscv-isa-sim-c6cb05ceb7951d48cc4a94b7b5b25bff82581d56.tar.gz
riscv-isa-sim-c6cb05ceb7951d48cc4a94b7b5b25bff82581d56.tar.bz2
In isa_parser, move extensionology code before error-checking code
Resolves #1696
Diffstat (limited to 'disasm/isa_parser.cc')
-rw-r--r--disasm/isa_parser.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/disasm/isa_parser.cc b/disasm/isa_parser.cc
index 7d3d002..7c607d7 100644
--- a/disasm/isa_parser.cc
+++ b/disasm/isa_parser.cc
@@ -330,26 +330,6 @@ isa_parser_t::isa_parser_t(const char* str, const char *priv)
bad_isa_string(str, ("can't parse: " + std::string(p)).c_str());
}
- if (extension_table[EXT_ZCMLSD] && extension_table[EXT_ZCF]) {
- bad_isa_string(str, "'Zcmlsd' extension conflicts with 'Zcf' extensions");
- }
-
- if (extension_table[EXT_ZCMLSD] && (!extension_table[EXT_ZCA] || !extension_table[EXT_ZILSD])) {
- bad_isa_string(str, "'Zcmlsd' extension requires 'Zca' and 'Zilsd' extensions");
- }
-
- if (extension_table[EXT_ZFBFMIN] && !extension_table['F']) {
- bad_isa_string(str, "'Zfbfmin' extension requires 'F' extension");
- }
-
- if ((extension_table[EXT_ZVFBFMIN] || extension_table[EXT_ZVFBFWMA]) && !extension_table['V']) {
- bad_isa_string(str, "'Zvfbfmin/Zvfbfwma' extension requires 'V' extension");
- }
-
- if (extension_table[EXT_ZFBFMIN] || extension_table[EXT_ZVFBFMIN] || extension_table[EXT_ZFHMIN]) {
- extension_table[EXT_INTERNAL_ZFH_MOVE] = true;
- }
-
if (extension_table['A']) {
extension_table[EXT_ZAAMO] = true;
extension_table[EXT_ZALRSC] = true;
@@ -373,6 +353,26 @@ isa_parser_t::isa_parser_t(const char* str, const char *priv)
extension_table[EXT_ZCD] = true;
}
+ if (extension_table[EXT_ZCMLSD] && extension_table[EXT_ZCF]) {
+ bad_isa_string(str, "'Zcmlsd' extension conflicts with 'Zcf' extensions");
+ }
+
+ if (extension_table[EXT_ZCMLSD] && (!extension_table[EXT_ZCA] || !extension_table[EXT_ZILSD])) {
+ bad_isa_string(str, "'Zcmlsd' extension requires 'Zca' and 'Zilsd' extensions");
+ }
+
+ if (extension_table[EXT_ZFBFMIN] && !extension_table['F']) {
+ bad_isa_string(str, "'Zfbfmin' extension requires 'F' extension");
+ }
+
+ if ((extension_table[EXT_ZVFBFMIN] || extension_table[EXT_ZVFBFWMA]) && !extension_table['V']) {
+ bad_isa_string(str, "'Zvfbfmin/Zvfbfwma' extension requires 'V' extension");
+ }
+
+ if (extension_table[EXT_ZFBFMIN] || extension_table[EXT_ZVFBFMIN] || extension_table[EXT_ZFHMIN]) {
+ extension_table[EXT_INTERNAL_ZFH_MOVE] = true;
+ }
+
if (extension_table[EXT_ZFINX] && extension_table['F']) {
bad_isa_string(str, ("Zfinx/Zdinx/Zhinx{min} extensions conflict with 'F/D/Q/Zfh{min}' extensions"));
}