about summary refs log tree commit diff stats
path: root/src/dynarec
diff options
context:
space:
mode:
authorYang Liu <numbksco@gmail.com>2024-06-01 23:14:23 +0800
committerGitHub <noreply@github.com>2024-06-01 17:14:23 +0200
commit9dbd7fc7e0615f48c9287305610bf9aed1cc24f3 (patch)
tree0a9cd649a22b32cf99a59810f77cba6c557f4075 /src/dynarec
parenta79eff3b0da5056e2226b7830aa5089e68c91451 (diff)
downloadbox64-9dbd7fc7e0615f48c9287305610bf9aed1cc24f3.tar.gz
box64-9dbd7fc7e0615f48c9287305610bf9aed1cc24f3.zip
[INTERP] Rework on the 16b emulation for LA64 (#1547)
* [INTERP] Rework on the 16b emulation for LA64

* fix compiler issue
Diffstat (limited to 'src/dynarec')
-rw-r--r--src/dynarec/la64/la64_lock.S3
-rw-r--r--src/dynarec/native_lock.h9
-rw-r--r--src/dynarec/rv64/rv64_lock.S11
3 files changed, 3 insertions, 20 deletions
diff --git a/src/dynarec/la64/la64_lock.S b/src/dynarec/la64/la64_lock.S
index 48f21595..18736afd 100644
--- a/src/dynarec/la64/la64_lock.S
+++ b/src/dynarec/la64/la64_lock.S
@@ -191,9 +191,8 @@ la64_lock_cas_dd:
 la64_lock_cas_dq:
     ll.d $a4, $a0, 0
     bne  $a4, $a2, 1f
-    sc.d $a1, $a0, 0
+    .word 0x38571c85 // sc.q $a1, $a3, $a0
     beqz $a1, 1f
-    st.d $a3, $a0, 8
     xori $a0, $a1, 1
     ret
 1:
diff --git a/src/dynarec/native_lock.h b/src/dynarec/native_lock.h
index 33626a63..1ed26e8f 100644
--- a/src/dynarec/native_lock.h
+++ b/src/dynarec/native_lock.h
@@ -66,13 +66,8 @@
 #define native_lock_write_d(A, B)           rv64_lock_cas_d(A, tmpcas, B)

 #define native_lock_read_dd(A)              tmpcas=*(uint64_t*)(A)

 #define native_lock_write_dd(A, B)          rv64_lock_cas_dd(A, tmpcas, B)

-// there is no atomic move on 16bytes, so faking it

-#define native_lock_read_dq(A, B, C)       \

-    do {                                   \

-        *A = tmpcas = ((uint64_t*)(C))[0]; \

-        *B = ((uint64_t*)(C))[1];          \

-    } while (0)

-#define native_lock_write_dq(A, B, C)       rv64_lock_cas_dq(C, A, tmpcas, B);

+#define native_lock_read_dq(A, B, C)        // never used

+#define native_lock_write_dq(A, B, C)       // never used

 #define native_lock_get_b(A)                rv64_lock_get_b(A)

 #define native_lock_get_d(A)                rv64_lock_get_d(A)

 #define native_lock_get_dd(A)               rv64_lock_get_dd(A)

diff --git a/src/dynarec/rv64/rv64_lock.S b/src/dynarec/rv64/rv64_lock.S
index 2b48163b..a525c999 100644
--- a/src/dynarec/rv64/rv64_lock.S
+++ b/src/dynarec/rv64/rv64_lock.S
@@ -229,17 +229,6 @@ rv64_lock_cas_dd:
     li a0, 1
     ret
 
-rv64_lock_cas_dq:
-    mv a4, a0
-    lr.d t0, (a0)
-    bne t0, a1, 1f
-    sc.d a0, a2, (a0)
-    sd a3,(a4)
-    ret
-1:
-    li a0, 1
-    ret
-
 rv64_lock_get_b:
     fence   rw, rw
     lb      a0, 0(a0)