1 /* { dg-require-effective-target scalar_all_fma } */
5 #define N (VECTOR_BITS * 11 / 64 + 3)
8 void __attribute__ ((noipa)) \
9 f_##INV (double *restrict a, double *restrict b, \
10 double *restrict c, double *restrict d) \
12 for (int i = 0; i < N; ++i) \
14 double mb = (INV & 1 ? -b[i] : b[i]); \
16 double md = (INV & 2 ? -d[i] : d[i]); \
17 double fma = __builtin_fma (mb, mc, md); \
18 a[i] = (INV & 4 ? -fma : fma); \
24 f_##INV (a, b, c, d); \
25 _Pragma("GCC novector") \
26 for (int i = 0; i < N; ++i) \
28 double mb = (INV & 1 ? -b[i] : b[i]); \
30 double md = (INV & 2 ? -d[i] : d[i]); \
31 double fma = __builtin_fma (mb, mc, md); \
32 double expected = (INV & 4 ? -fma : fma); \
33 if (a[i] != expected) \
35 asm volatile ("" ::: "memory"); \
39 #define FOR_EACH_INV(T) \
40 T (0) T (1) T (2) T (3) T (4) T (5) T (6) T (7)
47 double a
[N
], b
[N
], c
[N
], d
[N
];
48 for (int i
= 0; i
< N
; ++i
)
53 asm volatile ("" ::: "memory");
59 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 8 "vect" { target vect_double } } } */