1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_shift } */
3 /* { dg-require-effective-target vect_pack_trunc } */
4 /* { dg-require-effective-target vect_unpack } */
10 /* This should be treated as an over-widening pattern: we can truncate
11 b to unsigned char after loading it and do all the computation in
14 void __attribute__ ((noipa
))
15 f (unsigned char *restrict a
, unsigned short *restrict b
)
17 for (__INTPTR_TYPE__ i
= 0; i
< N
; ++i
)
19 unsigned short foo
= ((b
[i
] & 0xef) | 0x80) + (a
[i
] << 4);
31 for (int i
= 0; i
< N
; ++i
)
35 asm volatile ("" ::: "memory");
39 for (int i
= 0; i
< N
; ++i
)
40 if (a
[i
] != (unsigned char) ((((i
* 3) & 0xef) | 0x80) + (i
<< 4)))
46 /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\n]* &} "vect" } } */
47 /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\n]* |} "vect" } } */
48 /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\n]* <<} "vect" } } */
49 /* { dg-final { scan-tree-dump {vector[^\n]*char} "vect" } } */
50 /* { dg-final { scan-tree-dump-not {vector[^ ]* int} "vect" } } */
51 /* { dg-final { scan-tree-dump-times "vectorized 1 loop" 1 "vect" } } */