A32: Implement Thumb-1 variant of WFE

This commit is contained in:
Lioncash 2019-05-03 10:46:26 -04:00 committed by MerryMage
parent 57675fe592
commit b4110af22a
3 changed files with 10 additions and 0 deletions

View file

@ -90,6 +90,7 @@ std::optional<std::reference_wrapper<const Thumb16Matcher<V>>> DecodeThumb16(u16
// Hint instructions
INST(&V::thumb16_NOP, "NOP", "1011111100000000"), // v6T2
INST(&V::thumb16_SEV, "SEV", "1011111101000000"), // v7
INST(&V::thumb16_WFE, "WFE", "1011111100100000"), // v7
// Miscellaneous 16-bit instructions
INST(&V::thumb16_SXTH, "SXTH", "1011001000mmmddd"), // v6

View file

@ -254,6 +254,10 @@ public:
return "sev";
}
std::string thumb16_WFE() {
return "wfe";
}
std::string thumb16_SXTH(Reg m, Reg d) {
return fmt::format("sxth {}, {}", d, m);
}

View file

@ -684,6 +684,11 @@ struct ThumbTranslatorVisitor final {
return RaiseException(Exception::SendEvent);
}
// WFE<c>
bool thumb16_WFE() {
return RaiseException(Exception::WaitForEvent);
}
// SXTH <Rd>, <Rm>
// Rd cannot encode R15.
bool thumb16_SXTH(Reg m, Reg d) {