How use ldc pragmas?

Imperatorn johan_forsberg_86 at hotmail.com
Fri Oct 1 20:08:27 UTC 2021


On Friday, 1 October 2021 at 19:23:06 UTC, james.p.leblanc wrote:
> D-ers,
>
> After experimenting with ldc's autovectorization of avx code, 
> it appears there may
> be counter-intuitiveness to the autovectorization (especially 
> for complex numbers).
> (My comment may be wrong, so any corrections are quite welcome).
>
> [...]

```d
import std.stdio;
import ldc.intrinsics;

pragma(LDC_intrinsic, "llvm.sqrt.f32") float sqrt(float);

void main()
{
     writeln("hello");

     float x = 42.42;
     writeln(sqrt(x));
}
```


More information about the Digitalmars-d-learn mailing list