From 07699b47ba3509d7f6dfc58029d748a5176679c7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 May 2019 10:40:12 -0400 Subject: [PATCH] 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. --- src/frontend/A32/translate/translate_thumb.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/frontend/A32/translate/translate_thumb.cpp b/src/frontend/A32/translate/translate_thumb.cpp index 31ef1c94..bfd478a7 100644 --- a/src/frontend/A32/translate/translate_thumb.cpp +++ b/src/frontend/A32/translate/translate_thumb.cpp @@ -41,6 +41,13 @@ struct ThumbTranslatorVisitor final { 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 , , # bool thumb16_LSL_imm(Imm<5> imm5, Reg m, Reg d) { const u8 shift_n = imm5.ZeroExtend();