unfused fma question

Matthew Fortune Matthew.Fortune@imgtec.com
Sun Feb 22 18:30:00 GMT 2015


Steve Ellcey <Steve.Ellcey@imgtec.com> writes:
> Or one could change convert_mult_to_fma to add a check if fma is fused
> vs. non-fused in addition to the check for the flag_fp_contract_mode
> in order to decide whether to convert expressions into an fma and then
> define fma instructions in the md file.

I was about to say that I see no reason to change how non-fused multiply
adds work i.e. leave them to pattern matching but I think your point was
that when both fused and non-fused patterns are available then what
should we do. 

> I was wondering if anyone had an opinion about the advantages or
> disadvantages of these two approaches.

I expect that fused multiply adds are almost always faster in hardware
owing to the lack of rounding so using them eagerly, when fp-contract
allows, may still be best even if non-fused alternatives are available.
That depends on the relative cost of the two alternatives though.

Matthew



More information about the Gcc mailing list