1 /* { dg-do run { target { whole_vector_shift || vect_logical_reduc } } } */
3 /* Write a reduction loop to be reduced using vector shifts. */
8 #define N (VECTOR_BITS / 8)
13 extern void abort(void);
15 unsigned char in
[N
] __attribute__((__aligned__(16)));
18 main (unsigned char argc
, char **argv
)
21 unsigned char sum
= 1;
22 unsigned char expected
= 1;
26 for (i
= 0; i
< N
; i
++)
28 in
[i
] = (i
+ i
+ 1) & 0xfd;
29 asm volatile ("" ::: "memory");
32 for (i
= 0; i
< N
; i
++)
35 asm volatile ("" ::: "memory");
38 for (i
= 0; i
< N
; i
++)
43 __builtin_printf("Failed %d\n", sum
);
50 /* { dg-final { scan-tree-dump "Reduce using vector shifts" "vect" { target { ! vect_logical_reduc } } } } */
51 /* { dg-final { scan-tree-dump "Reduce using direct vector reduction" "vect" { target vect_logical_reduc } } } */