A32: Implement Thumb-1 variant of NOP

This commit is contained in:
Lioncash 2019-05-03 10:36:27 -04:00 committed by MerryMage
parent 81b908b077
commit 64879396f6
3 changed files with 12 additions and 0 deletions

View file

@ -87,6 +87,9 @@ std::optional<std::reference_wrapper<const Thumb16Matcher<V>>> DecodeThumb16(u16
INST(&V::thumb16_ADD_sp_t2, "ADD (SP plus imm, T2)", "101100000vvvvvvv"), // v4T INST(&V::thumb16_ADD_sp_t2, "ADD (SP plus imm, T2)", "101100000vvvvvvv"), // v4T
INST(&V::thumb16_SUB_sp, "SUB (SP minus imm)", "101100001vvvvvvv"), // v4T INST(&V::thumb16_SUB_sp, "SUB (SP minus imm)", "101100001vvvvvvv"), // v4T
// Hint instructions
INST(&V::thumb16_NOP, "NOP", "1011111100000000"), // v6T2
// Miscellaneous 16-bit instructions // Miscellaneous 16-bit instructions
INST(&V::thumb16_SXTH, "SXTH", "1011001000mmmddd"), // v6 INST(&V::thumb16_SXTH, "SXTH", "1011001000mmmddd"), // v6
INST(&V::thumb16_SXTB, "SXTB", "1011001001mmmddd"), // v6 INST(&V::thumb16_SXTB, "SXTB", "1011001001mmmddd"), // v6

View file

@ -246,6 +246,10 @@ public:
return fmt::format("sub sp, sp, #{}", imm32); return fmt::format("sub sp, sp, #{}", imm32);
} }
std::string thumb16_NOP() {
return "nop";
}
std::string thumb16_SXTH(Reg m, Reg d) { std::string thumb16_SXTH(Reg m, Reg d) {
return fmt::format("sxth {}, {}", d, m); return fmt::format("sxth {}, {}", d, m);
} }

View file

@ -667,6 +667,11 @@ struct ThumbTranslatorVisitor final {
return true; return true;
} }
// NOP<c>
bool thumb16_NOP() {
return true;
}
// SXTH <Rd>, <Rm> // SXTH <Rd>, <Rm>
// Rd cannot encode R15. // Rd cannot encode R15.
bool thumb16_SXTH(Reg m, Reg d) { bool thumb16_SXTH(Reg m, Reg d) {