Forráskód Böngészése

* load 0.0 by (V)XORPS/D instead of (V)PXOR in mm registers

git-svn-id: trunk@47073 -
florian 4 éve
szülő
commit
8e62bf649e

+ 4 - 0
compiler/i386/aoptcpu.pas

@@ -143,8 +143,12 @@ unit aoptcpu;
                   Result:=OptPass1Imul(p);
                 A_CMP:
                   Result:=OptPass1Cmp(p);
+                A_VXORPS,
+                A_VXORPD,
                 A_VPXOR:
                   Result:=OptPass1VPXor(p);
+                A_XORPS,
+                A_XORPD,
                 A_PXOR:
                   Result:=OptPass1PXor(p);
                 A_FLD:

+ 1 - 0
compiler/x86/aoptx86.pas

@@ -4236,6 +4236,7 @@ unit aoptx86;
          Result:=OptPass1VOP(p);
      end;
 
+
    function TX86AsmOptimizer.OptPass1Imul(var p: tai): boolean;
      var
        hp1 : tai;

+ 12 - 2
compiler/x86/nx86con.pas

@@ -76,9 +76,19 @@ implementation
                      location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
                      location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resultdef));
                      if UseAVX then
-                       emit_reg_reg_reg(A_VPXOR,S_NO,location.register,location.register,location.register)
+                       begin
+                         if is_single(resultdef) then
+                           emit_reg_reg_reg(A_VXORPS,S_NO,location.register,location.register,location.register)
+                         else
+                           emit_reg_reg_reg(A_VXORPD,S_NO,location.register,location.register,location.register);
+                       end
                      else
-                       emit_reg_reg(A_PXOR,S_NO,location.register,location.register);
+                       begin
+                         if is_single(resultdef) then
+                           emit_reg_reg(A_XORPS,S_NO,location.register,location.register)
+                         else
+                           emit_reg_reg(A_XORPD,S_NO,location.register,location.register);
+                       end
                    end
                  else
                    begin

+ 5 - 3
compiler/x86_64/aoptcpu.pas

@@ -103,9 +103,7 @@ uses
                 A_VANDPD,
                 A_VANDPS,
                 A_VORPD,
-                A_VORPS,
-                A_VXORPD,
-                A_VXORPS:
+                A_VORPS:
                   result:=OptPass1VOP(p);
                 A_MULSD,
                 A_MULSS,
@@ -131,8 +129,12 @@ uses
                   result:=OptPass1FLD(p);
                 A_CMP:
                   result:=OptPass1Cmp(p);
+                A_VXORPS,
+                A_VXORPD,
                 A_VPXOR:
                   Result:=OptPass1VPXor(p);
+                A_XORPS,
+                A_XORPD,
                 A_PXOR:
                   Result:=OptPass1PXor(p);
                 else