public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit
@ 2017-11-06 18:02 Peter Bergner
  2017-11-06 22:56 ` Segher Boessenkool
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Bergner @ 2017-11-06 18:02 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, Tulio Magno Quites Machado Filho

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit
  2017-11-06 18:02 [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit Peter Bergner
@ 2017-11-06 22:56 ` Segher Boessenkool
  2017-11-06 23:11   ` Peter Bergner
  0 siblings, 1 reply; 7+ messages in thread
From: Segher Boessenkool @ 2017-11-06 22:56 UTC (permalink / raw)
  To: Peter Bergner; +Cc: GCC Patches, Tulio Magno Quites Machado Filho

Hi!

On Mon, Nov 06, 2017 at 11:41:39AM -0600, Peter Bergner wrote:
> 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.

> --- 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 },

Is this (user-visible) name the same as used elsewhere?  Kernel, libc?

It's not in the same style as "htm-nosc".

If it is the same: okay for trunk, and all open branches.  Thanks!


Segher

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit
  2017-11-06 22:56 ` Segher Boessenkool
@ 2017-11-06 23:11   ` Peter Bergner
  2017-11-06 23:12     ` Segher Boessenkool
  2017-11-07 13:42     ` Tulio Magno Quites Machado Filho
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Bergner @ 2017-11-06 23:11 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches, Tulio Magno Quites Machado Filho

On 11/6/17 4:52 PM, Segher Boessenkool wrote:
> Hi!
> 
> On Mon, Nov 06, 2017 at 11:41:39AM -0600, Peter Bergner wrote:
>> 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.
> 
>> --- 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 },
> 
> Is this (user-visible) name the same as used elsewhere?  Kernel, libc?
> 
> It's not in the same style as "htm-nosc".

Tulio can correct me if I'm wrong, but I believe these stings are
owned by GLIBC.  The kernel just defines the macro name and bit mask
that is used in the AUXV.  That said, I'm not sure the GLIBC patch
adding the above string has been submitted yet, so I guess we could
change it still?  Tulio?

That said, I'm not sure I like "htm-nosuspend" better than what the
patch has, but then again, I don't care enough to argue. :-)

Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit
  2017-11-06 23:11   ` Peter Bergner
@ 2017-11-06 23:12     ` Segher Boessenkool
  2017-11-07 13:42     ` Tulio Magno Quites Machado Filho
  1 sibling, 0 replies; 7+ messages in thread
From: Segher Boessenkool @ 2017-11-06 23:12 UTC (permalink / raw)
  To: Peter Bergner; +Cc: GCC Patches, Tulio Magno Quites Machado Filho

On Mon, Nov 06, 2017 at 05:07:23PM -0600, Peter Bergner wrote:
> >> --- 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 },
> > 
> > Is this (user-visible) name the same as used elsewhere?  Kernel, libc?
> > 
> > It's not in the same style as "htm-nosc".
> 
> Tulio can correct me if I'm wrong, but I believe these stings are
> owned by GLIBC.  The kernel just defines the macro name and bit mask
> that is used in the AUXV.  That said, I'm not sure the GLIBC patch
> adding the above string has been submitted yet, so I guess we could
> change it still?  Tulio?
> 
> That said, I'm not sure I like "htm-nosuspend" better than what the
> patch has, but then again, I don't care enough to argue. :-)

Oh no, don't get me wrong, I like the "htm-no-suspend" name just fine;
the important thing is everything uses the same name.


Segher

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit
  2017-11-06 23:11   ` Peter Bergner
  2017-11-06 23:12     ` Segher Boessenkool
@ 2017-11-07 13:42     ` Tulio Magno Quites Machado Filho
  2017-11-07 17:09       ` Peter Bergner
  1 sibling, 1 reply; 7+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2017-11-07 13:42 UTC (permalink / raw)
  To: Peter Bergner, Segher Boessenkool; +Cc: GCC Patches

Peter Bergner <bergner@vnet.ibm.com> writes:

> On 11/6/17 4:52 PM, Segher Boessenkool wrote:
>> Hi!
>> 
>> On Mon, Nov 06, 2017 at 11:41:39AM -0600, Peter Bergner wrote:
>>> 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.
>> 
>>> --- 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 },
>> 
>> Is this (user-visible) name the same as used elsewhere?  Kernel, libc?
>> 
>> It's not in the same style as "htm-nosc".
>
> Tulio can correct me if I'm wrong, but I believe these stings are
> owned by GLIBC.  The kernel just defines the macro name and bit mask
> that is used in the AUXV.  That said, I'm not sure the GLIBC patch
> adding the above string has been submitted yet, so I guess we could
> change it still?  Tulio?

That's the same string adopted in glibc. [1]
PPC_FEATURE2_HTM_NO_SUSPEND is also user-visible in glibc as a macro and is
identical too.

Notice this has not been merged into Linus Torvalds' tree yet and the glibc
patch is also waiting.  You may want to wait a little bit more too.

[1] https://sourceware.org/ml/libc-alpha/2017-10/msg00867.html

-- 
Tulio Magno

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit
  2017-11-07 13:42     ` Tulio Magno Quites Machado Filho
@ 2017-11-07 17:09       ` Peter Bergner
  2017-12-15  3:52         ` Peter Bergner
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Bergner @ 2017-11-07 17:09 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho; +Cc: Segher Boessenkool, GCC Patches

On 11/7/17 7:12 AM, Tulio Magno Quites Machado Filho wrote:
> That's the same string adopted in glibc. [1]
> PPC_FEATURE2_HTM_NO_SUSPEND is also user-visible in glibc as a macro and is
> identical too.
> 
> Notice this has not been merged into Linus Torvalds' tree yet and the glibc
> patch is also waiting.  You may want to wait a little bit more too.
> 
> [1] https://sourceware.org/ml/libc-alpha/2017-10/msg00867.html

Ok, I'll hold off until you push your changes.  Can you please ping
me when you finally commit your patch?  Thanks.

Peter


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit
  2017-11-07 17:09       ` Peter Bergner
@ 2017-12-15  3:52         ` Peter Bergner
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Bergner @ 2017-12-15  3:52 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho; +Cc: Segher Boessenkool, GCC Patches

On 11/7/17 11:05 AM, Peter Bergner wrote:
> On 11/7/17 7:12 AM, Tulio Magno Quites Machado Filho wrote:
>> That's the same string adopted in glibc. [1]
>> PPC_FEATURE2_HTM_NO_SUSPEND is also user-visible in glibc as a macro and is
>> identical too.
>>
>> Notice this has not been merged into Linus Torvalds' tree yet and the glibc
>> patch is also waiting.  You may want to wait a little bit more too.
>>
>> [1] https://sourceware.org/ml/libc-alpha/2017-10/msg00867.html
> 
> Ok, I'll hold off until you push your changes.  Can you please ping
> me when you finally commit your patch?  Thanks.

So the patches landed in Linus' tree and glibc, therefore I committed
these now to trunk and the open release branches.

Peter


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-12-15  3:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 18:02 [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit Peter Bergner
2017-11-06 22:56 ` Segher Boessenkool
2017-11-06 23:11   ` Peter Bergner
2017-11-06 23:12     ` Segher Boessenkool
2017-11-07 13:42     ` Tulio Magno Quites Machado Filho
2017-11-07 17:09       ` Peter Bergner
2017-12-15  3:52         ` Peter Bergner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).