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