News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

DWORD to double or float using SIMD instructions

Started by jj2007, July 25, 2023, 07:24:43 PM

Previous topic - Next topic

jj2007

DWORD to REAL8:
CVTSI2SD--Convert Signed Doubleword Integer to Scalar Double-Precision Floating-Point Value
CVTDQ2PD--Convert Packed Signed Doubleword Integers to Packed Double-Precision Floating-Point Values
CVTPI2PD--Convert Packed Doubleword Integers to Packed Double-Precision Floating-Point Values

DWORD to REAL4:
CVTSI2SS--Convert Signed Doubleword Integer to Scalar Single-Precision Floating-Point Value
CVTDQ2PS--Convert Packed Signed Doubleword Integers to Packed Single-Precision Floating-Point Values
CVTPI2PS--Convert Packed Doubleword Integers to Packed Single-Precision Floating-Point Values

Two remarks:
- #3 & #6 do not specify signed integers, but the instruction treats the source operand as signed
- source operand for #3 & #6 are mm registers or a mm64 memory location, i.e. two DWORDs in memory; some (older?) documentation says that the FPU is affected (slow, see EMMS), but Cloutier specifies "For operands xmm, m64: the instruction does not cause a transition to MMX technology and does not take x87 FPU exceptions."