[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse3-lddqu.c
blob8e01862e423c677fa6926d625fdf9752a3bcc12e
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 "sse3-check.h"
8 #endif
10 #include CHECK_H
12 #ifndef TEST
13 #define TEST sse3_test_lddqu_1
14 #endif
16 #define NO_WARN_X86_INTRINSICS 1
17 #include <pmmintrin.h>
19 static void
20 sse3_test_lddqu (double *i1, double *r)
22 __m128i t1 = _mm_lddqu_si128 ((__m128i *) i1);
24 _mm_storeu_si128 ((__m128i *) r, t1);
27 static int
28 chk_pd (double *v1, double *v2)
30 int i;
31 int n_fails = 0;
33 for (i = 0; i < 2; i++)
34 if (v1[i] != v2[i])
35 n_fails += 1;
37 return n_fails;
40 static double p1[2];
41 static double p2[2];
42 static double ck[2];
44 static double vals[] =
46 100.0, 200.0, 300.0, 400.0, 5.0, -1.0, .345, -21.5,
47 1100.0, 0.235, 321.3, 53.40, 0.3, 10.0, 42.0, 32.52,
48 32.6, 123.3, 1.234, 2.156, 0.1, 3.25, 4.75, 32.44,
49 12.16, 52.34, 64.12, 71.13, -.1, 2.30, 5.12, 3.785,
50 541.3, 321.4, 231.4, 531.4, 71., 321., 231., -531.,
51 23.45, 23.45, 23.45, 23.45, 23.45, 23.45, 23.45, 23.45,
52 23.45, -1.43, -6.74, 6.345, -20.1, -20.1, -40.1, -40.1,
53 1.234, 2.345, 3.456, 4.567, 5.678, 6.789, 7.891, 8.912,
54 -9.32, -8.41, -7.50, -6.59, -5.68, -4.77, -3.86, -2.95,
55 9.32, 8.41, 7.50, 6.59, -5.68, -4.77, -3.86, -2.95
58 //static
59 void
60 TEST (void)
62 int i;
63 int fail = 0;
65 for (i = 0; i < sizeof (vals) / sizeof (vals[0]); i += 2)
67 p1[0] = vals[i+0];
68 p1[1] = vals[i+1];
70 sse3_test_lddqu (p1, p2);
72 ck[0] = p1[0];
73 ck[1] = p1[1];
75 fail += chk_pd (ck, p2);
78 if (fail != 0)
79 abort ();