[PATCH] Small i?86 testsuite tweaks (PR target/64210)

2014-12-15 Thread Jakub Jelinek
Hi!

As mentioned in the PR, some tests fail with -fpic.
The problem is that they are expecting a 32-bit GPR must start with
%e, but %r8d or %r15d are 32-bit GPRs too.
The other problem is that PIC code has some loads/stores different from
non-pic code, so the counts looking e.g. for loads with ( right after tab
don't match the expected values, etc.

Regtested on x86_64-linux and i686-linux, ok for trunk?

2014-12-10  Jakub Jelinek  ja...@redhat.com

PR target/64210
* gcc.target/i386/avx512f-broadcast-gpr-1.c: Use %(?:e|r\[0-9\]+d)
instead of %e in regexps trying to match 32-bit GPR.
* gcc.target/i386/avx512f-vpbroadcastd-1.c: Likewise.
* gcc.target/i386/avx512vl-vpbroadcastd-1.c: Likewise.
* gcc.target/i386/avx512vl-vmovdqa64-1.c: Restrict some 
scan-assembler-times
lines to nonpic targets only.  Fix up \[^\n^x^y\] to \[^\nxy\].

--- gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c.jj   2014-12-03 
16:33:53.0 +0100
+++ gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c  2014-12-10 
15:23:07.611650110 +0100
@@ -3,9 +3,9 @@
 /* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 2 } } */
 /* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 2 } } */
 /* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 2 } } */
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 1 } } */
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 1 } } */
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 1 } } */
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 1 } } */
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 1 } 
} */
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 
1 } } */
 
 #include immintrin.h
 
--- gcc/testsuite/gcc.target/i386/avx512f-broadcast-gpr-1.c.jj  2014-12-03 
16:33:53.0 +0100
+++ gcc/testsuite/gcc.target/i386/avx512f-broadcast-gpr-1.c 2014-12-10 
15:23:42.132036283 +0100
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options -mavx512f -O2 } */
 /* { dg-final { scan-assembler-times vpbroadcastq\[ 
\\t\]+%r\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 1 { target { ! { ia32 } } } } } 
*/
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 1 { target { ! { ia32 } } } } } 
*/
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%(?:e|r\[0-9\]+d)\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 1 { target { ! { 
ia32 } } } } } */
 /* { dg-final { scan-assembler-times vpbroadcastq\[ 
\\t\]+\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 1 { target ia32 } } } */
 /* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#) 1 { target ia32 } } } */
 
--- gcc/testsuite/gcc.target/i386/avx512vl-vpbroadcastd-1.c.jj  2014-12-03 
16:33:54.0 +0100
+++ gcc/testsuite/gcc.target/i386/avx512vl-vpbroadcastd-1.c 2014-12-10 
15:20:36.394339145 +0100
@@ -4,10 +4,10 @@
 /* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 2 } } */
 /* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 2 } } */
 /* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 2 } } */
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 1 { target { ! { 
ia32 } } } } } */
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 1 { target { ! 
{ ia32 } } } } } */
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 1 { target { ! { 
ia32 } } } } } */
-/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%e\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 1 { target { ! 
{ ia32 } } } } } */
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 1 { 
target { ! { ia32 } } } } } */
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#) 
1 { target { ! { ia32 } } } } } */
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 
\\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#) 1 { 
target { ! { ia32 } } } } } */
+/* { dg-final { scan-assembler-times vpbroadcastd\[ 

Re: [PATCH] Small i?86 testsuite tweaks (PR target/64210)

2014-12-15 Thread Uros Bizjak
On Wed, Dec 10, 2014 at 9:08 PM, Jakub Jelinek ja...@redhat.com wrote:

 As mentioned in the PR, some tests fail with -fpic.
 The problem is that they are expecting a 32-bit GPR must start with
 %e, but %r8d or %r15d are 32-bit GPRs too.
 The other problem is that PIC code has some loads/stores different from
 non-pic code, so the counts looking e.g. for loads with ( right after tab
 don't match the expected values, etc.

 Regtested on x86_64-linux and i686-linux, ok for trunk?

 2014-12-10  Jakub Jelinek  ja...@redhat.com

 PR target/64210
 * gcc.target/i386/avx512f-broadcast-gpr-1.c: Use %(?:e|r\[0-9\]+d)
 instead of %e in regexps trying to match 32-bit GPR.
 * gcc.target/i386/avx512f-vpbroadcastd-1.c: Likewise.
 * gcc.target/i386/avx512vl-vpbroadcastd-1.c: Likewise.
 * gcc.target/i386/avx512vl-vmovdqa64-1.c: Restrict some 
 scan-assembler-times
 lines to nonpic targets only.  Fix up \[^\n^x^y\] to \[^\nxy\].

OK.

Thanks,
Uros.