]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gcc.target/powerpc/vec-splat-constant-df.c
Generate XXSPLTIDP on power10.
[gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-splat-constant-df.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target power10_ok } */
3 /* { dg-options "-mdejagnu-cpu=power10 -O2" } */
4
5 #include <math.h>
6
7 /* Test generating DFmode constants with the ISA 3.1 (power10) XXSPLTIDP
8 instruction. */
9
10 double
11 scalar_double_0 (void)
12 {
13 return 0.0; /* XXSPLTIB or XXLXOR. */
14 }
15
16 double
17 scalar_double_1 (void)
18 {
19 return 1.0; /* XXSPLTIDP. */
20 }
21
22 #ifndef __FAST_MATH__
23 double
24 scalar_double_m0 (void)
25 {
26 return -0.0; /* XXSPLTIDP. */
27 }
28
29 double
30 scalar_double_nan (void)
31 {
32 return __builtin_nan (""); /* XXSPLTIDP. */
33 }
34
35 double
36 scalar_double_inf (void)
37 {
38 return __builtin_inf (); /* XXSPLTIDP. */
39 }
40
41 double
42 scalar_double_m_inf (void) /* XXSPLTIDP. */
43 {
44 return - __builtin_inf ();
45 }
46 #endif
47
48 double
49 scalar_double_pi (void)
50 {
51 return M_PI; /* PLFD. */
52 }
53
54 double
55 scalar_double_denorm (void)
56 {
57 return 0x1p-149f; /* PLFD. */
58 }
59
60 /* { dg-final { scan-assembler-times {\mxxspltidp\M} 5 } } */
This page took 0.034218 seconds and 5 git commands to generate.