1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
3 
4 #define TYPE double
5 #define SIZE 257
6 
7 void __attribute__ ((weak))
f(TYPE * x,TYPE * y,long n,long m)8 f (TYPE *x, TYPE *y, long n, long m __attribute__((unused)))
9 {
10   for (int i = 0; i < SIZE; ++i)
11     x[i * n] += y[i * n];
12 }
13 
14 /* { dg-final { scan-assembler {\tld1d\tz[0-9]+} } } */
15 /* { dg-final { scan-assembler {\tst1d\tz[0-9]+} } } */
16 /* { dg-final { scan-assembler {\tldr\td[0-9]+} } } */
17 /* { dg-final { scan-assembler {\tstr\td[0-9]+} } } */
18 /* Should use a WAR check that multiplies by (VF-2)*8 rather than
19    an overlap check that multiplies by (257-1)*4.  */
20 /* { dg-final { scan-assembler {\tcntb\t(x[0-9]+)\n.*\tsub\tx[0-9]+, \1, #16\n.*\tmul\tx[0-9]+,[^\n]*\1} } } */
21 /* { dg-final { scan-assembler-times {\tcsel\tx[0-9]+[^\n]*xzr} 1 } } */
22 /* One range check and a check for n being zero.  */
23 /* { dg-final { scan-assembler-times {\tcmp\t} 1 } } */
24 /* { dg-final { scan-assembler-times {\tccmp\t} 1 } } */
25