Re: testsuite: Enable and adjust powerpc fold-vec-extract/insert testcases

2020-10-28 Thread David Edelsohn via Gcc-patches
On Wed, Oct 28, 2020 at 6:26 AM Alan Modra  wrote:
>
> git commit badeac77f552 changed expected number of addi instructions,
> causing these fails on powerpc-linux.
>
> gcc.target/powerpc/fold-vec-insert-int-p9.c: \\maddi\\M found 12 times
> FAIL: gcc.target/powerpc/fold-vec-insert-int-p9.c scan-assembler-times 
> \\maddi\\M 8
> gcc.target/powerpc/fold-vec-extract-char.p9.c: addi found 6 times
> FAIL: gcc.target/powerpc/fold-vec-extract-char.p9.c scan-assembler-times addi 
> 3
> gcc.target/powerpc/fold-vec-extract-int.p9.c: \\maddi\\M found 6 times
> FAIL: gcc.target/powerpc/fold-vec-extract-int.p9.c scan-assembler-times 
> \\maddi\\M 3
> gcc.target/powerpc/fold-vec-extract-longlong.p7.c: \\maddi\\M found 6 times
> FAIL: gcc.target/powerpc/fold-vec-extract-longlong.p7.c scan-assembler-times 
> \\maddi\\M 4
> gcc.target/powerpc/fold-vec-extract-longlong.p8.c: \\maddi\\M found 6 times
> FAIL: gcc.target/powerpc/fold-vec-extract-longlong.p8.c scan-assembler-times 
> \\maddi\\M 4
> changed by badeac77f552
>
> I'm not at all sure why we are counting addi.  On linux I see
> eight in fold-vec-insert-int-p9.c tearing down the stack frame in
> function epilogues, and four in
> addi 9,1,16
> lvewx 0,0,9
> For aix you have the above four but with a -16 offset.  There are no
> stack frames, and you have four addressing stack red-zone as
> addi 9,1,-64
>
> fold-vec-extract-char.p9.c on linux just has epilogue addi, aix has
> red-zone addressing.  The same for fold-vec-extract-int.p9.c,
> fold-vec-extract-longlong.p7.c and fold-vec-extract-longlong.p8.c.
>
> It seems silly to count addi in a function epilogue, and fragile to
> count them in code.  So remove the ilp32 addi checks.
>
> Regression tested powerpc64-linux and powerpc64le-linux.  OK?
>
> * gcc.target/powerpc/fold-vec-extract-char.p9.c: Don't check addi
> count for ilp32.
> * gcc.target/powerpc/fold-vec-extract-int.p9.c: Likewise.
> * gcc.target/powerpc/fold-vec-extract-longlong.p7.c: Likewise.
> * gcc.target/powerpc/fold-vec-extract-longlong.p8.c: Likewise.
> * gcc.target/powerpc/fold-vec-insert-int-p9.c: Likewise.

Okay.

Thanks, David


Re: testsuite: Enable and adjust powerpc fold-vec-extract/insert testcases

2020-10-28 Thread Alan Modra via Gcc-patches
git commit badeac77f552 changed expected number of addi instructions,
causing these fails on powerpc-linux.

gcc.target/powerpc/fold-vec-insert-int-p9.c: \\maddi\\M found 12 times
FAIL: gcc.target/powerpc/fold-vec-insert-int-p9.c scan-assembler-times 
\\maddi\\M 8
gcc.target/powerpc/fold-vec-extract-char.p9.c: addi found 6 times
FAIL: gcc.target/powerpc/fold-vec-extract-char.p9.c scan-assembler-times addi 3
gcc.target/powerpc/fold-vec-extract-int.p9.c: \\maddi\\M found 6 times
FAIL: gcc.target/powerpc/fold-vec-extract-int.p9.c scan-assembler-times 
\\maddi\\M 3
gcc.target/powerpc/fold-vec-extract-longlong.p7.c: \\maddi\\M found 6 times
FAIL: gcc.target/powerpc/fold-vec-extract-longlong.p7.c scan-assembler-times 
\\maddi\\M 4
gcc.target/powerpc/fold-vec-extract-longlong.p8.c: \\maddi\\M found 6 times
FAIL: gcc.target/powerpc/fold-vec-extract-longlong.p8.c scan-assembler-times 
\\maddi\\M 4
changed by badeac77f552

I'm not at all sure why we are counting addi.  On linux I see
eight in fold-vec-insert-int-p9.c tearing down the stack frame in
function epilogues, and four in
addi 9,1,16
lvewx 0,0,9
For aix you have the above four but with a -16 offset.  There are no
stack frames, and you have four addressing stack red-zone as
addi 9,1,-64

fold-vec-extract-char.p9.c on linux just has epilogue addi, aix has
red-zone addressing.  The same for fold-vec-extract-int.p9.c,
fold-vec-extract-longlong.p7.c and fold-vec-extract-longlong.p8.c.

It seems silly to count addi in a function epilogue, and fragile to
count them in code.  So remove the ilp32 addi checks.

Regression tested powerpc64-linux and powerpc64le-linux.  OK?

* gcc.target/powerpc/fold-vec-extract-char.p9.c: Don't check addi
count for ilp32.
* gcc.target/powerpc/fold-vec-extract-int.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-longlong.p7.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-longlong.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-int-p9.c: Likewise.

diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-char.p9.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-char.p9.c
index ff03c9a722b..8a4c380edad 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-char.p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-char.p9.c
@@ -12,7 +12,6 @@
 
 /* { dg-final { scan-assembler-times "stxv" 6 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times "lbz" 6 { target ilp32 } } } */
-/* { dg-final { scan-assembler-times "addi" 3 { target ilp32 } } } */
 
 
 #include 
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p9.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p9.c
index 868b673cdaf..1abf19da40d 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p9.c
@@ -18,7 +18,6 @@
 /* { dg-final { scan-assembler-times {\madd\M} 3 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mstxv\M} 6 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mlwz\M} 6 { target ilp32 } } } */
-/* { dg-final { scan-assembler-times {\maddi\M} 3 { target ilp32 } } } */
 
 
 #include 
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p7.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p7.c
index 033d21c9a43..b97fcb40eda 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p7.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p7.c
@@ -22,7 +22,6 @@
 /* -m32 target with constant test uses (+2)li where the -m64 has an ld */
 /* { dg-final { scan-assembler-times {\mli\M} 5 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\maddi\M} 6 { target lp64 } } } */
-/* { dg-final { scan-assembler-times {\maddi\M} 4 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstvx\M} 3 } } */
 /* { dg-final { scan-assembler-times {\mrldic\M|\mrlwinm\M} 3 } } */
 /* { dg-final { scan-assembler-times {\mldx\M} 3 { target lp64 } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p8.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p8.c
index 0b624d262e1..8ddce3fd2d8 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p8.c
@@ -17,7 +17,6 @@
 /* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstxvw4x\M} 4 { target 
ilp32 } } } */
 /* { dg-final { scan-assembler-times {\madd\M} 3 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mlwz\M} 11 { target ilp32 } } } */
-/* { dg-final { scan-assembler-times {\maddi\M} 4 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mmfvsrd\M} 6 { target lp64 } } } */
 /* { dg-final { scan-assembler-times {\mmtvsrd\M} 3 { target lp64 } } } */
 /* { dg-final { scan-assembler-times {\mxxpermdi\M} 3 { target le } } } */
diff --git a/gcc/testsuite/gcc.target/powerp