1/* { dg-require-effective-target vect_int } */ 2 3#include <stdarg.h> 4#include "tree-vect.h" 5 6#define A 3 7#define B 4 8#define N 256 9 10char src[N], dst[N]; 11 12void __attribute__((noinline,noclone)) 13foo (char * __restrict__ dst, char * __restrict__ src, int h, 14 int stride, int dummy) 15{ 16 int i; 17 h /= 16; 18 for (i = 0; i < h; i++) 19 { 20 dst[0] += A*src[0] + src[stride]; 21 dst[1] += A*src[1] + src[1+stride]; 22 dst[2] += A*src[2] + src[2+stride]; 23 dst[3] += A*src[3] + src[3+stride]; 24 dst[4] += A*src[4] + src[4+stride]; 25 dst[5] += A*src[5] + src[5+stride]; 26 dst[6] += A*src[6] + src[6+stride]; 27 dst[7] += A*src[7] + src[7+stride]; 28 dst += 8; 29 src += 8; 30 if (dummy == 32) 31 abort (); 32 } 33} 34 35 36int main (void) 37{ 38 int i; 39 40 check_vect (); 41 42 for (i = 0; i < N; i++) 43 { 44 dst[i] = 0; 45 src[i] = i/8; 46 } 47 48 foo (dst, src, N, 8, 0); 49 50 for (i = 0; i < N/2; i++) 51 { 52 if (dst[i] != A * src[i] + src[i+8]) 53 abort (); 54 } 55 56 return 0; 57} 58 59/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target { vect64 && vect_hw_misalign } } } } */ 60/* { dg-final { cleanup-tree-dump "slp1" } } */ 61/* { dg-final { cleanup-tree-dump "slp2" } } */ 62 63