Is sorted using SIMD instructions
David Bennett
davidbennett at bravevision.com
Fri Apr 13 05:20:46 UTC 2018
On Thursday, 12 April 2018 at 10:14:55 UTC, rikki cattermole
wrote:
>
> Just checked, change int to float and it uses ucomiss (SIMD,
> ldc -O3).
>
> There may not be an instruction for int's.
Yep logic is much easier with floats and is available on SSE.
It's hard to do logic on ints until SSE4.1 as theres no easy way
to jump.
(With SSE I think it would require putting the result on the
stack and checking it for zeros using 64bit regs)
Even with SSE4.1 it requires at lest one extra instruction as
only PTEST sets flags.
That said, is it possible to get the result of PTEST as a bool
using core.simd? I was wondering if it would be possible write
the example using that.
Normally I just write simple functions like this in yasm and link
them in extern(C).
More information about the Digitalmars-d
mailing list