[PATCH] arm: Add ARM VFPv4 VFMA instruction support in fma/fmaf (BZ 15503)

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Fri Oct 31 18:16:02 GMT 2025



On 30/10/25 14:10, Joseph Myers wrote:
> On Thu, 30 Oct 2025, Adhemerval Zanella Netto wrote:
> 
>> It is also on my backlog to check if we can consolidate all the generic double
>> fma implementation on only one.  Current we have:
>>
>>   sysdeps/ieee754/dbl-64/s_fma.c
>>   sysdeps/ieee754/ldbl-96/s_fma.c 
>>   sysdeps/ieee754/ldbl-128/s_fma.c
>>   sysdeps/ieee754/soft-fp/s_fma.c
>>   
>> All but the sofp-fp uses the floating-point exceptions to change rounding and
>> check for exceptions. I think the soft-fp would most likely be a better
>> default even for ldbl-96/ldbl-128.
> 
> We don't have sfp-machine.h with support for hardware exceptions / 
> rounding modes on all architectures that have such exceptions and rounding 
> modes, which is required to use the soft-fp fma implementation for such an 
> architecture.  (Likewise for the narrowing functions that also have 
> sysdeps/ieee754/soft-fp/ implementations and a default implementation 
> using round-to-odd that relies on changing the hardware rounding mode and 
> reading hardware exception flags - in both cases I don't know how to 
> performance of the two approaches compares.  Though I suspect that the 
> ldbl-128 implementation of (double) fma is very unlikely to be the best 
> approach in those cases where ldbl-128 itself is implemented based on 
> soft-fp.)
> 

I was thinking it in using as a skeleton and add the required exceptions
handling (and not use the current soft-fp macros).  The idea is to use i
nteger operations instead of the quite complex and slow generic 
implementation that requires exception and rounding change that has 
really bad performance.


More information about the Libc-alpha mailing list