[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse4_1-pmovzxbw.c
blob8be531fca880d60371e8ed44bbd9093b7183fdbf
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 128
19 static void
20 TEST (void)
22 union
24 __m128i x[NUM / 8];
25 unsigned short s[NUM];
26 unsigned char c[NUM * 2];
27 } dst, src;
28 int i;
30 for (i = 0; i < NUM; i++)
32 src.c[(i % 8) + (i / 8) * 16] = i * i;
33 if ((i % 4))
34 src.c[(i % 8) + (i / 8) * 16] |= 0x80;
37 for (i = 0; i < NUM; i += 8)
38 dst.x [i / 8] = _mm_cvtepu8_epi16 (src.x [i / 8]);
40 for (i = 0; i < NUM; i++)
41 if (src.c[(i % 8) + (i / 8) * 16] != dst.s[i])
42 abort ();