about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-02-13 22:12:59 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-02-13 22:12:59 +0100
commit91798194d51fe51eb236d91f9814c31511b5036a (patch)
tree342bdc496f6ee58d972831d8797923f013f3140a /src
parentd550f9384ced83b2ac9fc30c9d2b488d9844f7b8 (diff)
downloadbox64-91798194d51fe51eb236d91f9814c31511b5036a.tar.gz
box64-91798194d51fe51eb236d91f9814c31511b5036a.zip
[ARM64_DYNAREC] Fixed some issue with DF handling on mayset instructions
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/arm64/dynarec_arm64_helper.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_helper.h b/src/dynarec/arm64/dynarec_arm64_helper.h
index 5e8a2e57..0954022f 100644
--- a/src/dynarec/arm64/dynarec_arm64_helper.h
+++ b/src/dynarec/arm64/dynarec_arm64_helper.h
@@ -1085,16 +1085,18 @@
     x87_do_pop(dyn, ninst, scratch)
 #endif
 
-#define SET_DFNONE()                                     \
-    if(!dyn->insts[ninst].x64.may_set) {                 \
-        dyn->f.dfnone_here = 1;                          \
-        if (!dyn->f.dfnone) {                            \
-            STRw_U12(wZR, xEmu, offsetof(x64emu_t, df)); \
-            dyn->f.dfnone = 1;                           \
-        }                                                \
-    }
+#define SET_DFNONE()                                        \
+    do {                                                    \
+        if (!dyn->f.dfnone) {                               \
+            STRw_U12(wZR, xEmu, offsetof(x64emu_t, df));    \
+        }                                                   \
+        if(!dyn->insts[ninst].x64.may_set) {                \
+            dyn->f.dfnone_here = 1;                         \
+            dyn->f.dfnone = 1;                              \
+        }                                                   \
+    } while(0)
+
 #define SET_DF(S, N)                                                                                                            \
-    if(!dyn->insts[ninst].x64.may_set) {                                                                                        \
     if ((N) != d_none) {                                                                                                        \
         MOVZw(S, (N));                                                                                                          \
         STRw_U12(S, xEmu, offsetof(x64emu_t, df));                                                                              \
@@ -1105,8 +1107,8 @@
         }                                                                                                                       \
         dyn->f.dfnone = 0;                                                                                                      \
     } else                                                                                                                      \
-        SET_DFNONE();                                                                                                           \
-    }
+        SET_DFNONE()
+
 #ifndef SET_NODF
 #define SET_NODF()          dyn->f.dfnone = 0
 #endif
@@ -1163,7 +1165,7 @@
 #define UFLAG_OP2(A) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A, xEmu, offsetof(x64emu_t, op2));}
 #define UFLAG_OP12(A1, A2) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A1, xEmu, offsetof(x64emu_t, op1));STRxw_U12(A2, xEmu, offsetof(x64emu_t, op2));}
 #define UFLAG_RES(A) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A, xEmu, offsetof(x64emu_t, res));}
-#define UFLAG_DF(r, A) if(dyn->insts[ninst].x64.gen_flags) {SET_DF(r, A)}
+#define UFLAG_DF(r, A) if(dyn->insts[ninst].x64.gen_flags) {SET_DF(r, A);}
 #define UFLAG_IF if(dyn->insts[ninst].x64.gen_flags)
 #define UFLAG_IF2(A) if(dyn->insts[ninst].x64.gen_flags A)
 #ifndef DEFAULT