| 1 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 2 |
|
| 3 |
float |
| 4 |
f1 (float a, float b, float c) |
| 5 |
{ |
| 6 |
return __builtin_fmaf (-a, b, c); |
| 7 |
} |
| 8 |
|
| 9 |
double |
| 10 |
f2 (double a, double b, double c) |
| 11 |
{ |
| 12 |
return __builtin_fma (-a, b, c); |
| 13 |
} |
| 14 |
|
| 15 |
float |
| 16 |
f3 (float a, float b, float c) |
| 17 |
{ |
| 18 |
return __builtin_fmaf (a, -b, c); |
| 19 |
} |
| 20 |
|
| 21 |
double |
| 22 |
f4 (double a, double b, double c) |
| 23 |
{ |
| 24 |
return __builtin_fma (a, -b, c); |
| 25 |
} |
| 26 |
|
| 27 |
void |
| 28 |
f5 (float a, float b, float c, float d, float e, float *res) |
| 29 |
{ |
| 30 |
res[0] = __builtin_fmaf (-a, b, c); |
| 31 |
res[1] = __builtin_fmaf (-a, d, e); |
| 32 |
} |
| 33 |
|
| 34 |
void |
| 35 |
f6 (double a, double b, double c, double d, double e, double *res) |
| 36 |
{ |
| 37 |
res[0] = __builtin_fma (-a, b, c); |
| 38 |
res[1] = __builtin_fma (-a, d, e); |
| 39 |
} |
| 40 |
|
| 41 |
void |
| 42 |
f7 (float a, float b, float c, float d, float e, float *res) |
| 43 |
{ |
| 44 |
res[0] = __builtin_fmaf (a, -b, c); |
| 45 |
res[1] = __builtin_fmaf (d, -b, e); |
| 46 |
} |
| 47 |
|
| 48 |
void |
| 49 |
f8 (double a, double b, double c, double d, double e, double *res) |
| 50 |
{ |
| 51 |
res[0] = __builtin_fma (a, -b, c); |
| 52 |
res[1] = __builtin_fma (d, -b, e); |
| 53 |
} |
| 54 |
|
| 55 |
float |
| 56 |
f9 (float a, float b, float c) |
| 57 |
{ |
| 58 |
return -__builtin_fmaf (a, b, -c); |
| 59 |
} |
| 60 |
|
| 61 |
double |
| 62 |
f10 (double a, double b, double c) |
| 63 |
{ |
| 64 |
return -__builtin_fma (a, b, -c); |
| 65 |
} |
| 66 |
|
| 67 |
/* { dg-final { scan-tree-dump-times { = \.FNMA \(} 14 "optimized" { target { scalar_all_fma && { ! loongarch*-*-* } } } } } */ |