From Intel’s article:
The integer format conversions are commonly used in imaging and video applications. For example, they can be used when converting RGBA from four bytes to four floats prior to computation on a pixel. One SSE4 convert instruction can do the same thing as four SIMD instructions did previously, as shown.
SSE2:
pmovd xmm0, m32
pxor xmm7, xmm7
punpcklbw xmm0, xmm7
punpcklwd xmm0, xmm7
cvtdq2ps xmm0, xmm0
SSE4:
pmovzxbd xmm0, m32
cvtdq2ps xmm0, xmm0
Can someone show me a complete example please? Thanks a lot!
Because
pmovzxbddoes only work on 32 bit memory operands or 128 bit sse registers, but not on general purpose registers, you need to insert some type conversions or an explicit load from GPR to SSE.