[PATCH 11/11] math: Use tanf from CORE-MATH

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Tue Nov 12 17:42:31 GMT 2024



On 11/11/24 21:23, Joseph Myers wrote:
> On Mon, 11 Nov 2024, Adhemerval Zanella wrote:
> 
>> +#ifdef __SIZEOF_INT128__
>> +typedef unsigned __int128 u128;
>> +# define u128_high(__x)         (uint64_t)((__x) >> 64)
>> +# define u128_low(__x)          (uint64_t)(__x)
>> +# define u128_from_u64(__x)     (u128)(__x)
>> +# define u128_mul(__x, __y)     (__x) * (__y)
>> +# define u128_add(__x, __y)     (__x) + (__y)
>> +# define u128_lshift(__x, __y)  (__x) << (__y)
>> +# define u128_rshift(__x, __y)  (__x) >> (__y)
>> +#else
>> +typedef struct
> 
> I'd suggest also having an option for the case of defined 
> __BITINT_MAXWIDTH__ && __BITINT_MAXWIDTH__ >= 128, that uses unsigned 
> _BitInt (128) in that case (and would look essentially like the unsigned 
> __int128 case).  (You can test that with GCC 14 or later on 32-bit x86.)
> 

Sounds reasonable, I checked on some others ABIs and seems that not
everyone that supports _uint128 also support _BitInt (128).


More information about the Libc-alpha mailing list