diff mbox

[rs6000] Fix up BMI/BMI2 intrinsic DG tests

Message ID 1500316101.22326.11.camel@oc7878010663
State New
Headers show

Commit Message

Steven Munroe July 17, 2017, 6:28 p.m. UTC
After a resent GCC change the previously submitted BMI/BMI2 intrinsic
test started to fail with the following warning/error.

ppc_cpu_supports_hw_available122373.c: In function 'main':
ppc_cpu_supports_hw_available122373.c:9:10: warning:
__builtin_cpu_supports need
s GLIBC (2.23 and newer) that exports hardware capability bits

The does not occur on systems with the newer (2.23) GLIBC but is common
on older (stable) distos.

As this is coming from the bmi-check.h and bmi2-check.h includes (and
not the tests directly) it seems simpler to simply skip the test unless
__BUILTIN_CPU_SUPPORTS__ is defined.


[gcc/testsuite]

2017-07-17  Steven Munroe  <munroesj@gcc.gnu.org>

	*gcc.target/powerpc/bmi-check.h (main): Skip unless
	__BUILTIN_CPU_SUPPORTS__ defined.
	*gcc.target/powerpc/bmi2-check.h (main): Skip unless
	__BUILTIN_CPU_SUPPORTS__ defined.

Comments

Segher Boessenkool July 18, 2017, 9:54 p.m. UTC | #1
Hi!

On Mon, Jul 17, 2017 at 01:28:20PM -0500, Steven Munroe wrote:
> After a resent GCC change the previously submitted BMI/BMI2 intrinsic
> test started to fail with the following warning/error.
> 
> ppc_cpu_supports_hw_available122373.c: In function 'main':
> ppc_cpu_supports_hw_available122373.c:9:10: warning:
> __builtin_cpu_supports need
> s GLIBC (2.23 and newer) that exports hardware capability bits
> 
> The does not occur on systems with the newer (2.23) GLIBC but is common
> on older (stable) distos.
> 
> As this is coming from the bmi-check.h and bmi2-check.h includes (and
> not the tests directly) it seems simpler to simply skip the test unless
> __BUILTIN_CPU_SUPPORTS__ is defined.

So this will skip on most current systems; is there no reasonable
way around that?

Okay otherwise.  One typo thing:

> 2017-07-17  Steven Munroe  <munroesj@gcc.gnu.org>
> 
> 	*gcc.target/powerpc/bmi-check.h (main): Skip unless
> 	__BUILTIN_CPU_SUPPORTS__ defined.
> 	*gcc.target/powerpc/bmi2-check.h (main): Skip unless
> 	__BUILTIN_CPU_SUPPORTS__ defined.

There should be a space after the asterisks.


Segher
Steven Munroe July 18, 2017, 10:10 p.m. UTC | #2
On Tue, 2017-07-18 at 16:54 -0500, Segher Boessenkool wrote:
> Hi!
> 
> On Mon, Jul 17, 2017 at 01:28:20PM -0500, Steven Munroe wrote:
> > After a resent GCC change the previously submitted BMI/BMI2 intrinsic
> > test started to fail with the following warning/error.
> > 
> > ppc_cpu_supports_hw_available122373.c: In function 'main':
> > ppc_cpu_supports_hw_available122373.c:9:10: warning:
> > __builtin_cpu_supports need
> > s GLIBC (2.23 and newer) that exports hardware capability bits
> > 
> > The does not occur on systems with the newer (2.23) GLIBC but is common
> > on older (stable) distos.
> > 
> > As this is coming from the bmi-check.h and bmi2-check.h includes (and
> > not the tests directly) it seems simpler to simply skip the test unless
> > __BUILTIN_CPU_SUPPORTS__ is defined.
> 
> So this will skip on most current systems; is there no reasonable
> way around that?
> 
The work around would be to add an #else leg where we obtain the address
of the auxv then scan for the AT_PLATFOM, AT_HWCAP, and AT_HWCAP2
entries. Then perform the required string compares and / or bit tests.

> Okay otherwise.  One typo thing:
> 
> > 2017-07-17  Steven Munroe  <munroesj@gcc.gnu.org>
> > 
> > 	*gcc.target/powerpc/bmi-check.h (main): Skip unless
> > 	__BUILTIN_CPU_SUPPORTS__ defined.
> > 	*gcc.target/powerpc/bmi2-check.h (main): Skip unless
> > 	__BUILTIN_CPU_SUPPORTS__ defined.
> 
> There should be a space after the asterisks.
> 
> 
> Segher
>
Segher Boessenkool July 19, 2017, 5:45 p.m. UTC | #3
On Tue, Jul 18, 2017 at 05:10:42PM -0500, Steven Munroe wrote:
> On Tue, 2017-07-18 at 16:54 -0500, Segher Boessenkool wrote:
> > On Mon, Jul 17, 2017 at 01:28:20PM -0500, Steven Munroe wrote:
> > > After a resent GCC change the previously submitted BMI/BMI2 intrinsic
> > > test started to fail with the following warning/error.
> > > 
> > > ppc_cpu_supports_hw_available122373.c: In function 'main':
> > > ppc_cpu_supports_hw_available122373.c:9:10: warning:
> > > __builtin_cpu_supports need
> > > s GLIBC (2.23 and newer) that exports hardware capability bits
> > > 
> > > The does not occur on systems with the newer (2.23) GLIBC but is common
> > > on older (stable) distos.
> > > 
> > > As this is coming from the bmi-check.h and bmi2-check.h includes (and
> > > not the tests directly) it seems simpler to simply skip the test unless
> > > __BUILTIN_CPU_SUPPORTS__ is defined.
> > 
> > So this will skip on most current systems; is there no reasonable
> > way around that?
> > 
> The work around would be to add an #else leg where we obtain the address
> of the auxv then scan for the AT_PLATFOM, AT_HWCAP, and AT_HWCAP2
> entries. Then perform the required string compares and / or bit tests.

Yeah let's not do that.  We'll just have to live with less test
coverage by random testers, for now.  It's no different from any other
new feature in that regard.


Segher
Steven Munroe July 19, 2017, 6:08 p.m. UTC | #4
On Wed, 2017-07-19 at 12:45 -0500, Segher Boessenkool wrote:
> On Tue, Jul 18, 2017 at 05:10:42PM -0500, Steven Munroe wrote:
> > On Tue, 2017-07-18 at 16:54 -0500, Segher Boessenkool wrote:
> > > On Mon, Jul 17, 2017 at 01:28:20PM -0500, Steven Munroe wrote:
> > > > After a resent GCC change the previously submitted BMI/BMI2 intrinsic
> > > > test started to fail with the following warning/error.
> > > > 
> > > > ppc_cpu_supports_hw_available122373.c: In function 'main':
> > > > ppc_cpu_supports_hw_available122373.c:9:10: warning:
> > > > __builtin_cpu_supports need
> > > > s GLIBC (2.23 and newer) that exports hardware capability bits
> > > > 
> > > > The does not occur on systems with the newer (2.23) GLIBC but is common
> > > > on older (stable) distos.
> > > > 
> > > > As this is coming from the bmi-check.h and bmi2-check.h includes (and
> > > > not the tests directly) it seems simpler to simply skip the test unless
> > > > __BUILTIN_CPU_SUPPORTS__ is defined.
> > > 
> > > So this will skip on most current systems; is there no reasonable
> > > way around that?
> > > 
> > The work around would be to add an #else leg where we obtain the address
> > of the auxv then scan for the AT_PLATFOM, AT_HWCAP, and AT_HWCAP2
> > entries. Then perform the required string compares and / or bit tests.
> 
> Yeah let's not do that.  We'll just have to live with less test
> coverage by random testers, for now.  It's no different from any other
> new feature in that regard.
> 
So proceed with check in ?
diff mbox

Patch

Index: gcc/testsuite/gcc.target/powerpc/bmi-check.h
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bmi-check.h	(revision 250212)
+++ gcc/testsuite/gcc.target/powerpc/bmi-check.h	(working copy)
@@ -13,6 +13,7 @@  do_test (void)
 int
 main ()
 {
+#ifdef __BUILTIN_CPU_SUPPORTS__
   /* Need 64-bit for 64-bit longs as single instruction.  */
   if ( __builtin_cpu_supports ("ppc64") )
     {
@@ -25,6 +26,6 @@  main ()
   else
     printf ("SKIPPED\n");
 #endif
-
+#endif /* __BUILTIN_CPU_SUPPORTS__ */
   return 0;
 }
Index: gcc/testsuite/gcc.target/powerpc/bmi2-check.h
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bmi2-check.h	(revision 250212)
+++ gcc/testsuite/gcc.target/powerpc/bmi2-check.h	(working copy)
@@ -13,6 +13,7 @@  do_test (void)
 int
 main ()
 {
+#ifdef __BUILTIN_CPU_SUPPORTS__
   /* The BMI2 test for pext test requires the Bit Permute doubleword
      (bpermd) instruction added in PowerISA 2.06 along with the VSX
      facility.  So we can test for arch_2_06.  */
@@ -27,7 +28,7 @@  main ()
   else
     printf ("SKIPPED\n");
 #endif
-
+#endif /* __BUILTIN_CPU_SUPPORTS__ */
   return 0;
 }