2
0
Эх сурвалжийг харах

* use V* instructions if possible
* fix i386 compilation

git-svn-id: trunk@47076 -

florian 4 жил өмнө
parent
commit
c2684c0dc3

+ 1 - 3
compiler/i386/aoptcpu.pas

@@ -203,9 +203,7 @@ unit aoptcpu;
                 A_VANDPD,
                 A_VANDPD,
                 A_VANDPS,
                 A_VANDPS,
                 A_VORPD,
                 A_VORPD,
-                A_VORPS,
-                A_VXORPD,
-                A_VXORPS:
+                A_VORPS:
                   Result:=OptPass1VOP(p);
                   Result:=OptPass1VOP(p);
                 A_MULSD,
                 A_MULSD,
                 A_MULSS,
                 A_MULSS,

+ 28 - 6
compiler/x86/cgx86.pas

@@ -1851,6 +1851,27 @@ unit cgx86;
             )
             )
           )
           )
         );
         );
+        opmm2asmop_avx : array[0..1,OS_F32..OS_F64,topcg] of tasmop = (
+          ( { scalar }
+            ( { OS_F32 }
+              A_NOP,A_NOP,A_VADDSS,A_NOP,A_VDIVSS,A_NOP,A_NOP,A_VMULSS,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_VSUBSS,A_VXORPS,A_NOP,A_NOP
+            ),
+            ( { OS_F64 }
+              A_NOP,A_NOP,A_VADDSD,A_NOP,A_VDIVSD,A_NOP,A_NOP,A_VMULSD,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_VSUBSD,A_VXORPD,A_NOP,A_NOP
+            )
+          ),
+          ( { vectorized/packed }
+            { because the logical packed single instructions have shorter op codes, we use always
+              these
+            }
+            ( { OS_F32 }
+              A_NOP,A_NOP,A_VADDPS,A_NOP,A_VDIVPS,A_NOP,A_NOP,A_VMULPS,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_VSUBPS,A_VXORPS,A_NOP,A_NOP
+            ),
+            ( { OS_F64 }
+              A_NOP,A_NOP,A_VADDPD,A_NOP,A_VDIVPD,A_NOP,A_NOP,A_VMULPD,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_VSUBPD,A_VXORPD,A_NOP,A_NOP
+            )
+          )
+        );
         opmm2asmop_full : array[topcg] of tasmop = (
         opmm2asmop_full : array[topcg] of tasmop = (
           A_NOP,A_NOP,A_NOP,A_PAND,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_POR,A_NOP,A_NOP,A_NOP,A_NOP,A_PXOR,A_NOP,A_NOP
           A_NOP,A_NOP,A_NOP,A_PAND,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_POR,A_NOP,A_NOP,A_NOP,A_NOP,A_PXOR,A_NOP,A_NOP
         );
         );
@@ -1886,13 +1907,14 @@ unit cgx86;
           end
           end
         else if shufflescalar(shuffle) then
         else if shufflescalar(shuffle) then
           begin
           begin
-            asmop:=opmm2asmop[0,size,op];
-            { no scalar operation available? }
-            if asmop=A_NOP then
+            if UseAVX then
               begin
               begin
-                { do vectorized and shuffle finally }
-                internalerror(2010060102);
-              end;
+                asmop:=opmm2asmop_avx[0,size,op];
+                if size in [OS_M256,OS_M512] then
+                  Include(current_procinfo.flags,pi_uses_ymm);
+              end
+            else
+              asmop:=opmm2asmop[0,size,op];
           end
           end
         else
         else
           internalerror(200312211);
           internalerror(200312211);