This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [RFC] [Patch X86_64]: Pass to split FMA to MUL and ADD
- From: "Kumar, Venkataramanan" <Venkataramanan dot Kumar at amd dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "Dharmakan, Rohit arul raj" <Rohitarulraj dot Dharmakan at amd dot com>, "Jan Hubicka (hubicka at ucw dot cz)" <hubicka at ucw dot cz>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Tue, 7 Nov 2017 07:48:07 +0000
- Subject: RE: [RFC] [Patch X86_64]: Pass to split FMA to MUL and ADD
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Venkataramanan dot Kumar at amd dot com;
- References: <CY4PR12MB173625509B98E82B0133B39C8F510@CY4PR12MB1736.namprd12.prod.outlook.com> <alpine.DEB.2.20.1711070818330.6994@stedding.saclay.inria.fr>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi Maarc,
> -----Original Message-----
> From: Marc Glisse [mailto:marc.glisse@inria.fr]
> Sent: Tuesday, November 7, 2017 12:52 PM
> To: Kumar, Venkataramanan <Venkataramanan.Kumar@amd.com>
> Cc: gcc-patches@gcc.gnu.org; Dharmakan, Rohit arul raj
> <Rohitarulraj.Dharmakan@amd.com>; Jan Hubicka (hubicka@ucw.cz)
> <hubicka@ucw.cz>; Uros Bizjak <ubizjak@gmail.com>
> Subject: Re: [RFC] [Patch X86_64]: Pass to split FMA to MUL and ADD
>
> On Tue, 7 Nov 2017, Kumar, Venkataramanan wrote:
>
> > The attached patch implements an RTL pass which splits generated FMA
> instruction into MUL/ADD sequence.
>
> That seems wrong if the user explicitly asked for FMA in his program, unless
> you have a way to recognize which FMA instructions come from user calls to
> fma and which were invented by gcc. Why not disable the gimple
> transformation that creates FMA instead ?
We split only for reduction pattern and not all FMAs.
By user calls do you mean FMA in inline ASM calls? We don't split in that case.
> That seems wrong if the user explicitly asked for FMA in his program
Do you mean using function attribute or command line option?
Doing in Gimple would be more generic.
This implementation is profitable only for few sub-targets of x86 where latency of floating point ADD is less than that of FMA (ex Zen).
>
> > * doc/invoke.texi (SPARC Options): Document -msplit-fma.
>
> Sparc really?
Sorry I copied from a change log and forgot to remove it. Thanks for pointing that.
>
> --
> Marc Glisse
Regards,
Venkat.