Greets,
SSE defines the following type:
typedef union __declspec(intrin_type) _CRT_ALIGN(16) __m128 {
float m128_f32[4];
unsigned __int64 m128_u64[2];
__int8 m128_i8[16];
__int16 m128_i16[8];
__int32 m128_i32[4];
__int64 m128_i64[2];
unsigned __int8 m128_u8[16];
unsigned __int16 m128_u16[8];
unsigned __int32 m128_u32[4];
} __m128;
SSE2 defines the following type:
typedef union __declspec(intrin_type) _CRT_ALIGN(16) __m128i {
__int8 m128i_i8[16];
__int16 m128i_i16[8];
__int32 m128i_i32[4];
__int64 m128i_i64[2];
unsigned __int8 m128i_u8[16];
unsigned __int16 m128i_u16[8];
unsigned __int32 m128i_u32[4];
unsigned __int64 m128i_u64[2];
} __m128i;
I have two __m128's storing floating point values, but I'd like to do a bitwise compare. This can be done by doing a integer compare. This instruction was added in SSE2, so we are all good so far:
__m128i _mm_cmpeq_epi32 (__m128i a, __m128i b);
But I can't pass a __m128 to this function, it's the wrong type. But both unions have the raw data that I want to compare. How can I reinterpet-cast a __m128i to a __m128, or otherwise compare their integer representations, inexpensively? (I don't want to use any conversion intrinsics, b/c I don't want any rounding or converting -- just reinterpretation.)
Thanks.