1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -ftree-vectorize -ffast-math" } */ 3 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; \ 11 } 12 13 REDUC (float) 14 REDUC (double) 15 16 /* { dg-final { scan-assembler-times {\tfmls\tz[0-9]+\.s, p[0-7]/m} 1 } } */ 17 /* { dg-final { scan-assembler-times {\tfmls\tz[0-9]+\.d, p[0-7]/m} 1 } } */ 18