about summary refs log tree commit diff stats
path: root/src/dynarec/rv64
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-11-03 20:01:56 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-11-03 20:01:56 +0100
commit08085be36070ba22b9e2e99529826d60d5ba149f (patch)
tree500d1b706b6c84b19e42e6eb5d57cbbc66368e02 /src/dynarec/rv64
parent3809866d99b8f8ac8efa3a41d5410906029229b8 (diff)
downloadbox64-08085be36070ba22b9e2e99529826d60d5ba149f.tar.gz
box64-08085be36070ba22b9e2e99529826d60d5ba149f.zip
[DYNAREC] Reverted last 2 commit, will use CancelFillblock mecanism instead
Diffstat (limited to 'src/dynarec/rv64')
-rw-r--r--src/dynarec/rv64/rv64_next.S69
1 files changed, 19 insertions, 50 deletions
diff --git a/src/dynarec/rv64/rv64_next.S b/src/dynarec/rv64/rv64_next.S
index bb6f3901..ce34bb7f 100644
--- a/src/dynarec/rv64/rv64_next.S
+++ b/src/dynarec/rv64/rv64_next.S
@@ -14,36 +14,20 @@
 rv64_next:
     // emu is a0
     // IP address is a1
-    addi    sp,  sp,  -(8 * 2)
+    addi    sp,  sp,  -(8 * 10)
     sd      a0, (sp)
     sd      a1, 8(sp)
-    sd      x16, (a0)
-    sd      x17, 8(a0)
-    sd      x18, 16(a0)
-    sd      x19, 24(a0)
-    sd      x20, 32(a0)
-    sd      x21, 40(a0)
-    sd      x22, 48(a0)
-    sd      x23, 56(a0)
-    sd      x24, 64(a0)
-    sd      x25, 72(a0)
-    sd      x26, 80(a0)
-    sd      x27, 88(a0)
-    sd      x28, 96(a0)
-    sd      x29, 104(a0)
-    sd      x30, 112(a0)
-    sd      x31, 120(a0)
-    // adjust flags bit 5 -> bit 11
-    li      x5, ~(1<<11)
-    and     x8, x8, x5
-    andi    x5, x8, 1<<5
-    slli    x5, x5, 11-5
-    or      x8, x8, x5
-    sd      x8, 128(a0)     //xFlags
-    sd      x7, 136(a0)     // put back reg value in emu, including EIP (so x7 must be EIP now)
+    sd      x5, 16(sp)
+    sd      x7, 24(sp)
+    sd      x16, 32(sp)
+    sd      x17, 40(sp)
+    sd      x28, 48(sp)
+    sd      x29, 56(sp)
+    sd      x30, 64(sp)
+    sd      x31, 72(sp)
 
     mv      a2, ra      // "from" is in ra, so put in a2
-
+    addi    a3, sp, 24   // a3 is address to change rip
     // call the function
 1:
     auipc   a4, %pcrel_hi(LinkNext)
@@ -53,30 +37,15 @@ rv64_next:
     // pop regs
     ld      a0, (sp)
     ld      a1, 8(sp)
-    ld      x16, (a0)
-    ld      x17, 8(a0)
-    ld      x18, 16(a0)
-    ld      x19, 24(a0)
-    ld      x20, 32(a0)
-    ld      x21, 40(a0)
-    ld      x22, 48(a0)
-    ld      x23, 56(a0)
-    ld      x24, 64(a0)
-    ld      x25, 72(a0)
-    ld      x26, 80(a0)
-    ld      x27, 88(a0)
-    ld      x28, 96(a0)
-    ld      x29, 104(a0)
-    ld      x30, 112(a0)
-    ld      x31, 120(a0)
-    ld      x8, 128(a0)     //xFlags
-    ld      x7, 136(a0)     // xRIP
-    // // adjust flags bit 11 -> bit 5
-    andi    x8, x8, ~(1<<5)    // probably not usefull?
-    srli    x5, x8, 11-5
-    andi    x5, x5, 1<<5
-    or      x8, x8, x5
-    addi    sp,  sp,  (8 * 2)
+    ld      x5, 16(sp)
+    ld      x7, 24(sp)
+    ld      x16, 32(sp)
+    ld      x17, 40(sp)
+    ld      x28, 48(sp)
+    ld      x29, 56(sp)
+    ld      x30, 64(sp)
+    ld      x31, 72(sp)
+    addi    sp,  sp,  (8 * 10)
     // return offset is jump address
     jr      a3