about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-01-20 19:41:43 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-01-20 19:41:43 +0100
commitb78d81d319c3452aee782d988a7291563b3bdc28 (patch)
tree32fdcc4c3aefe44bad98c8ed16e9ba25796e52b6 /src
parent9f3be89e12e52e0e44f1376a773fa6a555179006 (diff)
downloadbox64-b78d81d319c3452aee782d988a7291563b3bdc28.tar.gz
box64-b78d81d319c3452aee782d988a7291563b3bdc28.zip
[ARM64_DYNAREC] Removed many use of TABLE64 that would just slowdown build of the dynablock for not much memory saved
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/arm64/dynarec_arm64_00.c23
-rw-r--r--src/dynarec/arm64/dynarec_arm64_helper.c4
-rw-r--r--src/dynarec/arm64/dynarec_arm64_helper.h14
3 files changed, 12 insertions, 29 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c
index cdf81053..5ab33ffe 100644
--- a/src/dynarec/arm64/dynarec_arm64_00.c
+++ b/src/dynarec/arm64/dynarec_arm64_00.c
@@ -2507,12 +2507,12 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
                     } else {
                         GETIP(ip+1); // read the 0xCC
                         STORE_XEMU_CALL(xRIP);
+                        ADDx_U12(x3, xRIP, 8+8);    // expected return address
                         ADDx_U12(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip
-                        CALL_S(x64Int3, -1);
+                        CALL_(x64Int3, -1, x3);
                         SMWRITE2();
                         LOAD_XEMU_CALL(xRIP);
                         addr+=8+8;
-                        TABLE64(x3, addr); // expected return address
                         CMPSx_REG(xRIP, x3);
                         B_MARK(cNE);
                         LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit));
@@ -3217,7 +3217,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
                         CALL_S(x64Int3, -1);
                         SMWRITE2();
                         LOAD_XEMU_CALL(xRIP);
-                        TABLE64(x3, dyn->insts[ninst].natcall);
+                        MOV64x(x3, dyn->insts[ninst].natcall);
                         ADDx_U12(x3, x3, 2+8+8);
                         CMPSx_REG(xRIP, x3);
                         B_MARK(cNE);    // Not the expected address, exit dynarec block
@@ -3225,9 +3225,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
                         if(dyn->insts[ninst].retn) {
                             ADDx_U12(xRSP, xRSP, dyn->insts[ninst].retn);
                         }
-                        TABLE64(x3, addr);
-                        CMPSx_REG(xRIP, x3);
-                        B_MARK(cNE);    // Not the expected address again
                         LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit));
                         CBZw_NEXT(w1);  // not quitting, so lets continue
                         MARK;
@@ -3238,11 +3235,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
                     break;
                 case 1:
                     // this is call to next step, so just push the return address to the stack
-                    if(rex.is32bits) {
-                        MOV32w(x2, addr);
-                    } else {
-                        TABLE64(x2, addr);
-                    }
+                    MOV64x(x2, addr);
                     PUSH1z(x2);
                     break;
                 default:
@@ -3252,11 +3245,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
                         SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags to "dont'care" state
                     }
                     // regular call
-                    if(rex.is32bits) {
-                        MOV32w(x2, addr);
-                    } else {
-                        TABLE64(x2, addr);
-                    }
+                    MOV64x(x2, addr);
                     fpu_purgecache(dyn, ninst, 1, x1, x3, x4);
                     PUSH1z(x2);
                     if(box64_dynarec_callret) {
@@ -3286,7 +3275,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
                         // jumps out of current dynablock...
                         MARK;
                         j64 = getJumpTableAddress64(addr);
-                        TABLE64(x4, j64);
+                        MOV64x(x4, j64);
                         LDRx_U12(x4, x4, 0);
                         BR(x4);
                     }
diff --git a/src/dynarec/arm64/dynarec_arm64_helper.c b/src/dynarec/arm64/dynarec_arm64_helper.c
index d48cad33..7f0594f3 100644
--- a/src/dynarec/arm64/dynarec_arm64_helper.c
+++ b/src/dynarec/arm64/dynarec_arm64_helper.c
@@ -867,10 +867,10 @@ void grab_segdata(dynarec_arm_t* dyn, uintptr_t addr, int ninst, int reg, int se
     int t2 = x4;
     if(reg==t2) ++t2;
     LDRw_U12(t2, xEmu, offsetof(x64emu_t, segs_serial[segment]));
-    if(segment==_GS) {
+    /*if(segment==_GS) {
         LDRx_U12(reg, xEmu, offsetof(x64emu_t, segs_offs[segment]));
         CBNZw_MARKSEG(t2);   // fast check
-    } else {
+    } else*/ {
         LDRx_U12(reg, xEmu, offsetof(x64emu_t, context));
         LDRw_U12(reg, reg, offsetof(box64context_t, sel_serial));
         SUBw_REG(t2, reg, t2);
diff --git a/src/dynarec/arm64/dynarec_arm64_helper.h b/src/dynarec/arm64/dynarec_arm64_helper.h
index 5c5d7ec7..7ce075be 100644
--- a/src/dynarec/arm64/dynarec_arm64_helper.h
+++ b/src/dynarec/arm64/dynarec_arm64_helper.h
@@ -1180,8 +1180,8 @@
 #define ARCH_RESET()
 
 #if STEP < 2
-#define GETIP(A) TABLE64(0, 0)
-#define GETIP_(A) TABLE64(0, 0)
+#define GETIP(A) MOV64x(xRIP, A)
+#define GETIP_(A) MOV64x(xRIP, A)
 #else
 // put value in the Table64 even if not using it for now to avoid difference between Step2 and Step3. Needs to be optimized later...
 #define GETIP(A)                                        \
@@ -1193,20 +1193,14 @@
         }                                               \
     } else {                                            \
         dyn->last_ip = (A);                             \
-        if(dyn->last_ip<0xffffffff) {                   \
-            MOV64x(xRIP, dyn->last_ip);                 \
-        } else                                          \
-            TABLE64(xRIP, dyn->last_ip);                \
+        MOV64x(xRIP, dyn->last_ip);                     \
     }
 #define GETIP_(A)                                       \
     if(dyn->last_ip && ((A)-dyn->last_ip)<0x1000) {     \
         uint64_t _delta_ip = (A)-dyn->last_ip;          \
         if(_delta_ip) {ADDx_U12(xRIP, xRIP, _delta_ip);}\
     } else {                                            \
-        if((A)<0xffffffff) {                            \
-            MOV64x(xRIP, (A));                          \
-        } else                                          \
-            TABLE64(xRIP, (A));                         \
+        MOV64x(xRIP, (A));                              \
     }
 #endif
 #define CLEARIP()   dyn->last_ip=0