diff mbox series

add sqrt options and test for sqrt support in ppc tests

Message ID orpn0590g8.fsf@lxoliva.fsfla.org
State New
Headers show
Series add sqrt options and test for sqrt support in ppc tests | expand

Commit Message

Alexandre Oliva March 11, 2021, 3:25 p.m. UTC
Some powerpc tests that require the fsqrt insn to be enabled
explicitly use the -mpowerpc-gpopt option.  This fails if the fsqrt
opcode is not available on the target machine.

Switch to dg-add-options sqrt_insn for compile tests, that adds the
option for the feature (pending approval of another patch for the same
PR), and to dg-require-effective-target sqrt_insn for execution tests.


This patch depends on the recent patch for PR99352, and on the proposed
patch for PR99371.

This was regstrapped on x86_64-linux-gnu, and tested with a cross to a
ppc64-vxworks7r2 that has no -mpowerpc-gpopt disabled by default, and
that raises Illegal Instruction exceptions upon encountering a fsqrt.
I'm now regstrapping it on ppc64-linux-gnu, just to be sure.
Ok to install?


for  gcc/testsuite/ChangeLog

	PR testsuite/99371
	* gcc.target/powerpc/pr46728-10.c: Drop explicit
	-mpowerpc-gpopt in favor of dg-require-effective-target sqrt_insn.
	* gcc.target/powerpc/pr46728-11.c: Likewise.
	* gcc.target/powerpc/pr46728-13.c: Likewise.
	* gcc.target/powerpc/pr46728-14.c: Likewise.
	* gcc.target/powerpc/pr46728-15.c: Likewise.
	* gcc.target/powerpc/recip-7.c: Likewise.
	* gcc.target/powerpc/pr46728-1.c: Drop explicit
	-mpowerpc-gpopt in favor of dg-add-options sqrt_insn.
	* gcc.target/powerpc/pr46728-2.c: Likewise.
	* gcc.target/powerpc/pr46728-3.c: Likewise.
	* gcc.target/powerpc/pr46728-4.c: Likewise.
	* gcc.target/powerpc/pr46728-5.c: Likewise.
	* gcc.target/powerpc/pr46728-7.c: Likewise.
	* gcc.target/powerpc/pr46728-8.c: Likewise.

TN: U302-010
---
 gcc/testsuite/gcc.target/powerpc/pr46728-1.c  |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-10.c |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-11.c |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-13.c |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-14.c |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-15.c |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-2.c  |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-3.c  |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-4.c  |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-5.c  |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-7.c  |    3 ++-
 gcc/testsuite/gcc.target/powerpc/pr46728-8.c  |    3 ++-
 gcc/testsuite/gcc.target/powerpc/recip-7.c    |    3 ++-
 13 files changed, 26 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-1.c b/gcc/testsuite/gcc.target/powerpc/pr46728-1.c
index fc2cd7d7c9c56..b561d8b6e42f9 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-1.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */
+/* { dg-add-options sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-10.c b/gcc/testsuite/gcc.target/powerpc/pr46728-10.c
index 3be4728d333a4..cdde53b8de037 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-10.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-10.c
@@ -1,6 +1,7 @@ 
 /* { dg-do run } */
 /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */
+/* { dg-require-effective-target sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-11.c b/gcc/testsuite/gcc.target/powerpc/pr46728-11.c
index 43b6728a4b812..62b49b1479345 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-11.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-11.c
@@ -1,6 +1,7 @@ 
 /* { dg-do run } */
 /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */
+/* { dg-require-effective-target sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-13.c b/gcc/testsuite/gcc.target/powerpc/pr46728-13.c
index b9fd63973b728..3e55fa86e0b7c 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-13.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-13.c
@@ -1,6 +1,7 @@ 
 /* { dg-do run } */
 /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */
+/* { dg-require-effective-target sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-14.c b/gcc/testsuite/gcc.target/powerpc/pr46728-14.c
index 5affff13bdb6c..472b9d5b60120 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-14.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-14.c
@@ -1,6 +1,7 @@ 
 /* { dg-do run } */
 /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */
+/* { dg-require-effective-target sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-15.c b/gcc/testsuite/gcc.target/powerpc/pr46728-15.c
index b4c9660626962..7198a29794b4b 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-15.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-15.c
@@ -1,6 +1,7 @@ 
 /* { dg-do run } */
 /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */
+/* { dg-require-effective-target sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-2.c b/gcc/testsuite/gcc.target/powerpc/pr46728-2.c
index 77679873b957f..727dea6ff907e 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-2.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */
+/* { dg-add-options sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-3.c b/gcc/testsuite/gcc.target/powerpc/pr46728-3.c
index db972168cb953..ebd86de11ff67 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-3.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */
+/* { dg-add-options sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-4.c b/gcc/testsuite/gcc.target/powerpc/pr46728-4.c
index 249898ac0361b..184afabc72309 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-4.c
@@ -1,6 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-skip-if "No __builtin_cbrt" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */
+/* { dg-add-options sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-5.c b/gcc/testsuite/gcc.target/powerpc/pr46728-5.c
index e15e7c0977e33..938a5f15a9faa 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-5.c
@@ -1,6 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-skip-if "No __builtin_cbrt" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */
+/* { dg-add-options sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-7.c b/gcc/testsuite/gcc.target/powerpc/pr46728-7.c
index 2b7d0940a0f10..f1e49381bd4a0 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-7.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */
+/* { dg-add-options sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-8.c b/gcc/testsuite/gcc.target/powerpc/pr46728-8.c
index 7d2af12db859f..786dfad378449 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr46728-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr46728-8.c
@@ -1,6 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-skip-if "No __builtin_cbrt" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */
+/* { dg-add-options sqrt_insn } */
 
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-7.c b/gcc/testsuite/gcc.target/powerpc/recip-7.c
index 12b1e9cd6f9e6..a488bd6647697 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-7.c
@@ -1,7 +1,8 @@ 
 /* { dg-do run { target { powerpc*-*-linux* powerpc*-ibm-aix* } } } */
 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
 /* { dg-require-effective-target ppc_recip_hw } */
-/* { dg-options "-O3 -ftree-vectorize -ffast-math -mrecip -mpowerpc-gfxopt -mpowerpc-gpopt -mpopcntb" } */
+/* { dg-require-effective-target sqrt_insn } */
+/* { dg-options "-O3 -ftree-vectorize -ffast-math -mrecip -mpowerpc-gfxopt -mpopcntb" } */
 
 /* Check reciprocal estimate functions for accuracy.  */