What is the best/fastest way to load a 64-bit integer value in an xmm
SSE2 register in 32-bit mode?
In 64-bit mode, cvtsi2sd
can be used, but in 32-bit mode, it supports only 32-bit integers.
So far I haven't found much beyond:
- use
fild
,fstp
to stack thenmovsd
toxmm
register - load the high 32-bit portion, multiply by 2^32, add the low 32-bit
First solution is slow, second solution might introduce precision loss (edit: and it is slow anyway, since the low 32 bit have to be converted as unsigned...)
Any better approach?