Browse Source

+ support the lahf,fstsw and fnstsw instructions in
TX86AsmOptimizer.RegLoadedWithNewValue

git-svn-id: trunk@36087 -

nickysn 8 years ago
parent
commit
aa93259463
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/x86/aoptx86.pas

+ 6 - 1
compiler/x86/aoptx86.pas

@@ -475,13 +475,18 @@ unit aoptx86;
 {$ifndef x86_64}
           ((p.opcode = A_AAM) and Reg1WriteOverwritesReg2Entirely(NR_AH,reg)) or
 {$endif not x86_64}
+          ((p.opcode = A_LAHF) and Reg1WriteOverwritesReg2Entirely(NR_AH,reg)) or
           ((p.opcode = A_LODSB) and Reg1WriteOverwritesReg2Entirely(NR_AL,reg)) or
           ((p.opcode = A_LODSW) and Reg1WriteOverwritesReg2Entirely(NR_AX,reg)) or
           ((p.opcode = A_LODSD) and Reg1WriteOverwritesReg2Entirely(NR_EAX,reg)) or
 {$ifdef x86_64}
           ((p.opcode = A_LODSQ) and Reg1WriteOverwritesReg2Entirely(NR_RAX,reg)) or
 {$endif x86_64}
-          ((p.opcode = A_SETcc) and (p.oper[0]^.typ=top_reg) and Reg1WriteOverwritesReg2Entirely(p.oper[0]^.reg,reg));
+          ((p.opcode = A_SETcc) and (p.oper[0]^.typ=top_reg) and Reg1WriteOverwritesReg2Entirely(p.oper[0]^.reg,reg)) or
+          (((p.opcode = A_FSTSW) or
+            (p.opcode = A_FNSTSW)) and
+           (p.oper[0]^.typ=top_reg) and
+           Reg1WriteOverwritesReg2Entirely(p.oper[0]^.reg,reg));
       end;