February 09, 2019
On Saturday, 9 February 2019 at 15:14:47 UTC, NaN wrote:
> On Saturday, 9 February 2019 at 03:28:41 UTC, Basile B. wrote:
>>> [...]
>
>>   [...]
>
> What flags are you passing LDC? I cant get it to convert the division into a multiply by it's inverse unless i specifically change /3.142f to /(1.0f/3.142f).
>
> and FWIW im using...
>
> float fabs(float x) // need cause math.fabs not being inlined
> {
>     uint tmp = *(cast(int*)&x) & 0x7fffffff;
>     float f = *(cast(float*) &tmp);
>     return f;
> }
>
> that compiles down to a single "andps" instruction and is inlined if it's in the same module. I tried cross module inlining as suggested in the LDC forum but it caused my program to hang.

Oh sorry, I got the inverse multiply manually.
I was more focused on the x87 instruction than the last part of the Q.
1 2
Next ›   Last »