about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64runavx0f38.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/emu/x64runavx0f38.c b/src/emu/x64runavx0f38.c
index 3ff1ba49..8c943c6b 100644
--- a/src/emu/x64runavx0f38.c
+++ b/src/emu/x64runavx0f38.c
@@ -94,7 +94,11 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step)
                     CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]>>63):(VD->dword[0]>>31), F_SF);
                     CLEAR_FLAG(F_OF);
                     CLEAR_FLAG(F_AF);   // Undef
-                    CLEAR_FLAG(F_PF);   // Undef
+                    if(BOX64ENV(cputype)) {
+                        CLEAR_FLAG(F_PF);   // Undef
+                    } else {
+                        SET_FLAG(F_PF);   // Undef
+                    }
                     break;
                 case 2:     /* BLSMSK Vd, Ed */
                     if(vex.l) EmitSignal(emu, SIGILL, (void*)R_RIP, 0);
@@ -109,8 +113,13 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step)
                     CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]>>63):(VD->dword[0]>>31), F_SF);
                     CLEAR_FLAG(F_ZF);
                     CLEAR_FLAG(F_OF);
-                    CLEAR_FLAG(F_AF);   // Undef
-                    CLEAR_FLAG(F_PF);   // Undef
+                    // Undef flags
+                    CLEAR_FLAG(F_AF);
+                    if(BOX64ENV(cputype)) {
+                        CLEAR_FLAG(F_PF);
+                    } else {
+                        CONDITIONAL_SET_FLAG(PARITY(VD->byte[0] & 0xff), F_PF);
+                    }
                     break;
                 case 3:     /* BLSI Vd, Ed */
                     if(vex.l) EmitSignal(emu, SIGILL, (void*)R_RIP, 0);
@@ -128,7 +137,12 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step)
                     CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]>>63):(VD->dword[0]>>31), F_SF);
                     CLEAR_FLAG(F_OF);
                     CLEAR_FLAG(F_AF);   // Undef
-                    CLEAR_FLAG(F_PF);   // Undef
+                    if(BOX64ENV(cputype)) {
+                        CLEAR_FLAG(F_PF);   // Undef
+                    } else {
+                        SET_FLAG(F_PF);   // Undef
+                    }
+
                     break;
                 default:
                     return 0;