]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Adjust testcase for more optimal codegen.
authorliuhongt <hongtao.liu@intel.com>
Tue, 1 Aug 2023 04:48:21 +0000 (12:48 +0800)
committerliuhongt <hongtao.liu@intel.com>
Tue, 1 Aug 2023 06:00:40 +0000 (14:00 +0800)
After
b9d7140c80bd3c7355b8291bb46f0895dcd8c3cb is the first bad commit
commit b9d7140c80bd3c7355b8291bb46f0895dcd8c3cb
Author: Jan Hubicka <jh@suse.cz>
Date:   Fri Jul 28 09:16:09 2023 +0200

    loop-split improvements, part 1

Now we have
    vpbroadcastd %ecx, %xmm0
    vpaddd .LC3(%rip), %xmm0, %xmm0
    vpextrd $3, %xmm0, %eax
    vmovddup %xmm3, %xmm0
    vrndscalepd $9, %xmm0, %xmm0
    vunpckhpd %xmm0, %xmm0, %xmm3

for vrndscalepd, no need to insert pxor since it reuses input register
xmm0 to avoid partial sse dependece.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr87007-4.c: Adjust testcase.
* gcc.target/i386/pr87007-5.c: Ditto.

gcc/testsuite/gcc.target/i386/pr87007-4.c
gcc/testsuite/gcc.target/i386/pr87007-5.c

index e91bdcbac44b2510d6462fbf03e82f948467395f..23b5c5dcc5203648d186896ebc6371e72ef038d9 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-Ofast -march=skylake-avx512 -mfpmath=sse" } */
-
+/* { dg-options "-O2 -march=skylake-avx512 -mfpmath=sse" } */
+/* Load of d2/d3 is hoisted out, vrndscalesd will reuse loades register to avoid partial dependence.  */
 
 #include<math.h>
 
@@ -15,4 +15,4 @@ foo (int n, int k)
       d1 = ceil (d3);
 }
 
-/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */
+/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 0 } } */
index 20d13cf650b9100f5c07b5a16c456d2dcc2b1e1e..b36e81c270c937559ecd6aebaa4973a2174581d8 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-Ofast -march=skylake-avx512 -mfpmath=sse" } */
-
+/* { dg-options "-Ofast -march=skylake-avx512 -mfpmath=sse -fno-tree-vectorize" } */
+/* Load of d2/d3 is hoisted out, vrndscalesd will reuse loades register to avoid partial dependence.  */
 
 #include<math.h>
 
@@ -15,4 +15,4 @@ foo (int n, int k)
       d1 = sqrt (d3);
 }
 
-/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */
+/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 0 } } */