mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-07 02:42:58 +00:00
A32: Detect unpredictable LDM/STM instructions
This commit is contained in:
@@ -768,6 +768,9 @@ bool ArmTranslatorVisitor::arm_LDM(Cond cond, bool W, Reg n, RegList list) {
|
||||
if (n == Reg::PC || Common::BitCount(list) < 1) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
if (W && Common::Bit(static_cast<size_t>(n), list)) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
|
||||
if (!ConditionPassed(cond)) {
|
||||
return true;
|
||||
@@ -783,6 +786,9 @@ bool ArmTranslatorVisitor::arm_LDMDA(Cond cond, bool W, Reg n, RegList list) {
|
||||
if (n == Reg::PC || Common::BitCount(list) < 1) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
if (W && Common::Bit(static_cast<size_t>(n), list)) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
|
||||
if (!ConditionPassed(cond)) {
|
||||
return true;
|
||||
@@ -798,6 +804,9 @@ bool ArmTranslatorVisitor::arm_LDMDB(Cond cond, bool W, Reg n, RegList list) {
|
||||
if (n == Reg::PC || Common::BitCount(list) < 1) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
if (W && Common::Bit(static_cast<size_t>(n), list)) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
|
||||
if (!ConditionPassed(cond)) {
|
||||
return true;
|
||||
@@ -813,6 +822,9 @@ bool ArmTranslatorVisitor::arm_LDMIB(Cond cond, bool W, Reg n, RegList list) {
|
||||
if (n == Reg::PC || Common::BitCount(list) < 1) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
if (W && Common::Bit(static_cast<size_t>(n), list)) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
|
||||
if (!ConditionPassed(cond)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user