A32/translate_thumb: Add helper function for raising exceptions

Similar to the variant within the ARM-mode translator visitor. This will
be used in subsequent changes to implement the hint instructions
introduced in ARMv7.
This commit is contained in:
Lioncash 2019-05-03 10:40:12 -04:00 committed by MerryMage
parent 64879396f6
commit 07699b47ba

View file

@ -41,6 +41,13 @@ struct ThumbTranslatorVisitor final {
return false; return false;
} }
bool RaiseException(Exception exception) {
ir.BranchWritePC(ir.Imm32(ir.current_location.PC() + 2));
ir.ExceptionRaised(exception);
ir.SetTerm(IR::Term::CheckHalt{IR::Term::ReturnToDispatch{}});
return false;
}
// LSLS <Rd>, <Rm>, #<imm5> // LSLS <Rd>, <Rm>, #<imm5>
bool thumb16_LSL_imm(Imm<5> imm5, Reg m, Reg d) { bool thumb16_LSL_imm(Imm<5> imm5, Reg m, Reg d) {
const u8 shift_n = imm5.ZeroExtend<u8>(); const u8 shift_n = imm5.ZeroExtend<u8>();