[PATCH] Add fma support to the middle end and powerpc
Michael Meissner
meissner@linux.vnet.ibm.com
Thu Oct 14 19:03:00 GMT 2010
On Thu, Oct 14, 2010 at 07:57:50AM -0700, Richard Henderson wrote:
> On 10/13/2010 02:32 PM, Michael Meissner wrote:
> > Since the rs6000 is the only port (so far) that provides fma and fmaf, it was
> > simpler to define the macros in the backend, rather than come up with some
> > callback mechanism where either c-cppbuiltin calls the rtl layer to ask if it
> > has fma, or the rtl layer uses a target hook to define the macros if the
> > preprocessor is loaded.
>
> That's a bit short sighted. There's plenty of ports that already have
> fma instructions in their machine description. Within the week I would
> expect most of them to have been converted to your new interface.
It was more, fma is a minor issue compared to some of the other work I'm trying
to get to right now, and the minor issue of getting the defines seems to be a
rathole.
> Frankly I don't see what's so holy about c-cppbuiltin that it can't
> have access to tm.h.
I dunno, there seemed to be a desire to remove the rtl stuff from the front
ends.
> > +;; Fused multiply add. By default expand the FMA into (plus (mult)) to help
> > +;; loop unrolling.
>
> Er.. Really? What does loop unrolling care?
The problem comes in analyze_insn_to_expand_var inside of loop-unroll.c, which
has this comment:
/* Determine whether INSN contains an accumulator
which can be expanded into separate copies,
one for each copy of the LOOP body.
for (i = 0 ; i < n; i++)
sum += a[i];
==>
sum += a[i]
....
i = i+1;
sum1 += a[i]
....
i = i+1
sum2 += a[i];
....
Return NULL if INSN contains no opportunity for expansion of accumulator.
Otherwise, allocate a VAR_TO_EXPAND structure, fill it with the relevant
information and return a pointer to it.
*/
One of the altivec tests that encodes the vector fma builtin fails, becuase it
isn't unrolled.
--
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com
More information about the Gcc-patches
mailing list