[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-movmskpd-1.c
blobd66874e65b3592434977372d418fcb8aa2cd8fca
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_movmskpd_1
14 #endif
16 #include <emmintrin.h>
18 #ifdef _ARCH_PWR8
19 static int
20 __attribute__((noinline, unused))
21 test (__m128d p)
23 __asm("" : "+v"(p));
24 return _mm_movemask_pd (p);
26 #endif
28 static void
29 TEST (void)
31 #ifdef _ARCH_PWR8
32 double source[2] = {1.234, -2234.23};
33 union128d s1;
34 int d;
35 int e;
37 s1.x = _mm_loadu_pd (source);
39 d = test (s1.x);
41 e = 0;
42 if (source[0] < 0)
43 e |= 1;
45 if (source[1] < 0)
46 e |= 1 << 1;
48 if (checkVi (&d, &e, 1))
50 #if DEBUG
51 printf ("sse2_test_movmskpd_1; check_union128d failed\n");
52 printf ("\t [%f,%f] -> [%d]\n", s1.a[0], s1.a[1], d);
53 printf ("\t expect [%d]\n", e);
54 #endif
55 abort ();
57 #endif