[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse4_1-pcmpeqq.c
blob8d1f27177d9bae56b91211188987872d9971615f
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mvsx" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
4 /* { dg-require-effective-target p8vector_hw } */
6 #ifndef CHECK_H
7 #define CHECK_H "sse4_1-check.h"
8 #endif
10 #ifndef TEST
11 #define TEST sse4_1_test
12 #endif
14 #include CHECK_H
16 #include <smmintrin.h>
18 #define NUM 64
20 static void
21 TEST (void)
23 union
25 __m128i x[NUM / 2];
26 long long ll[NUM];
27 } dst, src1, src2;
28 int i, sign=1;
29 long long is_eq;
31 for (i = 0; i < NUM; i++)
33 src1.ll[i] = i * i * sign;
34 src2.ll[i] = (i + 20) * sign;
35 sign = -sign;
38 for (i = 0; i < NUM; i += 2)
39 dst.x [i / 2] = _mm_cmpeq_epi64(src1.x [i / 2], src2.x [i / 2]);
41 for (i = 0; i < NUM; i++)
43 is_eq = src1.ll[i] == src2.ll[i] ? 0xffffffffffffffffLL : 0LL;
44 if (is_eq != dst.ll[i])
45 abort ();