1 /* { dg-additional-options "-O3" } */
2 /* { dg-require-effective-target vect_int } */
8 void __attribute__ ((noipa
))
9 f (signed char *restrict a
, signed char *restrict b
,
10 signed char *restrict c
, int n
, int step
)
12 for (int j
= 0; j
< n
; ++j
)
14 for (int i
= 0; i
< 16; ++i
)
15 a
[i
] = (b
[i
] + c
[i
]) >> 1;
25 signed char a
[N
], b
[N
], c
[N
];
32 for (int i
= 0; i
< N
; ++i
)
37 asm volatile ("" ::: "memory");
39 f (a
, b
, c
, N
/ 20, 20);
41 for (int i
= 0; i
< N
; ++i
)
43 int d
= (BASE1
+ BASE2
+ i
* 5) >> 1;
44 if (a
[i
] != (i
% 20 < 16 ? d
: i
))
50 /* { dg-final { scan-tree-dump "vect_recog_average_pattern: detected" "vect" } } */
51 /* { dg-final { scan-tree-dump {\.AVG_FLOOR} "vect" { target vect_avg_qi } } } */
52 /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" { target vect_avg_qi } } } */
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loop" 1 "vect" { target vect_avg_qi } } } */