[PATCH 2/5] Atomic __platform_wait: accept any 32-bit type, not just int

2021-02-26 Thread Thiago Macieira via Gcc-patches
The kernel doesn't care what we store in those 32 bits, only that they are comparable. This commit adds: * pointers and long on 32-bit architectures * unsigned * untyped enums and typed enums on int & unsigned int * float We're not using FUTEX_OP anywhere today. The kernel reserves 4 bits for

Re: [PATCH 2/5] Atomic __platform_wait: accept any 32-bit type, not just int

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 26/02/21 07:59 -0800, Thiago Macieira via Libstdc++ wrote: The kernel doesn't care what we store in those 32 bits, only that they are comparable. This commit adds: * pointers and long on 32-bit architectures * unsigned * untyped enums and typed enums on int & unsigned int * float We're not us

Re: [PATCH 2/5] Atomic __platform_wait: accept any 32-bit type, not just int

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 03/03/21 14:34 +, Jonathan Wakely wrote: On 26/02/21 07:59 -0800, Thiago Macieira via Libstdc++ wrote: The kernel doesn't care what we store in those 32 bits, only that they are comparable. This commit adds: * pointers and long on 32-bit architectures * unsigned * untyped enums and typed

Re: [PATCH 2/5] Atomic __platform_wait: accept any 32-bit type, not just int

2021-03-03 Thread Thiago Macieira via Gcc-patches
On Wednesday, 3 March 2021 08:21:51 PST Jonathan Wakely wrote: > >>- = is_same_v, __platform_wait_t>; > >>+ = is_scalar_v> && sizeof(_Tp) == > >>sizeof(__platform_wait_t) > Oh, except that is_scalar is surprisingly expensive to instantiate > (its defined in a really expensive way) and s

Re: [PATCH 2/5] Atomic __platform_wait: accept any 32-bit type, not just int

2021-03-03 Thread Ville Voutilainen via Gcc-patches
On Wed, 3 Mar 2021 at 19:25, Jonathan Wakely via Libstdc++ wrote: > Oh, except that is_scalar is surprisingly expensive to instantiate > (its defined in a really expensive way) and since we control all uses I'll be more than happy to write you an __is_scalar for GCC 12. :P

Re: [PATCH 2/5] Atomic __platform_wait: accept any 32-bit type, not just int

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 03/03/21 19:34 +0200, Ville Voutilainen wrote: On Wed, 3 Mar 2021 at 19:25, Jonathan Wakely via Libstdc++ wrote: Oh, except that is_scalar is surprisingly expensive to instantiate (its defined in a really expensive way) and since we control all uses I'll be more than happy to write you an