thumb32_load_store_dual: imm8 in STREX should be shifted left by 2

This commit is contained in:
MerryMage 2021-04-19 18:57:28 +01:00
parent b2a4da5e65
commit 9c6332fcbd

View file

@ -143,7 +143,7 @@ bool ThumbTranslatorVisitor::thumb32_STREX(Reg n, Reg t, Reg d, Imm<8> imm8) {
return UnpredictableInstruction(); 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 value = ir.GetRegister(t);
const auto passed = ir.ExclusiveWriteMemory32(address, value); const auto passed = ir.ExclusiveWriteMemory32(address, value);
ir.SetRegister(d, passed); ir.SetRegister(d, passed);