1 /* Write a reduction loop to be reduced using vector shifts. */
6 #define N (VECTOR_BITS / 8)
11 extern void abort(void);
13 unsigned char in
[N
] __attribute__((__aligned__(16)));
16 main (unsigned char argc
, char **argv
)
19 unsigned char sum
= 1;
20 unsigned char expected
= 1;
24 for (i
= 0; i
< N
; i
++)
26 in
[i
] = (i
+ i
+ 1) & 0xfd;
27 asm volatile ("" ::: "memory");
30 for (i
= 0; i
< N
; i
++)
33 asm volatile ("" ::: "memory");
36 for (i
= 0; i
< N
; i
++)
41 __builtin_printf("Failed %d\n", sum
);
48 /* { dg-final { scan-tree-dump "Reduce using vector shifts" "vect" { target { whole_vector_shift && { ! vect_logical_reduc } } } } } */
49 /* { dg-final { scan-tree-dump "Reduce using direct vector reduction" "vect" { target vect_logical_reduc } } } */