On Friday, 10 January 2020 at 00:02:52 UTC, Johan wrote:
For LDC:
[...]
Simpler variant:
```
import ldc.intrinsics;
...
const result = llvm_fma(a, b, c);
```
This LLVM intrinsic is also used in LDC's Phobos for
std.math.fma(); unfortunately, upstream Phobos just has a
`real`-version, so the
On Friday, 10 January 2020 at 00:08:44 UTC, Johan wrote:
On Friday, 10 January 2020 at 00:02:52 UTC, Johan wrote:
[...]
You have to tell LDC that you are compiling for a CPU that has
FMA capability (otherwise it will insert a call to a "fma"
runtime library function that most likely you are
On Friday, 10 January 2020 at 00:02:52 UTC, Johan wrote:
For LDC:
```
double fma(double a, double b, double c)
{
import ldc.llvmasm;
return __irEx!(
`declare double @llvm.fma.f64(double %a, double
%b, double %c)`,
`%r = call double @llvm.fma.f64(double %0, doub
On Thursday, 9 January 2020 at 22:50:37 UTC, Ben Jones wrote:
On Thursday, 9 January 2020 at 20:57:10 UTC, Ben Jones wrote:
What's the easiest way to use the FMA instruction (fused
multiply add that has nice rounding properties)? The FMA
function in Phobos just does a*b +c which will round tw
On Thursday, 9 January 2020 at 20:57:10 UTC, Ben Jones wrote:
What's the easiest way to use the FMA instruction (fused
multiply add that has nice rounding properties)? The FMA
function in Phobos just does a*b +c which will round twice.
Do any of the intrinsics libraries include this? Should
What's the easiest way to use the FMA instruction (fused multiply
add that has nice rounding properties)? The FMA function in
Phobos just does a*b +c which will round twice.
Do any of the intrinsics libraries include this? Should I write
my own inline ASM?