aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fma-5.c
blob: 68d75979fd5dc7869147000480630b262e584046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* { 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);
}

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

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

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

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

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

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

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