about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-11-16 11:00:09 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-11-16 11:00:09 +0100
commit19a24c2171cd943e7b1398c5636c666e07efe6d4 (patch)
treefb5f66a9a0f2a00b64e24dfa401f44dfda4d6935 /src/emu
parentf7d75ca641ec6de4a35421fe206f8608ee531a20 (diff)
downloadbox64-19a24c2171cd943e7b1398c5636c666e07efe6d4.tar.gz
box64-19a24c2171cd943e7b1398c5636c666e07efe6d4.zip
[ARM64_DYNAREC] Optimized 66 AC opcode
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/x64run_private.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/emu/x64run_private.c b/src/emu/x64run_private.c
index f50c32cc..a5a588c2 100644
--- a/src/emu/x64run_private.c
+++ b/src/emu/x64run_private.c
@@ -692,6 +692,19 @@ void UpdateFlags(x64emu_t *emu)
                 }
             }
             break;
+        case d_shrd16:
+            cnt = emu->op2.u16;
+            if (cnt > 0) {
+                cc = emu->op1.u16 & (1 << (cnt - 1));
+                CONDITIONAL_SET_FLAG(cc, F_CF);
+                CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF);
+                CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF);
+                CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF);
+                if (cnt == 1) {
+                    CONDITIONAL_SET_FLAG((emu->op1.u16 ^ emu->res.u16) & 0x8000, F_OF);
+                }
+            }
+            break;
         case d_shrd32:
             cnt = emu->op2.u32;
             if (cnt > 0) {
@@ -1001,7 +1014,6 @@ void UpdateFlags(x64emu_t *emu)
         case d_rcr16:
         case d_rcr32:
         case d_rcr64:
-        case d_shrd16:
         case d_unknown:
             printf_log(LOG_NONE, "Box64: %p trying to evaluate Unknown deferred Flags\n", (void*)R_RIP);
             break;