[PATCH] RFC for patch to add C99 fma/fmaf/fmal builtins

Michael Meissner meissner@linux.vnet.ibm.com
Tue Oct 5 22:29:00 GMT 2010


On Tue, Oct 05, 2010 at 09:35:40AM -0700, Richard Henderson wrote:
> On 10/05/2010 07:58 AM, Michael Meissner wrote:
> > Even though there is no current builtin, I can add all 4 FMA ops that are
> > provided:
> > 
> > 	FMA	(a * b) + c
> > 	FMS	(a * b) - c
> > 	NFMA	-((a * b) + c)
> > 	NFMS	-((a * b) - c)
> > 
> > At the moment, I will just add a FMA rtl op, but I am open to providing the
> > others (having the others would allow me to remove a few unspecs for the ppc
> > specific builtins, but since the unspecs already exist, it is more of a nice to
> > have).
> 
> The others are properly representable in rtl with only the fma op.
> 
>   (set opR (fma opA opB (neg opC)))		;; FMS
>   (set opR (neg (fma opA opB opC)))		;; NFMA
>   (set opR (neg (fma (opA opB (neg opC)))	;; NFMS
> 
> 
> Unless you're saying that the incorrect sign of -0.0 is related to
> one of the above?  You compared signs vs native operations and
> contraction, I want to compare signs vs __builtin_fma.  E.g.
> 
>   r = - __builtin_fma (a, b, -c);

No, I think I mispoke on the last test.  I think I dropped a n, and was
comparing NMADD in one case to MADD.

-- 
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