[PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit

Peter Bergner bergner@vnet.ibm.com
Mon Nov 6 18:02:00 GMT 2017


There is a new HWCAP2 bit added to the AUXV here:

  http://patchwork.ozlabs.org/patch/824764/

This patch adds __builtin_cpu_supports() support for it.
This passed bootstrap and regtesting with no regressions?
Ok for trunk?

Ok to back port to the open releases too once testing to complete there?

Peter


gcc/
	* config/rs6000/ppc-auxv.h (PPC_FEATURE2_HTM_NO_SUSPEND): New define.
	* config/rs6000/rs6000.c (cpu_supports_info): Use it.

gcc/testsuite/
	* gcc.target/powerpc/cpu-builtin-1.c (htm-no-suspend): Add test.

Index: gcc/config/rs6000/ppc-auxv.h
===================================================================
--- gcc/config/rs6000/ppc-auxv.h	(revision 254453)
+++ gcc/config/rs6000/ppc-auxv.h	(working copy)
@@ -91,6 +91,7 @@
 #define PPC_FEATURE2_HAS_IEEE128    0x00400000
 #define PPC_FEATURE2_DARN           0x00200000
 #define PPC_FEATURE2_SCV            0x00100000
+#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000
 
 
 /* Thread Control Block (TCB) offsets of the AT_PLATFORM, AT_HWCAP and
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 254453)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -387,6 +387,7 @@ static const struct
   { "ebb",		PPC_FEATURE2_HAS_EBB,		1 },
   { "htm",		PPC_FEATURE2_HAS_HTM,		1 },
   { "htm-nosc",		PPC_FEATURE2_HTM_NOSC,		1 },
+  { "htm-no-suspend",	PPC_FEATURE2_HTM_NO_SUSPEND,	1 },
   { "isel",		PPC_FEATURE2_HAS_ISEL,		1 },
   { "tar",		PPC_FEATURE2_HAS_TAR,		1 },
   { "vcrypto",		PPC_FEATURE2_HAS_VEC_CRYPTO,	1 },
Index: gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c	(revision 254453)
+++ gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c	(working copy)
@@ -73,6 +73,7 @@ use_cpu_supports_builtins (unsigned int
   p[37] = __builtin_cpu_supports ("vsx");
   p[38] = __builtin_cpu_supports ("darn");
   p[39] = __builtin_cpu_supports ("scv");
+  p[40] = __builtin_cpu_supports ("htm-no-suspend");
 #else
   p[0] = 0;
 #endif



More information about the Gcc-patches mailing list