[llvm-commits] [cfe-commits] [PATCH] Add llvm.fmuladd intrinsic.

Duncan Sands baldrick at free.fr
Wed Jun 6 00:22:01 PDT 2012


Hi,

>> My idea was essentially that you would only do this where contraction was
>> precluded, which you indicated should be rare (1%). That should restrict the
>> amount of start/stop churn?
>>
>> Are you imagining something completely different?
>
> Contraction is precluded across expression boundaries in the standard C numerics
> model. Assuming we want to support standard C numerics, you would need to insert
> start/stop for every expression containing FP.
>
> You would actually get to avoid this precisely in the 1% case; if FMA formation
> is forbidden outright, you only need a single stop.
>
> The "fast math" mode (greedy FMA formation) would only require a single start
> (or nothing at all), but that mode doesn't conform to C (or C++, as far as I
> know), and shouldn't be the default mode.

this seems fairly analogous to the problem of how to signal that reassociation
of floating point operations is OK.  The problem there is that, by its nature,
reassociation involves at least two floating point operations, eg a+(b+c), so
should reassociation be allowed when only one of the operations is marked "may
reassociate", or both, or some other possibility?  I bring this up since it
seems to involve similar issues to the "not allowed to cross expression
boundaries" property that you've been discussing.

Ciao, Duncan.



More information about the llvm-commits mailing list