about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-07-09 21:06:36 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-07-09 21:06:36 +0200
commit7ae9dca5622065b96852cf7080cd619d7ce410ad (patch)
treeb5a8b012995bb0f8ee955772aa0e56333acecef5
parent005e3ddf7d6b1d427dcd0d73e12d0ba109986ea7 (diff)
downloadbox64-7ae9dca5622065b96852cf7080cd619d7ce410ad.tar.gz
box64-7ae9dca5622065b96852cf7080cd619d7ce410ad.zip
[DYNAREC] Fixed emiter for shr32c, sar32c and shrd32c (for #44)
-rwxr-xr-xsrc/dynarec/dynarec_arm64_emit_shift.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dynarec/dynarec_arm64_emit_shift.c b/src/dynarec/dynarec_arm64_emit_shift.c
index c89546e1..0380650d 100755
--- a/src/dynarec/dynarec_arm64_emit_shift.c
+++ b/src/dynarec/dynarec_arm64_emit_shift.c
@@ -206,7 +206,9 @@ void emit_shr32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int32_t c, in
         return;
     }
     IFX(X_CF) {
-        LSRxw_REG(s3, s1, c-1);
+        if(c>1) {
+            LSRxw(s3, s1, c-1);
+        }
         BFIw(xFlags, s3, 0, 1);
     }
     LSRxw(s1, s1, c);
@@ -252,7 +254,9 @@ void emit_sar32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int32_t c, in
         return;
     }
     IFX(X_CF) {
-        ASRxw(s3, s1, c-1);
+        if(c>1) {
+            ASRxw(s3, s1, c-1);
+        }
         BFIw(xFlags, s3, 0, 1);
     }
     ASRxw(s1, s1, c);
@@ -359,7 +363,9 @@ void emit_shrd32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int3
         return;
     }
     IFX(X_CF) {
-        LSRxw_REG(s3, s1, c-1);
+        if(c>1) {
+            LSRxw(s3, s1, c-1);
+        }
         BFIw(xFlags, s3, 0, 1);
     }
     LSRxw(s1, s1, c);