[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-psrlw-1.c
blobaabec7161cecfd3b1c0792bff38b892db150670b
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mvsx -Wno-psabi" } */
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 "sse2-check.h"
8 #endif
10 #include CHECK_H
12 #ifndef TEST
13 #define TEST sse2_test_psrlw_1
14 #endif
16 #define N 0xb
18 #include <emmintrin.h>
20 static __m128i
21 __attribute__((noinline, unused))
22 test (__m128i s1)
24 return _mm_srli_epi16 (s1, N);
27 static void
28 TEST (void)
30 union128i_w u, s;
31 short e[8] = {0};
32 unsigned short tmp;
33 int i;
35 s.x = _mm_set_epi16 (1, -2, 3, -4, 5, 6, 0x7000, 0x9000);
37 u.x = test (s.x);
39 if (N < 16)
40 for (i = 0; i < 8; i++)
42 tmp = s.a[i];
43 e[i] = tmp >> N;
46 if (check_union128i_w (u, e))
47 abort ();