summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/float128-5.c
blob: 17f2fb203c3e085ed3f46aaed3c85cc8fb565ddb (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
/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-options "-O2 -mpower9-vector -mno-float128" } */

/* Test that we can use #pragma GCC target to enable -mfloat128 and generate
   code on ISA 3.0 for the float128 built-in functions.  Lp64 is required
   because we need TImode to be available to enable __float128 using hardware
   instructions.  */

#ifdef __FLOAT128__
#error "-mno-float128 should disable initially defining __FLOAT128__"
#endif

#pragma GCC target("float128")

#ifndef __FLOAT128__
#error "#pragma GCC target(\"float128\") should enable -mfloat128"
#endif

__float128
qabs (__float128 a)
{
  return __builtin_fabsf128 (a);
}

/* { dg-final { scan-assembler "xsabsqp"  } } */