1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_shift } */
9 /* Modified rgb to rgb conversion from FFmpeg. */
10 __attribute__ ((noinline
)) void
11 foo (unsigned char *src
, unsigned char *dst
)
13 unsigned char *s
= src
;
17 for (i
= 0; i
< N
/4; i
++)
23 *d
= ((b
>>3) | ((g
&0xFC)<<3) | ((r
&0xF8)<<8) | (a
>>5));
30 for (i
= 0; i
< N
/4; i
++)
36 if (*d
!= ((b
>>3) | ((g
&0xFC)<<3) | ((r
&0xF8)<<8) | (a
>>5)))
45 unsigned char in
[N
], out
[N
];
49 for (i
= 0; i
< N
; i
++)
53 __asm__
volatile ("");
61 /* This is an over-widening even though the final result is still an int.
62 It's better to do one vector of ops on chars and then widen than to
63 widen and then do 4 vectors of ops on ints. */
64 /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\n]* << 3} "vect" } } */
65 /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\n]* >> 3} "vect" } } */
66 /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\n]* << 8} "vect" } } */
67 /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\n]* >> 5} "vect" } } */
68 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */