Explorar o código

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

git-svn-id: trunk@36087 -

nickysn %!s(int64=8) %!d(string=hai) anos
pai
achega
aa93259463
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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;