aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc-fma-7.c
blob: f6e7e4ce56193332efce21d828f4d7d894e5316a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-require-effective-target powerpc_fprs } */
/* { dg-options "-O3 -ftree-vectorize -mcpu=power6 -ffast-math" } */
/* { dg-final { scan-assembler-times "fmadd" 1 } } */
/* { dg-final { scan-assembler-times "fmsub " 1 } } */
/* { dg-final { scan-assembler-not "fmul" } } */
/* { dg-final { scan-assembler-not "fadd " } } */

/* Check whether the common FFT idiom (a*b)+c and (a*b)-c generates two fma
   instructions, instead of a multiply, add, and subtract.  */

void
fft (double *result, double a, double b, double c)
{
  result[0] = (a*b) + c;
  result[1] = (a*b) - c;
}