about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2024-06-19 00:35:35 +0800
committerGitHub <noreply@github.com>2024-06-18 18:35:35 +0200
commit7273ac0d34d226066d457ec6a15ba4a9935c5680 (patch)
treeb7b32461d42b1fa608c09a2d73b6f6979680d664 /src
parentceb9834a275dce6359d885ff222a94a565d7bc46 (diff)
downloadbox64-7273ac0d34d226066d457ec6a15ba4a9935c5680.tar.gz
box64-7273ac0d34d226066d457ec6a15ba4a9935c5680.zip
[RV64_DYNAREC] Fixed potential issue of jump_to_next (#1600)
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_helper.c4
-rw-r--r--src/dynarec/rv64/rv64_emitter.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.c b/src/dynarec/rv64/dynarec_rv64_helper.c
index e64ccc48..cefdab81 100644
--- a/src/dynarec/rv64/dynarec_rv64_helper.c
+++ b/src/dynarec/rv64/dynarec_rv64_helper.c
@@ -507,9 +507,7 @@ void jump_to_next(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst, int is3
         if(JMPTABLE_MASK0<2048) {
             ANDI(x2, xRIP, JMPTABLE_MASK0);
         } else {
-            if(JMPTABLE_MASK1!=JMPTABLE_MASK0) {
-                MOV64x(x4, JMPTABLE_MASK0);    // x4 = mask
-            }
+            MOV64x(x4, JMPTABLE_MASK0); // x4 = mask
             AND(x2, xRIP, x4);
         }
         if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);}
diff --git a/src/dynarec/rv64/rv64_emitter.h b/src/dynarec/rv64/rv64_emitter.h
index fecfef4d..661dffca 100644
--- a/src/dynarec/rv64/rv64_emitter.h
+++ b/src/dynarec/rv64/rv64_emitter.h
@@ -181,6 +181,8 @@ f28–31  ft8–11  FP temporaries                  Caller
 // nop
 #define NOP() ADDI(xZR, xZR, 0)
 
+#define UDF() EMIT(0xc0001073)
+
 // rd = rs1 + rs2
 #define ADD(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b000, rd, 0b0110011))
 // rd = rs1 + rs2