diff --git a/src/isa/mips32isainfo.h b/src/isa/mips32isainfo.h index f4aebd5eb..2ade3f7c6 100644 --- a/src/isa/mips32isainfo.h +++ b/src/isa/mips32isainfo.h @@ -13,9 +13,7 @@ class ISAInfo : public MIPSISAInfoBase { for (const auto &ext : extensions) { if (supportsExtension(ext)) { m_enabledExtensions << ext; - } /*else { - assert(false && "Invalid extension specified for ISA"); - }*/ + } } } @@ -29,9 +27,7 @@ class ISAInfo : public MIPSISAInfoBase { } QString CCmabi() const override { return "ilp32"; } - unsigned instrByteAlignment() const override { - return extensionEnabled("C") ? 2 : 4; - }; + unsigned instrByteAlignment() const override { return 4; }; }; } // namespace Ripes diff --git a/src/isa/mipsisainfo_common.h b/src/isa/mipsisainfo_common.h index 665ea8f73..f5a7f5dc9 100644 --- a/src/isa/mipsisainfo_common.h +++ b/src/isa/mipsisainfo_common.h @@ -138,15 +138,9 @@ class MIPSISAInfoBase : public ISAInfoBase { public: unsigned int regCnt() const override { return 34; } QString regName(unsigned i) const override { - QString regNameDollar = MIPSISA::RegNames.size() > static_cast(i) - ? MIPSISA::RegNames.at(static_cast(i)) - : QString(); - regNameDollar.prepend("$"); - regNameDollar.prepend("x"); return (MIPSISA::RegNames.size() > static_cast(i) ? MIPSISA::RegNames.at(static_cast(i)) : QString()); - // return regNameDollar; } QString regAlias(unsigned i) const override { return MIPSISA::RegAliases.size() > static_cast(i) @@ -167,19 +161,19 @@ class MIPSISAInfoBase : public ISAInfoBase { unsigned elfMachineId() const override { return EM_MIPS; } unsigned int regNumber(const QString ®, bool &success) const override { QString regRes = reg; - QString regNoDollar = regRes.remove('$'); - + success = true; if (reg[0] != '$') { success = false; return 0; } - success = true; - if (reg[0] == '$' && (MIPSISA::RegNames.count(reg) != 0)) { + QString regNoDollar = regRes.remove('$'); + + if (MIPSISA::RegNames.count(reg) != 0) { regRes.remove('$'); return regRes.toInt(&success, 10); - } else if (MIPSISA::RegAliases.contains(regNoDollar)) { - return MIPSISA::RegAliases.indexOf(regNoDollar); + } else if (int idx = MIPSISA::RegAliases.indexOf(regNoDollar); idx != -1) { + return idx; } success = false; return 0;