[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-pshufd-1.c
blobb40ef6ce8103b85064f4f5a535a63045264291be
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_pshufd_1
14 #endif
16 #define N 0xec
18 #include <emmintrin.h>
20 static __m128i
21 __attribute__((noinline, unused))
22 test (__m128i s1)
24 return _mm_shuffle_epi32 (s1, N);
27 static void
28 TEST (void)
30 union128i_d u, s1;
31 int e[4] = { 0 };
32 int i;
34 s1.x = _mm_set_epi32 (16,15,14,13);
35 u.x = test (s1.x);
37 for (i = 0; i < 4; i++)
38 e[i] = s1.a[((N & (0x3<<(2*i)))>>(2*i))];
40 if (check_union128i_d(u, e))
42 #if DEBUG
43 printf ("sse2_test_pshufd_1; check_union128i_d failed\n");
44 printf ("\t ([%x,%x,%x,%x]) -> [%x,%x,%x,%x]\n", s1.a[0], s1.a[1],
45 s1.a[2], s1.a[3], u.a[0], u.a[1], u.a[2], u.a[3]);
46 printf ("\t expect [%x,%x,%x,%x]\n", e[0], e[1], e[2], e[3]);
47 #endif
48 abort ();