a32/exception_generating: BPKT: Define unpredictable behaviour

Define unpredictable behaviour to be BKPT executes conditionally
This commit is contained in:
MerryMage 2018-08-25 23:01:08 +01:00
parent a12854857b
commit f0184c4b8d

View file

@ -11,14 +11,18 @@
namespace Dynarmic::A32 { namespace Dynarmic::A32 {
bool ArmTranslatorVisitor::arm_BKPT(Cond cond, Imm12 /*imm12*/, Imm4 /*imm4*/) { bool ArmTranslatorVisitor::arm_BKPT(Cond cond, Imm12 /*imm12*/, Imm4 /*imm4*/) {
if (cond != Cond::AL) { if (cond != Cond::AL && !options.define_unpredictable_behaviour) {
return UnpredictableInstruction(); return UnpredictableInstruction();
} }
// UNPREDICTABLE: The instruction executes conditionally.
if (ConditionPassed(cond)) {
ir.ExceptionRaised(Exception::Breakpoint); ir.ExceptionRaised(Exception::Breakpoint);
ir.SetTerm(IR::Term::CheckHalt{IR::Term::ReturnToDispatch{}}); ir.SetTerm(IR::Term::CheckHalt{IR::Term::ReturnToDispatch{}});
return false; return false;
} }
return true;
}
bool ArmTranslatorVisitor::arm_SVC(Cond cond, Imm24 imm24) { bool ArmTranslatorVisitor::arm_SVC(Cond cond, Imm24 imm24) {
u32 imm32 = imm24; u32 imm32 = imm24;