about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-11-16 10:02:59 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-11-16 10:02:59 +0100
commit6f7cb088b034d9eda95a603d170b96d8bf3050c4 (patch)
treed055ff7e85c762017ec25ef1fe25ca38e28b7f8d
parent8901d1c37da07f274c9525dcdb00971b323588aa (diff)
downloadbox64-6f7cb088b034d9eda95a603d170b96d8bf3050c4.tar.gz
box64-6f7cb088b034d9eda95a603d170b96d8bf3050c4.zip
[INTERPRETER] Reworked shrd OF flag computation
-rw-r--r--src/emu/x64primop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emu/x64primop.c b/src/emu/x64primop.c
index a9e99742..6e64d7a2 100644
--- a/src/emu/x64primop.c
+++ b/src/emu/x64primop.c
@@ -1071,7 +1071,7 @@ uint16_t shrd16 (x64emu_t *emu, uint16_t d, uint16_t fill, uint8_t s)
 		}
 
 		if (cnt == 1) {
-			CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+			CONDITIONAL_SET_FLAG(((res ^ d) >> 15)&1, F_OF);
         } else {
 			CLEAR_FLAG(F_OF);
         }
@@ -1113,7 +1113,7 @@ uint32_t shrd32 (x64emu_t *emu, uint32_t d, uint32_t fill, uint8_t s)
 		res = d;
 	}
 	if (cnt == 1) {
-		CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+		CONDITIONAL_SET_FLAG(((res ^ d) >> 31)&1, F_OF);
 	} else {
 		CLEAR_FLAG(F_OF);
 	}
@@ -1139,7 +1139,7 @@ uint64_t shrd64 (x64emu_t *emu, uint64_t d, uint64_t fill, uint8_t s)
 		res = d;
 	}
 	if (cnt == 1) {
-		CONDITIONAL_SET_FLAG(XOR2(res >> 62), F_OF);
+		CONDITIONAL_SET_FLAG(((res ^ d) >> 63)&1, F_OF);
 	} else {
 		CLEAR_FLAG(F_OF);
 	}