2017-08-28 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-fma-6.c
blob3d36237bdb48136e1555ad1063a1de80686e7fa2
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3 /* { dg-require-effective-target ilp32 } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power5" } } */
5 /* { dg-options "-O2 -mcpu=power5 -std=c99 -msoft-float" } */
6 /* { dg-final { scan-assembler-not "fmadd" } } */
7 /* { dg-final { scan-assembler-not "xsfmadd" } } */
9 /* Test whether -msoft-float turns off the macros math.h uses for
10 FP_FAST_FMA{,F,L}. */
11 #ifdef __FP_FAST_FMA
12 #error "__FP_FAST_FMA should not be defined"
13 #endif
15 #ifdef __FP_FAST_FMAF
16 #error "__FP_FAST_FMAF should not be defined"
17 #endif
19 double
20 builtin_fma (double b, double c, double d)
22 return __builtin_fma (b, c, d); /* bl fma */
25 float
26 builtin_fmaf (float b, float c, float d)
28 return __builtin_fmaf (b, c, -d); /* bl fmaf */