[rs6000] PR84371 Update builtins-3*.c tests for power9 codegen

Message ID 1518731770.11602.348.camel@brimstone.rchland.ibm.com
State New
Headers show
Series
  • [rs6000] PR84371 Update builtins-3*.c tests for power9 codegen
Related show

Commit Message

will schmidt Feb. 15, 2018, 9:56 p.m.
Hi,
   This fixes the scan-assembler errors as seen on power9. While verifying
that fix and ensuring coverage, cleaned up some nearby bits as well.

builtins-3.c:  Add/update options and skip-if stanzas, this test specifically
targets vsx/power6.
builtins-3-p9.c:  Update stanzas to require -mcpu=power9 capability.  For better
coverage, added tests here (from builtins-3.c) that have different code-gen
when targeting p9.
builtins-3-p8.c:  Update stanzas to require -mcpu=power8 capability.
builtins-3-runnable.c: Update requires to indicate p8vector_hw is required
for running the test.   Fixed the do-not-override stanza typo so this test
can run.
builtins-3-vec_reve-runnable.c:  Update stanzas to require vsx_hw capability
to run.  Removed the skip-if stanza (by direct inspection, this runs OK on
P8,P9, and vsx_hw requirement prevents run attempts on earlier systems).
    
Sniff-testing across systems looks good.

Will kick off a regtest in clean environments shortly.
    
OK for trunk?  (and gcc-7 backport)?
    
Thanks
-Will
    
[testsuite]
2018-02-15  Will Schmidt  <will_schmidt@vnet.ibm.com>

	target/pr84371
	* gcc.target/powerpc/builtins-3-p8.c: Update stanzas.
	* gcc.target/powerpc/builtins-3-p9.c: Update stanzas, Enhance test.
	* gcc.target/powerpc/builtins-3-runnable.c: Update stanzas.
	* gcc.target/powerpc/builtins-3-vec_reve_runnable.c: Same.
	* gcc.target/powerpc/builtins-3.c: Same.

Comments

Segher Boessenkool Feb. 16, 2018, 3:47 p.m. | #1
Hi!

On Thu, Feb 15, 2018 at 03:56:10PM -0600, Will Schmidt wrote:
>    This fixes the scan-assembler errors as seen on power9. While verifying

> that fix and ensuring coverage, cleaned up some nearby bits as well.


> 2018-02-15  Will Schmidt  <will_schmidt@vnet.ibm.com>

> 

> 	target/pr84371

> 	* gcc.target/powerpc/builtins-3-p8.c: Update stanzas.

> 	* gcc.target/powerpc/builtins-3-p9.c: Update stanzas, Enhance test.

> 	* gcc.target/powerpc/builtins-3-runnable.c: Update stanzas.

> 	* gcc.target/powerpc/builtins-3-vec_reve_runnable.c: Same.

> 	* gcc.target/powerpc/builtins-3.c: Same.


> diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c

> index 1549817..43de454 100644

> --- a/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c

> +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c

> @@ -1,9 +1,9 @@

> -/* { dg-do run { target { powerpc*-*-linux* } } } */

> +/* { dg-do run { target { p8vector_hw } } } */

>  /* { dg-require-effective-target vsx_hw } */


This is a bit weird, requiring two generations of hardware, this can be
cleaned up a bit still.

Okay for trunk with or without that.  Thanks!


Segher
Peter Bergner Feb. 19, 2018, 4:20 p.m. | #2
On 2/15/18 3:56 PM, Will Schmidt wrote:
> -/* { dg-options "-mcpu=power8" } */

> +/* { dg-options "-maltivec -mcpu=power8" } */


Why did you add -maltivec?  That flag is enabled implicitly by -mcpu=power8
which we're already using?

Peter

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c
index 83d538b..a586805 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c
@@ -1,8 +1,9 @@ 
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-options "-mcpu=power8" } */
+/* { dg-options "-maltivec -mcpu=power8" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
 
 #include <altivec.h>
 
 vector bool long long
 test_eq_long_long (vector bool long long x, vector bool long long y)
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
index 9dc53da..146f8b7 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
@@ -1,8 +1,9 @@ 
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_p9vector_ok } */
 /* { dg-options "-mcpu=power9 -O1" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
 
 #include <altivec.h>
 
 vector bool char
 test_ne_char (vector bool char x, vector bool char y)
@@ -45,28 +46,78 @@  test_vull_bperm_vull_vuc (vector unsigned long long x,
                           vector unsigned char y)
 {
 	return vec_bperm (x, y);
 }
 
+vector signed char
+test_nabs_char (vector signed char x)
+{
+	return vec_nabs (x);
+}
+
+vector short
+test_nabs_short (vector short x)
+{
+  return vec_nabs (x);
+}
+
+vector int
+test_nabs_int (vector int x)
+{
+  return vec_nabs (x);
+}
+
+
+vector signed char
+test_neg_char (vector signed char x)
+{
+	return vec_neg (x);
+}
+
+vector short
+test_neg_short (vector short x)
+{
+	return vec_neg (x);
+}
+
+vector int
+test_neg_int (vector int x)
+{
+	return vec_neg (x);
+}
+
 /* Expected test results:
 
      test_ne_char              1 vcmpneb
      test_ne_short             1 vcmpneh
      test_ne_int               1 vcmpnew
      test_ne_long              1 vcmpequd, 1 xxlnor inst
      test_neg_long_long        1 vnegd
      test_vull_bperm_vull_vuc  1 vbpermd
      test_nabs_long_long (-O0) 1 xxspltib, 1 vsubudm, 1 vminsd
      test_nabs_long_long (-O1) 1 vnegd, vminsd
+     test_nabs_char (P9)       1 xxspltib, 1 vsububm, 1 vminsb
+     test_nabs_short (P9)      1 xxspltib, 1 vsubuhm, 1 vminsh
+     test_nabs_int (P9)        1 vnegw, 1 vminsw
+     test_neg_char (P9)        1 xxspltib, 1 vsububm
+     test_neg_short (P9)       1 xxspltib, 1 vsubuhm
+     test_neg_int (P9)         1 vnegw
 */
 
 /* { dg-final { scan-assembler-times "vcmpneb"  1 } } */
 /* { dg-final { scan-assembler-times "vcmpneh"  1 } } */
 /* { dg-final { scan-assembler-times "vcmpnew"  1 } } */
 /* { dg-final { scan-assembler-times "vcmpequd" 1 } } */
 /* { dg-final { scan-assembler-times "xxlnor"   1 } } */
-/* { dg-final { scan-assembler-times "xxspltib" 0 } } */
+/* { dg-final { scan-assembler-times "xxspltib" 4 } } */
 /* { dg-final { scan-assembler-times "vsubudm"  0 } } */
+/* { dg-final { scan-assembler-times "vsububm"  2 } } */
+/* { dg-final { scan-assembler-times "vsubuhm"  2 } } */
+/* { dg-final { scan-assembler-times "vsubuwm"  0 } } */
+/* { dg-final { scan-assembler-times "vminsb"   1 } } */
+/* { dg-final { scan-assembler-times "vminsh"   1 } } */
+/* { dg-final { scan-assembler-times "vminsw"   1 } } */
 /* { dg-final { scan-assembler-times "vminsd"   1 } } */
 /* { dg-final { scan-assembler-times "vnegd"    2 } } */
+/* { dg-final { scan-assembler-times "vnegw"    2 } } */
 /* { dg-final { scan-assembler-times "vbpermd"  1 } } */
 
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c
index 1549817..43de454 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c
@@ -1,9 +1,9 @@ 
-/* { dg-do run { target { powerpc*-*-linux* } } } */
+/* { dg-do run { target { p8vector_hw } } } */
 /* { dg-require-effective-target vsx_hw } */
 /* { dg-options "-O2 -mvsx -mcpu=power8" } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=power8" } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
 
 #include <altivec.h> // vector
 
 #ifdef DEBUG
 #include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-vec_reve-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-vec_reve-runnable.c
index f7c3c3d..de378e0 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3-vec_reve-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-vec_reve-runnable.c
@@ -1,7 +1,6 @@ 
-/* { dg-do run { target { powerpc*-*-linux* } } } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
+/* { dg-do run { target { vsx_hw } } } */
 /* { dg-options "-O2 -mvsx -mcpu=power7" } */
 
 #include <altivec.h> // vector
 
 #ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3.c b/gcc/testsuite/gcc.target/powerpc/builtins-3.c
index 833116e..b8a6dcd 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3.c
@@ -1,8 +1,9 @@ 
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec -mvsx" } */
+/* { dg-options "-O2 -mvsx -mcpu=power6" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power6" } } */
 
 #include <altivec.h>
 
 vector bool char
 test_eq_char (vector bool char x, vector bool char y)