1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target ilp32 } */
4 /* { dg-options "-O2 -mdejagnu-cpu=power5 -std=c99 -msoft-float" } */
5 /* { dg-final { scan-assembler-not "fmadd" } } */
6 /* { dg-final { scan-assembler-not "xsfmadd" } } */
7
8 /* Test whether -msoft-float turns off the macros math.h uses for
9 FP_FAST_FMA{,F,L}. */
10 #ifdef __FP_FAST_FMA
11 #error "__FP_FAST_FMA should not be defined"
12 #endif
13
14 #ifdef __FP_FAST_FMAF
15 #error "__FP_FAST_FMAF should not be defined"
16 #endif
17
18 double
builtin_fma(double b,double c,double d)19 builtin_fma (double b, double c, double d)
20 {
21 return __builtin_fma (b, c, d); /* bl fma */
22 }
23
24 float
builtin_fmaf(float b,float c,float d)25 builtin_fmaf (float b, float c, float d)
26 {
27 return __builtin_fmaf (b, c, -d); /* bl fmaf */
28 }
29