From c6cb05ceb7951d48cc4a94b7b5b25bff82581d56 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 20 Jun 2024 16:40:33 -0700 Subject: In isa_parser, move extensionology code before error-checking code Resolves #1696 --- disasm/isa_parser.cc | 40 ++++++++++++++++++++-------------------- 1 file 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")); } -- cgit v1.1