]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix JIT V-flag handling, V was always cleared. (addx, subx, negx, any instruction...
authorToni Wilen <twilen@winuae.net>
Mon, 21 May 2018 19:11:43 +0000 (22:11 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 21 May 2018 19:11:43 +0000 (22:11 +0300)
jit/codegen_x86.cpp
jit/gencomp.cpp

index 5784b25b2b4229a54d0ad2bb6761bf788957bd2e..fe8d12e9fe99378642daed84a23253b93d2e9659 100644 (file)
@@ -3389,10 +3389,12 @@ static __inline__ void raw_flags_set_zero_FLAGREG(int s, int tmp)
 {
        raw_mov_l_rr(tmp,s);
        raw_lahf(s); /* flags into ah */
+       SETOr(X86_AL); /* V flag into al */
        raw_and_l_ri(s,0xffffbfff);
        raw_and_l_ri(tmp,0x00004000);
        raw_xor_l_ri(tmp,0x00004000);
        raw_or_l(s,tmp);
+       raw_cmp_b_ri(X86_AL,-127); /* set V */
        raw_sahf(s);
 }
 
index ce78d68d85a30ca0230c8b515f4a1c19a1102fee..8d168cb185dd8b59a8a67be05eda3a4661ed4678 100644 (file)
@@ -1282,13 +1282,13 @@ genflags (flagtypes type, wordsizes size, const char *value, const char *src, co
                break;
            }
            comprintf("\tlive_flags();\n");
-           comprintf("\tif (needed_flags&FLAG_Z) {\n"
-                     "\tcmov_l_rr(zero,one,%d);\n"
-                     "\tset_zero(zero, one);\n" /* No longer need one */
-                     "\tlive_flags();\n"
-                     "\t}\n",NATIVE_CC_NE);
+           comprintf("\tif (needed_flags&FLAG_Z) {\n");
+           comprintf("\tcmov_l_rr(zero,one,%d);\n", NATIVE_CC_NE);
+           comprintf("\tset_zero(zero, one);\n"); /* No longer need one */
+           comprintf("\tlive_flags();\n");
+           comprintf("\t}\n");
            comprintf("\tend_needflags();\n");
-           duplicate_carry();
+               duplicate_carry();
            comprintf("if (!(needed_flags & FLAG_CZNV)) dont_care_flags();\n");
            return;
        }