From 8a3b6364c2ce440bf87bc49e3b0e834fccfb3b13 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 16 Aug 2018 09:59:14 +0100 Subject: [PATCH] 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". --- src/frontend/A64/translate/impl/load_store_exclusive.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/A64/translate/impl/load_store_exclusive.cpp b/src/frontend/A64/translate/impl/load_store_exclusive.cpp index bab0fb37..553a2e44 100644 --- a/src/frontend/A64/translate/impl/load_store_exclusive.cpp +++ b/src/frontend/A64/translate/impl/load_store_exclusive.cpp @@ -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(); }