load_store_exclusive: Define s == t state to be Constraint_NONE

Downstream (yuzu) mentioned that the instruction:

STXR W9, W9, [X0]

was executed in the program "Crash N-Sane Trilogy".
This commit is contained in:
MerryMage 2018-08-16 09:59:14 +01:00
parent cd40e4dae0
commit 8a3b6364c2

View file

@ -26,7 +26,10 @@ static bool ExclusiveSharedDecodeAndOperation(TranslatorVisitor& tv, IREmitter&
if (memop == MemOp::LOAD && pair && Rt == *Rt2) {
return tv.UnpredictableInstruction();
} else if (memop == MemOp::STORE && (*Rs == Rt || (pair && *Rs == *Rt2))) {
return tv.UnpredictableInstruction();
if (!tv.options.define_unpredictable_behaviour) {
return tv.UnpredictableInstruction();
}
// UNPREDICTABLE: The Constraint_NONE case is executed.
} else if (memop == MemOp::STORE && *Rs == Rn && Rn != Reg::R31) {
return tv.UnpredictableInstruction();
}