19 Apr
2013
19 Apr
'13
11:37 p.m.
On 18/04/13 14:29, Evgeny Panasyuk wrote:
For instance, there is FMA instruction "d=a+b*c" - yes, your proposal have appropriate fma function in <cmath>. But imagine that some new architecture would have "double FMA" instruction like: "f=a+b*c+d*e", or even more complex instruction: "2x2 matrix multiplication".
It is relatively easy for compilers to transform a*b+c to fma(a,b,c) (even if the operations involved are SIMD intrinsics). As a matter of fact, compilers already do it.