[PATCHv2] powerpc: define USE_FMAF128_BUILTIN in math-use-builtins.h

Paul E Murphy murphyp@linux.ibm.com
Thu Jun 4 16:19:00 GMT 2020



On 6/4/20 9:03 AM, Adhemerval Zanella via Libc-alpha wrote:
> 
> 
> On 04/06/2020 10:56, Paul E. Murphy via Libc-alpha wrote:
>> Removed defined in macro expansion.  Verified again.  Thank you for
>> pointing out the macro expansion nuance of defined Andreas.
>>
>> ---8<---
>>
>> Commit a7a3435c9a0769744c7748f9d95510d0a99be7d1 caused an undefined
>> macro evaluation error when building powerpc64le.  This defines the
>> macro such that it should behave correctly on all supported powerpc64le
>> targets.  Likewise, this allows us to remove the ppc64le specific
>> s_fmaf128.c for power9.
>>
>> powerpc{,64} will not support FMA using the ibm128 long double, so
>> it can be left undefined for now to avoid ambiguity with ppc64le.
>>
>> I have verified powerpc64le multiarch and powerpc64le power9
>> no-multiarch builds continue to generate optimize fmaf128.
>> ---
>>   sysdeps/powerpc/fpu/math-use-builtins.h       |  7 ++++
>>   .../le/fpu/multiarch/s_fmaf128-power9.c       |  4 ++-
>>   .../powerpc64/le/power9/fpu/s_fmaf128.c       | 36 -------------------
>>   3 files changed, 10 insertions(+), 37 deletions(-)
>>   delete mode 100644 sysdeps/powerpc/powerpc64/le/power9/fpu/s_fmaf128.c
>>
>> diff --git a/sysdeps/powerpc/fpu/math-use-builtins.h b/sysdeps/powerpc/fpu/math-use-builtins.h
>> index 4780934379..9b1cdfc4c8 100644
>> --- a/sysdeps/powerpc/fpu/math-use-builtins.h
>> +++ b/sysdeps/powerpc/fpu/math-use-builtins.h
>> @@ -66,4 +66,11 @@
>>   #define USE_FMA_BUILTIN 1
>>   #define USE_FMAF_BUILTIN 1
>>   
>> +/*  This is not available for P8 or BE targets.  */
>> +#if defined (__FP_FAST_FMAF128) && __FP_FAST_FMAF128 == 1
>> +# define USE_FMAF128_BUILTIN 1
>> +#else
>> +# define USE_FMAF128_BUILTIN 0
>> +#endif
> 
> Why do you need to test for __FP_FAST_FMAF128 value? My understand
> from gcc documentation is it will be set iff the backend supports
> lowering the operation. Is there configuration where gcc might
> define and sets its value to 0?

Maybe not, this may be needlessly pedantic.  Anyhow, I think you've 
mitigated the build error.  Attached is a V3.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-powerpc64le-use-common-fmaf128-implementation.patch
Type: text/x-patch
Size: 3791 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20200604/c9eee8f9/attachment.bin>


More information about the Libc-alpha mailing list