This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: unfused fma question
- From: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- To: Steve Ellcey <Steve dot Ellcey at imgtec dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sun, 22 Feb 2015 18:30:32 +0000
- Subject: RE: unfused fma question
- Authentication-results: sourceware.org; auth=none
- References: <02d0fee7-2c86-4291-8405-ae250d3210d9 at BAMAIL02 dot ba dot imgtec dot org>
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