Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / sse4_1-pminud.c
blob9daffc07062c7e37d12bcbc781e30d1b83c5ca3b
1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #ifndef CHECK_H
6 #define CHECK_H "sse4_1-check.h"
7 #endif
9 #ifndef TEST
10 #define TEST sse4_1_test
11 #endif
13 #include CHECK_H
15 #include <smmintrin.h>
17 #define NUM 64
19 static void
20 TEST (void)
22 union
24 __m128i x[NUM / 4];
25 unsigned int i[NUM];
26 } dst, src1, src2;
27 int i;
28 unsigned int min;
30 for (i = 0; i < NUM; i++)
32 src1.i[i] = i * i;
33 src2.i[i] = i + 20;
34 if ((i % 4))
35 src2.i[i] |= 0x80000000;
38 for (i = 0; i < NUM; i += 4)
39 dst.x[i / 4] = _mm_min_epu32 (src1.x[i / 4], src2.x[i / 4]);
41 for (i = 0; i < NUM; i++)
43 min = src1.i[i] >= src2.i[i] ? src2.i[i] : src1.i[i];
44 if (min != dst.i[i])
45 abort ();