Browse Source

* fix MovapXComisX2ComisX2 optimization

florian 3 years ago
parent
commit
68bc5da3a2
1 changed files with 5 additions and 6 deletions
  1. 5 6
      compiler/x86/aoptx86.pas

+ 5 - 6
compiler/x86/aoptx86.pas

@@ -2097,11 +2097,10 @@ unit aoptx86;
                    )
                    )
                   ) and not(OpsEqual(taicpu(hp1).oper[1]^,taicpu(hp1).oper[0]^)) then
                   ) and not(OpsEqual(taicpu(hp1).oper[1]^,taicpu(hp1).oper[0]^)) then
                   { change
                   { change
-                             movapX    reg,reg2
-                             addsX/subsX/... reg3, reg2
-                             movapX    reg2,reg
+                             movapX    reg,reg1
+                             vcomisX   reg1,reg1
                     to
                     to
-                             addsX/subsX/... reg3,reg
+                             vcomisX   reg,reg
                   }
                   }
                   begin
                   begin
                     TransferUsedRegs(TmpUsedRegs);
                     TransferUsedRegs(TmpUsedRegs);
@@ -2112,9 +2111,9 @@ unit aoptx86;
                               debug_op2str(taicpu(p).opcode)+' '+
                               debug_op2str(taicpu(p).opcode)+' '+
                               debug_op2str(taicpu(hp1).opcode)+') done',p);
                               debug_op2str(taicpu(hp1).opcode)+') done',p);
                         if OpsEqual(taicpu(p).oper[1]^,taicpu(hp1).oper[0]^) then
                         if OpsEqual(taicpu(p).oper[1]^,taicpu(hp1).oper[0]^) then
-                          taicpu(hp1).loadoper(0, taicpu(p).oper[1]^);
+                          taicpu(hp1).loadoper(0, taicpu(p).oper[0]^);
                         if OpsEqual(taicpu(p).oper[1]^,taicpu(hp1).oper[1]^) then
                         if OpsEqual(taicpu(p).oper[1]^,taicpu(hp1).oper[1]^) then
-                          taicpu(hp1).loadoper(1, taicpu(p).oper[1]^);
+                          taicpu(hp1).loadoper(1, taicpu(p).oper[0]^);
                         RemoveCurrentP(p, nil);
                         RemoveCurrentP(p, nil);
                         result:=true;
                         result:=true;
                         exit;
                         exit;