about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/la64/dynarec_la64_00.c10
-rw-r--r--src/dynarec/la64/dynarec_la64_0f.c6
-rw-r--r--src/dynarec/rv64/dynarec_rv64_00_3.c10
-rw-r--r--src/dynarec/rv64/dynarec_rv64_0f.c18
4 files changed, 22 insertions, 22 deletions
diff --git a/src/dynarec/la64/dynarec_la64_00.c b/src/dynarec/la64/dynarec_la64_00.c
index 6b8ddf30..68295c71 100644
--- a/src/dynarec/la64/dynarec_la64_00.c
+++ b/src/dynarec/la64/dynarec_la64_00.c
@@ -2191,7 +2191,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
                     SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined
                     if (!dyn->insts[ninst].x64.gen_flags) {
                         GETED(0);
-                        SLLxw(ed, ed, xRCX);
+                        if (rex.w)
+                            SLL_D(ed, ed, xRCX);
+                        else
+                            SLL_W(ed, ed, xRCX);
                         if (dyn->insts[ninst].nat_flags_fusion) {
                             if (!rex.w) ZEROUP(ed);
                             NAT_FLAGS_OPS(ed, xZR);
@@ -2213,7 +2216,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
                     SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined
                     if (!dyn->insts[ninst].x64.gen_flags) {
                         GETED(0);
-                        SRLxw(ed, ed, xRCX);
+                        if (rex.w)
+                            SRL_D(ed, ed, xRCX);
+                        else
+                            SRL_W(ed, ed, xRCX);
                         if (dyn->insts[ninst].nat_flags_fusion) {
                             if (!rex.w) ZEROUP(ed);
                             NAT_FLAGS_OPS(ed, xZR);
diff --git a/src/dynarec/la64/dynarec_la64_0f.c b/src/dynarec/la64/dynarec_la64_0f.c
index fb6e72f8..688ba7cc 100644
--- a/src/dynarec/la64/dynarec_la64_0f.c
+++ b/src/dynarec/la64/dynarec_la64_0f.c
@@ -495,10 +495,8 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
             else                                                                                 \
                 B##NO(tmp1, 8);                                                                  \
         }                                                                                        \
-        if (rex.w)                                                                               \
-            MV(gd, ed);                                                                          \
-        else                                                                                     \
-            ZEROUP2(gd, ed);                                                                     \
+        MV(gd, ed);                                                                              \
+        if (!rex.w) ZEROUP(gd);                                                                  \
     } else {                                                                                     \
         addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp3, &fixedaddress, rex, NULL, 1, 0); \
         if (dyn->insts[ninst].nat_flags_fusion) {                                                \
diff --git a/src/dynarec/rv64/dynarec_rv64_00_3.c b/src/dynarec/rv64/dynarec_rv64_00_3.c
index c4ba2e1d..81c240e4 100644
--- a/src/dynarec/rv64/dynarec_rv64_00_3.c
+++ b/src/dynarec/rv64/dynarec_rv64_00_3.c
@@ -796,7 +796,10 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int
                     SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined
                     if (!dyn->insts[ninst].x64.gen_flags) {
                         GETED(0);
-                        SLLxw(ed, ed, xRCX);
+                        if (rex.w)
+                            SLL(ed, ed, xRCX);
+                        else
+                            SLLW(ed, ed, xRCX);
                         if (dyn->insts[ninst].nat_flags_fusion) {
                             if (!rex.w) ZEROUP(ed);
                             NAT_FLAGS_OPS(ed, xZR);
@@ -818,7 +821,10 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int
                     SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined
                     if (!dyn->insts[ninst].x64.gen_flags) {
                         GETED(0);
-                        SRLxw(ed, ed, xRCX);
+                        if (rex.w)
+                            SRL(ed, ed, xRCX);
+                        else
+                            SRLW(ed, ed, xRCX);
                         if (dyn->insts[ninst].nat_flags_fusion) {
                             if (!rex.w) ZEROUP(ed);
                             NAT_FLAGS_OPS(ed, xZR);
diff --git a/src/dynarec/rv64/dynarec_rv64_0f.c b/src/dynarec/rv64/dynarec_rv64_0f.c
index 08ad5e7a..b4139ecf 100644
--- a/src/dynarec/rv64/dynarec_rv64_0f.c
+++ b/src/dynarec/rv64/dynarec_rv64_0f.c
@@ -939,22 +939,12 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
     if (MODREG) {                                                                                \
         ed = TO_NAT((nextop & 7) + (rex.b << 3));                                                \
         if (dyn->insts[ninst].nat_flags_fusion) {                                                \
-            NATIVEJUMP(NATNO, (rex.w || rv64_xtheadbb || rv64_zba) ? 8 : 12);                    \
+            NATIVEJUMP(NATNO, 8);                                                                \
         } else {                                                                                 \
-            B##NO(tmp1, (rex.w || rv64_xtheadbb || rv64_zba) ? 8 : 12);                          \
-        }                                                                                        \
-        if (rex.w)                                                                               \
-            MV(gd, ed);                                                                          \
-        else {                                                                                   \
-            if (rv64_zba) {                                                                      \
-                ZEXTW(gd, ed);                                                                   \
-            } else if (rv64_xtheadbb) {                                                          \
-                TH_EXTU(gd, ed, 31, 0);                                                          \
-            } else {                                                                             \
-                SLLI(gd, ed, 32);                                                                \
-                SRLI(gd, gd, 32);                                                                \
-            }                                                                                    \
+            B##NO(tmp1, 8);                                                                      \
         }                                                                                        \
+        MV(gd, ed);                                                                              \
+        if (!rex.w) ZEROUP(gd);                                                                  \
     } else {                                                                                     \
         addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp3, &fixedaddress, rex, NULL, 1, 0); \
         if (dyn->insts[ninst].nat_flags_fusion) {                                                \