Speed kills

Guillaume Piolat via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 16 04:49:37 PST 2016


On Monday, 15 February 2016 at 23:35:54 UTC, Basile B. wrote:
> On Monday, 15 February 2016 at 23:19:44 UTC, Guillaume Piolat 
> wrote:
>>
>> lround and friends have been a big performance problem at 
>> times.
>> Everytime you can use cast(int) instead, it's way faster.
>
> I didn't know this trick. It generates almost the same sse 
> intruction (it truncates) and has the advantage to be 
> inline-able.
>
> Is it documented somewhere ? If not it should.

In SSE3 you also get an instruction that does this without 
messing with the x87 control word: FISTTP.


More information about the Digitalmars-d mailing list