aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2df.c
blob: 82ffc86f8aaf322e887bcf3625ea71ec8fd07f0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* { dg-do compile } */
/* { dg-require-effective-target power10_ok } */
/* { dg-options "-mdejagnu-cpu=power10 -O2" } */

#include <math.h>

/* Test generating V2DFmode constants with the ISA 3.1 (power10) XXSPLTIDP
   instruction.  */

vector double
v2df_double_0 (void)
{
  return (vector double) { 0.0, 0.0 };			/* XXSPLTIB or XXLXOR.  */
}

vector double
v2df_double_1 (void)
{
  return (vector double) { 1.0, 1.0 };			/* XXSPLTIDP.  */
}

#ifndef __FAST_MATH__
vector double
v2df_double_m0 (void)
{
  return (vector double) { -0.0, -0.0 };		/* XXSPLTIDP.  */
}

vector double
v2df_double_nan (void)
{
  return (vector double) { __builtin_nan (""),
			   __builtin_nan ("") };	/* XXSPLTIDP.  */
}

vector double
v2df_double_inf (void)
{
  return (vector double) { __builtin_inf (),
			   __builtin_inf () };		/* XXSPLTIDP.  */
}

vector double
v2df_double_m_inf (void)
{
  return (vector double) { - __builtin_inf (),
			   - __builtin_inf () };	/* XXSPLTIDP.  */
}
#endif

vector double
v2df_double_pi (void)
{
  return (vector double) { M_PI, M_PI };		/* PLVX.  */
}

vector double
v2df_double_denorm (void)
{
  return (vector double) { (double)0x1p-149f,
			   (double)0x1p-149f };		/* PLVX.  */
}

/* { dg-final { scan-assembler-times {\mxxspltidp\M} 5 } } */