[PATCH v2 13/13] powerpc: Add math-use-builtins-f{max,min}.h

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Feb 2 16:22:05 GMT 2026



On 31/01/26 07:49, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> ISA 2.06 (POWER7) added xsmindp/xsmaxdp.
>>
>> Checked on powerpc64le-linux-gnu.
>> ---
>>  sysdeps/powerpc/fpu/math-use-builtins-fmax.h | 10 ++++++++++
>>  sysdeps/powerpc/fpu/math-use-builtins-fmin.h | 10 ++++++++++
>>  2 files changed, 20 insertions(+)
>>  create mode 100644 sysdeps/powerpc/fpu/math-use-builtins-fmax.h
>>  create mode 100644 sysdeps/powerpc/fpu/math-use-builtins-fmin.h
>>
>> diff --git a/sysdeps/powerpc/fpu/math-use-builtins-fmax.h b/sysdeps/powerpc/fpu/math-use-builtins-fmax.h
>> new file mode 100644
>> index 0000000000..19b49f1928
>> --- /dev/null
>> +++ b/sysdeps/powerpc/fpu/math-use-builtins-fmax.h
>> @@ -0,0 +1,10 @@
>> +#ifdef _ARCH_PWR7
>> +# define USE_FMAX_BUILTIN 1
>> +# define USE_FMAXF_BUILTIN 1
>> +#else
>> +# define USE_FMAX_BUILTIN 0
>> +# define USE_FMAXF_BUILTIN 0
>> +#endif
>> +
>> +#define USE_FMAXL_BUILTIN 0
>> +#define USE_FMAXF128_BUILTIN 0
>> diff --git a/sysdeps/powerpc/fpu/math-use-builtins-fmin.h b/sysdeps/powerpc/fpu/math-use-builtins-fmin.h
>> new file mode 100644
>> index 0000000000..107f36b107
>> --- /dev/null
>> +++ b/sysdeps/powerpc/fpu/math-use-builtins-fmin.h
>> @@ -0,0 +1,10 @@
>> +#ifdef _ARCH_PWR7
>> +# define USE_FMIN_BUILTIN 1
>> +# define USE_FMINF_BUILTIN 1
>> +#else
>> +# define USE_FMIN_BUILTIN 0
>> +# define USE_FMINF_BUILTIN 0
>> +#endif
>> +
>> +#define USE_FMINL_BUILTIN 0
>> +#define USE_FMINF128_BUILTIN 0
> 
> I don't know much about these things, but should this be conditional
> on GCC ≥14?
> 
>   Bug 103605 - [PowerPC] fmin/fmax should be inlined always with
>   xsmindp/xsmaxdp
>   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103605>

Yes, you right.  I will add the required check to enable it only
for gcc-14.


More information about the Libc-alpha mailing list