about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorxctan <xctan@cirno.icu>2024-01-13 16:25:53 +0000
committerGitHub <noreply@github.com>2024-01-13 17:25:53 +0100
commit4c174a42f83c8374e3e57e275800d986c3079fd3 (patch)
treee60ecb74c0f4eb856843da6b05087b257d8c84a7 /src
parent71463476f6325bfebc2a497221a76b1f5b903626 (diff)
downloadbox64-4c174a42f83c8374e3e57e275800d986c3079fd3.tar.gz
box64-4c174a42f83c8374e3e57e275800d986c3079fd3.zip
[RV64_DYNAREC] Fixed 66 87 XCHG opcode (#1198)
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_66.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_66.c b/src/dynarec/rv64/dynarec_rv64_66.c
index 67c046a0..bb7b34f4 100644
--- a/src/dynarec/rv64/dynarec_rv64_66.c
+++ b/src/dynarec/rv64/dynarec_rv64_66.c
@@ -521,11 +521,13 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
                 NOT(x5, x5);
                 SLLI(x5, x5, 16);
                 SLLI(x6, x6, 16);
+                // 0xffffffff0000ffff
                 NOT(x5, x5);
-                LR_W(x1, ed, 1, 0);
+                ANDI(x4, ed, ~0b11);
+                LR_W(x1, x4, 1, 0);
                 AND(x3, x1, x5);
                 OR(x3, x3, x6);
-                SC_W(x3, x3, ed, 0, 1);
+                SC_W(x3, x3, x4, 0, 1);
                 BNEZ(x3, -4 * 4);
                 SRLI(x1, x1, 16);
                 ZEXTH(x1, x1);