Browse Source

* fixed tcg8086.g_flags2reg, so it behaves the same way as tcgx86.g_flags2reg
after r27581 in regard to floating point comparisons. The tcmpnan.pp test now
almost works (i.e. fails due to only one error, instead of many).

git-svn-id: trunk@27605 -

nickysn 11 years ago
parent
commit
bf6ad0ff78
1 changed files with 19 additions and 0 deletions
  1. 19 0
      compiler/i8086/cgcpu.pas

+ 19 - 0
compiler/i8086/cgcpu.pas

@@ -1681,6 +1681,25 @@ unit cgcpu;
         end;
 
         current_asmdata.getjumplabel(hl_skip);
+        { we can't just forward invf to a_jmp_flags for FA,FAE,FB and FBE, because
+          in the case of NaNs:
+           not(F_FA )<>F_FBE
+           not(F_FAE)<>F_FB
+           not(F_FB )<>F_FAE
+           not(F_FBE)<>F_FA
+        }
+        case f of
+          F_FA,F_FAE:
+            invf:=FPUFlags2Flags[invf];
+          F_FB,F_FBE:
+            begin
+              ai:=Taicpu.op_sym(A_Jcc,S_NO,hl_skip);
+              ai.SetCondition(C_P);
+              ai.is_jmp:=true;
+              list.concat(ai);
+              invf:=FPUFlags2Flags[invf];
+            end;
+        end;
         a_jmp_flags(list,invf,hl_skip);
 
         { 16-bit INC is shorter than 8-bit }