[newbie] intrinsics comparison
From: whisper (spamtrap_at_crayne.org)
Date: 03/08/05
- Next message: M. Maniak: "C inline assembler & accessing constants"
- Previous message: Hein Matzon: "Multiple lines comments in Nasm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 8 Mar 2005 19:22:56 +0000 (UTC)
Hello all,
I'm starting with intrinsics and I want to compare 4 integers.
My idea is to do the following:
// Just the first integers are of interest
__m128i mask = _mm_set_epi32(0xFF, 0xFF, 0xFF, 0x00);
//loop:
__m128i comp = _mm_set1_epi32((int)i); // loop variable
__m128i fourInt = _mm_loadu_si128((__m128i*)&pFaces); // load values
// compare and filter first 3 int.
__m128i result = _mm_and_si128(_mm_cmpeq_epi32(fourInt,comp), mask);
Now, if any of the integers in result is diferent than 0, I want to do
something, but I can't just do if (result) do something.
if ( ??? ) {
}
How can I make the test ?
wpr.
- Next message: M. Maniak: "C inline assembler & accessing constants"
- Previous message: Hein Matzon: "Multiple lines comments in Nasm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|