Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2di.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target power10_ok } */
3 /* { dg-options "-mdejagnu-cpu=power10 -O2" } */
4
5 /* Test generating V2DImode constants that have the same bit pattern as
6 V2DFmode constants that can be loaded with the XXSPLTIDP instruction with
7 the ISA 3.1 (power10). */
8
9 vector long long
10 vector_0 (void)
11 {
12 /* XXSPLTIB or XXLXOR. */
13 return (vector long long) { 0LL, 0LL };
14 }
15
16 vector long long
17 vector_1 (void)
18 {
19 /* XXSPLTIB and VEXTSB2D. */
20 return (vector long long) { 1LL, 1LL };
21 }
22
23 /* 0x8000000000000000LL is the bit pattern for -0.0, which can be generated
24 with XXSPLTISDP. */
25 vector long long
26 vector_float_neg_0 (void)
27 {
28 /* XXSPLTIDP. */
29 return (vector long long) { 0x8000000000000000LL, 0x8000000000000000LL };
30 }
31
32 /* 0x3ff0000000000000LL is the bit pattern for 1.0 which can be generated with
33 XXSPLTISDP. */
34 vector long long
35 vector_float_1_0 (void)
36 {
37 /* XXSPLTIDP. */
38 return (vector long long) { 0x3ff0000000000000LL, 0x3ff0000000000000LL };
39 }
40
41 /* 0x400921fb54442d18LL is the bit pattern for PI, which cannot be generated
42 with XXSPLTIDP. */
43 vector long long
44 scalar_pi (void)
45 {
46 /* PLXV. */
47 return (vector long long) { 0x400921fb54442d18LL, 0x400921fb54442d18LL };
48 }
49
50 /* { dg-final { scan-assembler-times {\mxxspltidp\M} 2 } } */