Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/sse2-sqrtpd-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_sqrt_pd_1
14 #endif
15
16 #include <emmintrin.h>
17 #include <math.h>
18
19 static __m128d
20 __attribute__((noinline, unused))
21 test (__m128d s1)
22 {
23 return _mm_sqrt_pd (s1);
24 }
25
26 static void
27 TEST (void)
28 {
29 union128d u, s1;
30 __m128d bogus = { 123.0, 456.0 };
31 double e[2];
32 int i;
33
34 s1.x = _mm_set_pd (2134.3343,1234.635654);
35 u.x = test (s1.x);
36
37 for (i = 0; i < 2; i++)
38 {
39 __m128d tmp = _mm_load_sd (&s1.a[i]);
40 tmp = _mm_sqrt_sd (bogus, tmp);
41 _mm_store_sd (&e[i], tmp);
42 }
43
44 if (check_union128d (u, e))
45 {
46 #if DEBUG
47 printf ("sse2_test_sqrt_pd_1; check_union128d failed\n");
48 printf ("\t [%f,%f] -> [%f,%f]\n", s1.a[0], s1.a[1], u.a[0], u.a[1]);
49 printf ("\t expect [%f,%f]\n", e[0], e[1]);
50 #endif
51 abort ();
52 }
53 }