aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-td-3.c
blob: e825e5cad28828b7c341b52e04d14d9e6009efb2 (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
/* Test generation of DFP instructions for POWER6.  */
/* { dg-do compile { target { powerpc*-*-linux* && powerpc_fprs } } } */
/* { dg-options "-std=gnu99 -O1 -mcpu=power6" } */

/* { dg-final { scan-assembler-times "fneg" 1 } } */
/* { dg-final { scan-assembler-times "fabs" 1 } } */
/* { dg-final { scan-assembler-times "fnabs" 1 } } */
/* { dg-final { scan-assembler-times "fmr" 3 } } */

/* These tests verify we generate fneg, fabs and fnabs and
   associated fmr's since these are not done in place.  */

_Decimal128
func1 (_Decimal128 a, _Decimal128 b)
{
  return -b;
}

_Decimal128
func2 (_Decimal128 a, _Decimal128 b)
{
  return __builtin_fabsd128 (b);
}

_Decimal128
func3 (_Decimal128 a, _Decimal128 b)
{
  return - __builtin_fabsd128 (b);
}