| 1 |
/* { dg-do compile { target lp64 } } */ |
| 2 |
/* { dg-options "-mvsx -O2 -ffast-math -std=c11 -mno-pcrel" } */ |
| 3 |
/* { dg-additional-options "-mdejagnu-cpu=power9" { target { ! has_arch_pwr9 } } } */ |
| 4 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 5 |
/* { dg-require-effective-target float128 } */ |
| 6 |
|
| 7 |
/* Test to make sure the compiler calls the external function instead of doing |
| 8 |
the built-in processing for _Float128 functions that have hardware support |
| 9 |
in ISA 3.0/power9 if are in strict standards mode, where the <func>f128 name |
| 10 |
is not a synonym for __builtin_<func>f128. */ |
| 11 |
|
| 12 |
extern _Float128 copysignf128 (_Float128, _Float128); |
| 13 |
extern _Float128 sqrtf128 (_Float128); |
| 14 |
extern _Float128 fmaf128 (_Float128, _Float128, _Float128); |
| 15 |
|
| 16 |
_Float128 |
| 17 |
do_copysign (_Float128 a, _Float128 b) |
| 18 |
{ |
| 19 |
return copysignf128 (a, b); |
| 20 |
} |
| 21 |
|
| 22 |
_Float128 |
| 23 |
do_sqrt (_Float128 a) |
| 24 |
{ |
| 25 |
return sqrtf128 (a); |
| 26 |
} |
| 27 |
|
| 28 |
_Float128 |
| 29 |
do_fma (_Float128 a, _Float128 b, _Float128 c) |
| 30 |
{ |
| 31 |
return fmaf128 (a, b, c); |
| 32 |
} |
| 33 |
|
| 34 |
_Float128 |
| 35 |
do_fms (_Float128 a, _Float128 b, _Float128 c) |
| 36 |
{ |
| 37 |
return fmaf128 (a, b, -c); |
| 38 |
} |
| 39 |
|
| 40 |
_Float128 |
| 41 |
do_nfma (_Float128 a, _Float128 b, _Float128 c) |
| 42 |
{ |
| 43 |
return -fmaf128 (a, b, c); |
| 44 |
} |
| 45 |
|
| 46 |
_Float128 |
| 47 |
do_nfms (_Float128 a, _Float128 b, _Float128 c) |
| 48 |
{ |
| 49 |
return -fmaf128 (a, b, -c); |
| 50 |
} |
| 51 |
|
| 52 |
/* { dg-final { scan-assembler-not {\mxscpsgnqp\M} } } */ |
| 53 |
/* { dg-final { scan-assembler-not {\mxssqrtqp\M} } } */ |
| 54 |
/* { dg-final { scan-assembler-not {\mxsmaddqp\M} } } */ |
| 55 |
/* { dg-final { scan-assembler-not {\mxsmsubqp\M} } } */ |
| 56 |
/* { dg-final { scan-assembler-not {\mxsnmaddqp\M} } } */ |
| 57 |
/* { dg-final { scan-assembler-not {\mxsnmsubqp\M} } } */ |
| 58 |
/* { dg-final { scan-assembler-times {\mbl\M} 6 } } */ |