about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2025-05-23 23:54:36 +0800
committerGitHub <noreply@github.com>2025-05-23 17:54:36 +0200
commit1e2bae923734c61c16f7e2ca6e8dbc193a7a6ce2 (patch)
treedb8ef94df29768ec26ac5cf1e30f71f30146d1de /src
parentb7ddb92c80b45d5945a3339f8f7a36ee787e0901 (diff)
downloadbox64-1e2bae923734c61c16f7e2ca6e8dbc193a7a6ce2.tar.gz
box64-1e2bae923734c61c16f7e2ca6e8dbc193a7a6ce2.zip
[RV64_DYNAREC] Improved emit_pf with Zbb (#2665)
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_helper.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.c b/src/dynarec/rv64/dynarec_rv64_helper.c
index ce95d9e4..8de757df 100644
--- a/src/dynarec/rv64/dynarec_rv64_helper.c
+++ b/src/dynarec/rv64/dynarec_rv64_helper.c
@@ -2904,15 +2904,19 @@ void emit_pf(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4)
 {
     MAYUSE(dyn);
     MAYUSE(ninst);
+    if (rv64_zbb) {
+        ANDI(s3, s1, 0xFF);
+        CPOPW(s3, s3);
+    } else {
+        SRLI(s3, s1, 4);
+        XOR(s3, s3, s1);
 
-    SRLI(s3, s1, 4);
-    XOR(s3, s3, s1);
-
-    SRLI(s4, s3, 2);
-    XOR(s4, s3, s4);
+        SRLI(s4, s3, 2);
+        XOR(s4, s3, s4);
 
-    SRLI(s3, s4, 1);
-    XOR(s3, s3, s4);
+        SRLI(s3, s4, 1);
+        XOR(s3, s3, s4);
+    }
 
     ANDI(s3, s3, 1);
     XORI(s3, s3, 1);