Support fused multiply-adds in fully-masked reductions
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / reduc_6.c
blob65647c4e97abad96ac3091e9a8d4f2c847548eab
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -ffast-math" } */
4 #define REDUC(TYPE) \
5 TYPE reduc_##TYPE (TYPE *x, TYPE *y, int count) \
6 { \
7 TYPE sum = 0; \
8 for (int i = 0; i < count; ++i) \
9 sum += x[i] * y[i]; \
10 return sum; \
13 REDUC (float)
14 REDUC (double)
16 /* { dg-final { scan-assembler-times {\tfmla\tz[0-9]+\.s, p[0-7]/m} 1 } } */
17 /* { dg-final { scan-assembler-times {\tfmla\tz[0-9]+\.d, p[0-7]/m} 1 } } */