From 9c6332fcbd5ae6aca0864de97c6a8e73af2c0559 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 19 Apr 2021 18:57:28 +0100 Subject: [PATCH] thumb32_load_store_dual: imm8 in STREX should be shifted left by 2 --- src/frontend/A32/translate/impl/thumb32_load_store_dual.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/A32/translate/impl/thumb32_load_store_dual.cpp b/src/frontend/A32/translate/impl/thumb32_load_store_dual.cpp index 09918e65..1a462cb6 100644 --- a/src/frontend/A32/translate/impl/thumb32_load_store_dual.cpp +++ b/src/frontend/A32/translate/impl/thumb32_load_store_dual.cpp @@ -143,7 +143,7 @@ bool ThumbTranslatorVisitor::thumb32_STREX(Reg n, Reg t, Reg d, Imm<8> imm8) { return UnpredictableInstruction(); } - const auto address = ir.Add(ir.GetRegister(n), ir.Imm32(imm8.ZeroExtend())); + const auto address = ir.Add(ir.GetRegister(n), ir.Imm32(imm8.ZeroExtend() << 2)); const auto value = ir.GetRegister(t); const auto passed = ir.ExclusiveWriteMemory32(address, value); ir.SetRegister(d, passed);