view gcc/testsuite/gcc.dg/fma-6.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* { dg-options "-O2 -fdump-tree-optimized" } */

float
f1 (float a, float b, float c)
{
  return __builtin_fmaf (-a, b, c);
}

double
f2 (double a, double b, double c)
{
  return __builtin_fma (-a, b, c);
}

float
f3 (float a, float b, float c)
{
  return __builtin_fmaf (a, -b, c);
}

double
f4 (double a, double b, double c)
{
  return __builtin_fma (a, -b, c);
}

void
f5 (float a, float b, float c, float d, float e, float *res)
{
  res[0] = __builtin_fmaf (-a, b, c);
  res[1] = __builtin_fmaf (-a, d, e);
}

void
f6 (double a, double b, double c, double d, double e, double *res)
{
  res[0] = __builtin_fma (-a, b, c);
  res[1] = __builtin_fma (-a, d, e);
}

void
f7 (float a, float b, float c, float d, float e, float *res)
{
  res[0] = __builtin_fmaf (a, -b, c);
  res[1] = __builtin_fmaf (d, -b, e);
}

void
f8 (double a, double b, double c, double d, double e, double *res)
{
  res[0] = __builtin_fma (a, -b, c);
  res[1] = __builtin_fma (d, -b, e);
}

float
f9 (float a, float b, float c)
{
  return -__builtin_fmaf (a, b, -c);
}

double
f10 (double a, double b, double c)
{
  return -__builtin_fma (a, b, -c);
}

/* { dg-final { scan-tree-dump-times { = \.FNMA \(} 14 "optimized" { target scalar_all_fma } } } */