This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH] implement fma() as builtin x87 or SSE intrinsic


Falk Hueffner wrote:

This RFC patch implements fma() function as builtin x87 or SSE
intrinsic.



It seems fma simply does x * y + z. Wouldn't it be more sensible to
expand this in some machine-independent part and rely on the
machine-depentend part to reassemble it to something sensible? That
would save some code and it could also be picked up if the user really
wrote x * y + z.


Indeed!

Call to __builtin_fma() should be handled as BUILT_IN_FMA{,F,L} optimization in builtins.c, if flag_unsafe_math_optimizations flag is set. This way, call to fma() would be transformed to multiply and add for all architectures.

BTW: BUILT_IN_HYPOT{,F,L} could also be handled this way.

Thanks,
Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]