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_66.c2
-rw-r--r--src/dynarec/rv64/dynarec_rv64_emit_tests.c6
-rw-r--r--src/dynarec/rv64/dynarec_rv64_helper.h4
3 files changed, 9 insertions, 3 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_66.c b/src/dynarec/rv64/dynarec_rv64_66.c
index 1caf2a74..c59325e2 100644
--- a/src/dynarec/rv64/dynarec_rv64_66.c
+++ b/src/dynarec/rv64/dynarec_rv64_66.c
@@ -326,7 +326,7 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
                     GETEW(x1, (opcode==0x81)?2:1);
                     if(opcode==0x81) i16 = F16S; else i16 = F8S;
                     if(i16) {
-                        MOV64xw(x2, i16);
+                        MOV64x(x2, i16);
                         emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6);
                     } else
                         emit_cmp16_0(dyn, ninst, x1, x3, x4);
diff --git a/src/dynarec/rv64/dynarec_rv64_emit_tests.c b/src/dynarec/rv64/dynarec_rv64_emit_tests.c
index 16a580da..e60ff103 100644
--- a/src/dynarec/rv64/dynarec_rv64_emit_tests.c
+++ b/src/dynarec/rv64/dynarec_rv64_emit_tests.c
@@ -107,8 +107,10 @@ void emit_cmp16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4,
 
     // It's a cmp, we can't store the result back to s1.
     SUB(s6, s1, s2);
-    SLLI(s6, s6, 48);
-    SRLI(s6, s6, 48);
+    IFX(X_ALL) {
+        SLLI(s6, s6, 48);
+        SRLI(s6, s6, 48);
+    }
     IFX_PENDOR0 {
         SH(s6, xEmu, offsetof(x64emu_t, res));
     }
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.h b/src/dynarec/rv64/dynarec_rv64_helper.h
index 223fc5a3..4d6a1044 100644
--- a/src/dynarec/rv64/dynarec_rv64_helper.h
+++ b/src/dynarec/rv64/dynarec_rv64_helper.h
@@ -451,7 +451,11 @@
             /* cf = bc & (1<<(width-1)) */                                \
             if ((width) == 8) {                                           \
                 ANDI(scratch1, scratch2, 0x80);                           \
+            } else if ((width) == 16) {                                   \
+                SLLI(scratch2, scratch2, 48);                             \
+                SRLI(scratch1, scratch2, 63);                             \
             } else {                                                      \
+                if ((width) == 32) { ZEROUP(scratch2); }                  \
                 SRLI(scratch1, scratch2, (width)-1);                      \
                 if(width!=64) ANDI(scratch1, scratch1, 1);                \
             }                                                             \