Question

I just noticed that there is a _mm_cvtsd_si64 and a _mm_cvtsd_si64x intrinsic in the SSE2 instruction set. According to the intel intrinsics guide, both do exactly the same. So where is the difference, or, if there is none, why are there two identical intrinsics?

This is only an example, there are more intrinsics with an si64 and an si64x version which seem to do the same.

Was it helpful?

Solution

It's probably historical, going back to the early days of MMX/SSE and probably some discrepancies between different sets of intrinsics.

Note that even now some intrinsics have 64 and 64x versions because they take different argument types, even though they do the same thing, e.g.

__m128i _mm_set1_epi64x (__int64 a)

and

__m128i _mm_set1_epi64 (__m64 a)

OTHER TIPS

The two are not the same. __m64 is MMX register and MMX is deprecated on x86_64. The MMX registers share the register file with x87 and the operating systems don't preserve these between context switches on x86_64. MMX is still possible to use in 32 bit processes, of course. __int64 is Microsoft's typedef for 64 bit signed integer ALU registers (emulated in 32 bit mode). The 64x form is preferred on 64 bit programs because of these reasons.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top