OSDN Git Service

* gcc.target/sh/mfmovd.c: Extend list of supported targets.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / powerpc / ppc-fma-7.c
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3 /* { dg-require-effective-target powerpc_altivec_ok } */
4 /* { dg-options "-O3 -ftree-vectorize -mcpu=power6 -ffast-math" } */
5 /* { dg-final { scan-assembler-times "fmadd" 1 } } */
6 /* { dg-final { scan-assembler-times "fmsub " 1 } } */
7 /* { dg-final { scan-assembler-not "fmul" } } */
8 /* { dg-final { scan-assembler-not "fadd " } } */
9
10 /* Check whether the common FFT idiom (a*b)+c and (a*b)-c generates two fma
11    instructions, instead of a multiply, add, and subtract.  */
12
13 void
14 fft (double *result, double a, double b, double c)
15 {
16   result[0] = (a*b) + c;
17   result[1] = (a*b) - c;
18 }