Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/sse2-movmskpd-1.c

raw
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 } */
5
6 #ifndef CHECK_H
7 #define CHECK_H "sse2-check.h"
8 #endif
9
10 #include CHECK_H
11
12 #ifndef TEST
13 #define TEST sse2_test_movmskpd_1
14 #endif
15
16 #include <emmintrin.h>
17
18 #ifdef _ARCH_PWR8
19 static int
20 __attribute__((noinline, unused))
21 test (__m128d p)
22 {
23 __asm("" : "+v"(p));
24 return _mm_movemask_pd (p);
25 }
26 #endif
27
28 static void
29 TEST (void)
30 {
31 #ifdef _ARCH_PWR8
32 double source[2] = {1.234, -2234.23};
33 union128d s1;
34 int d;
35 int e;
36
37 s1.x = _mm_loadu_pd (source);
38
39 d = test (s1.x);
40
41 e = 0;
42 if (source[0] < 0)
43 e |= 1;
44
45 if (source[1] < 0)
46 e |= 1 << 1;
47
48 if (checkVi (&d, &e, 1))
49 {
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 ();
56 }
57 #endif
58 }