[newbie] intrinsics comparison

From: whisper (spamtrap_at_crayne.org)
Date: 03/08/05


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.



Relevant Pages

  • Re: fastest sorted list type?
    ... I'm not aware of any scenario you've mentioned in which what you're sorting is "just an int". ... Yes, you have a scenario in which you are sorting a list of ints, but when you actually compare two entries in that list you aren't comparing the integers themselves, but rather the data in an object to which the int refers. ... I did have a look on google and wiki lists al the sort algorothms nicely, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: why, hello boys and girls
    ... to do is supply the 'decompress' function, compile, and then publish ... typedef int boolean; ... int usage(const char* exe_file, const char* message) ... if(!compare) ...
    (comp.compression)
  • Re: calling qsort
    ... int mycmp(const void *a, const void *b) ... the compare function. ...
    (comp.lang.c)
  • Re: Rolling Up Characters = Skewing the Game?
    ... I want a basis to compare die rolls systems ... I need point values for ability scores ... point values below 3 and above 18 to compare them. ... is still some detriment to having a 3 int fighter as opposed to an 8 ...
    (rec.games.frp.dnd)
  • Re: Is the following code OK?
    ... I have to compare an address of structure with an absolute address. ... int main ... First, as you suspect, it is not possible to compare a pointer ... integer to a pointer by writing (struct t*)0x120000, ...
    (comp.lang.c)