about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_0f.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_0f.c b/src/dynarec/rv64/dynarec_rv64_0f.c
index 90cddbba..4159068f 100644
--- a/src/dynarec/rv64/dynarec_rv64_0f.c
+++ b/src/dynarec/rv64/dynarec_rv64_0f.c
@@ -1000,6 +1000,10 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
             GETGM();
             if (MODREG) {
                 ed = xRAX + (nextop & 7) + (rex.b << 3);
+                if (!rex.w) {
+                    AND(x4, ed, xMASK);
+                    ed = x4;
+                }
             } else {
                 addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0);
                 LDxw(x4, ed, fixedaddress);
@@ -1021,8 +1025,8 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
             GETGM();
             GETEM(x2, 1);
             u8 = F8;
-            LHU(x3, gback, gdoffset + ((u8 >> (0 * 2)) & 3) * 2);
-            LHU(x4, gback, gdoffset + ((u8 >> (1 * 2)) & 3) * 2);
+            LHU(x3, wback, fixedaddress + ((u8 >> (0 * 2)) & 3) * 2);
+            LHU(x4, wback, fixedaddress + ((u8 >> (1 * 2)) & 3) * 2);
             LHU(x5, wback, fixedaddress + ((u8 >> (2 * 2)) & 3) * 2);
             LHU(x6, wback, fixedaddress + ((u8 >> (3 * 2)) & 3) * 2);
             SH(x3, gback, gdoffset + 0 * 2);