[LLVMdev] Documentation of fmuladd intrinsic

Owen Anderson resistor at mac.com
Fri Jan 11 13:03:51 PST 2013

On Jan 11, 2013, at 11:47 AM, Justin Holewinski <justin.holewinski at gmail.com> wrote:

> Out of curiosity, what is the use-case for isFMAFasterThanMulAndAdd?  If a target declares that FMA is actually slower for a given type, why not just declare it as illegal for that type?  Wouldn't that accomplish the same thing without another target hook?  I feel like I'm missing something here.

FMA is not semantically equivalent to fmul+fadd.  If the user called the fma() libm function, we're obligated to translate that into an actual FMA instruction (or a libcall).  If they were fmul+fadd with FP_CONTRACT turned on, we're allowed to generate an FMA, but we don't want to if it will be slower than just doing the fmul+fadd.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130111/c66474f3/attachment.html>

More information about the llvm-dev mailing list