From 490a4ab31cab8c8c7c74692f5cf109770751f684 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 17 May 2021 16:01:59 +0200 Subject: [PATCH] [DYNAREC] Fix unaligned LOCK INC/DEC opcodes --- src/dynarec/dynarec_arm_f0.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dynarec/dynarec_arm_f0.c b/src/dynarec/dynarec_arm_f0.c index 338dd20db8..bb204479d4 100755 --- a/src/dynarec/dynarec_arm_f0.c +++ b/src/dynarec/dynarec_arm_f0.c @@ -901,7 +901,8 @@ uintptr_t dynarecF0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, B_NEXT(c__); MARK; LDR_IMM9(x1, wback, 0); - LDREXB(x1, wback); + LDREXB(x3, wback); + BFI(x1, x3, 0, 8); emit_inc32(dyn, ninst, x1, x3, x14); STREXB(x3, x1, wback); CMPS_IMM8(x3, 0); @@ -928,7 +929,8 @@ uintptr_t dynarecF0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, B_NEXT(c__); MARK; LDR_IMM9(x1, wback, 0); - LDREXB(x1, wback); + LDREXB(x3, wback); + BFI(x1, x3, 0, 8); emit_dec32(dyn, ninst, x1, x3, x14); STREXB(x3, x1, wback); CMPS_IMM8(x3, 0);