[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse4_1-pminsb.c
blob533e2bc089cbabe1ddc110e0774bbe486a460b97
1 /* { dg-do run } */
2 /* { dg-require-effective-target vsx_hw } */
3 /* { dg-options "-O2 -mvsx" } */
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 1024
19 static void
20 TEST (void)
22 union
24 __m128i x[NUM / 16];
25 signed char i[NUM];
26 } dst, src1, src2;
27 int i, sign = 1;
28 signed char min;
30 for (i = 0; i < NUM; i++)
32 src1.i[i] = i * i * sign;
33 src2.i[i] = (i + 20) * sign;
34 sign = -sign;
37 for (i = 0; i < NUM; i += 16)
38 dst.x[i / 16] = _mm_min_epi8 (src1.x[i / 16], src2.x[i / 16]);
40 for (i = 0; i < NUM; i++)
42 min = src1.i[i] >= src2.i[i] ? src2.i[i] : src1.i[i];
43 if (min != dst.i[i])
44 abort ();