1/* { dg-require-effective-target vect_int } */ 2/* { dg-require-effective-target vect_shift } */ 3 4#include <stdarg.h> 5#include "tree-vect.h" 6 7#define N 64 8#define C1 10 9#define C2 5 10 11__attribute__ ((noinline)) void 12foo (unsigned char *src, unsigned int *dst1, unsigned int *dst2) 13{ 14 int i; 15 unsigned char b, *s = src; 16 unsigned int *d1 = dst1, *d2 = dst2; 17 18 for (i = 0; i < N; i++) 19 { 20 b = *s++; 21 *d1 = b << C1; 22 d1++; 23 *d2 = b << C2; 24 d2++; 25 } 26 27 s = src; 28 d1 = dst1; 29 d2 = dst2; 30 for (i = 0; i < N; i++) 31 { 32 b = *s++; 33 if (*d1 != b << C1 || *d2 != b << C2) 34 abort (); 35 d1++; 36 d2++; 37 } 38} 39 40int main (void) 41{ 42 int i; 43 unsigned char in[N]; 44 unsigned int out1[N]; 45 unsigned int out2[N]; 46 47 check_vect (); 48 49 for (i = 0; i < N; i++) 50 { 51 in[i] = i; 52 out1[i] = 255; 53 out2[i] = 255; 54 __asm__ volatile (""); 55 } 56 57 foo (in, out1, out2); 58 59 return 0; 60} 61 62/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ 63/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ 64/* { dg-final { cleanup-tree-dump "vect" } } */ 65