Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse4_1-pminuw.c
blobafe2f887f82c011ec70ce9fd99e01d3bc5386a78
1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #include "sse4_1-check.h"
7 #include <smmintrin.h>
9 #define NUM 64
11 static void
12 sse4_1_test (void)
14 union
16 __m128i x[NUM / 8];
17 unsigned short i[NUM];
18 } dst, src1, src2;
19 int i;
20 unsigned short min;
22 for (i = 0; i < NUM; i++)
24 src1.i[i] = i * i;
25 src2.i[i] = i + 20;
26 if ((i % 8))
27 src2.i[i] |= 0x8000;
30 for (i = 0; i < NUM; i += 8)
31 dst.x[i / 8] = _mm_min_epu16 (src1.x[i / 8], src2.x[i / 8]);
33 for (i = 0; i < NUM; i++)
35 min = src1.i[i] >= src2.i[i] ? src2.i[i] : src1.i[i];
36 if (min != dst.i[i])
37 abort ();