This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64


Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
> On 10/19/2017 06:37 AM, Richard Earnshaw (lists) wrote:
>> On 19/10/17 14:07, Wilco Dijkstra wrote:
>>> Vladimir wrote:
>>>
>>> +# Disable floating-point expression contraction
>>> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
>>> +
>>>
>>> It looks like this disables fp-contract in all of libgcc...
>>> What is the the number of FMAs in libgcc before/after?
>
>   How can I find this number ?
> dis <all functions in libgcc> | grep <all FMAs> | wc

Eg. objdump -d ~/install/gcc/lib64/libgcc_s.so | grep -c fmadd
Also grep fmsub, fnmadd, fnmsub.

> > It's probably better to do this with an attribute
> >
> >        __attribute__((optimize("fp-contract=off")))
> >
> > on the affected functions.
>
>    I like your suggestion.

I don't think this will work in general, IIRC only a few targets correctly
implement the optimize pragma. Changing the makefile to build only
__divdc3/__divtc3/__divsc3/__divhc3 without FMA looks like a better
approach.

However we also need to decide whether this is the best possible fix.
It will affect accuracy of other inputs as well...

Wilco

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]