OSDN Git Service

631dadea021110f35ee1bf1e6bc72220781cfded
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / pr43430-2.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-options "-O3 -fno-vect-cost-model -fdump-tree-vect-details" } */
4 typedef unsigned char uint8_t;
5 vsad16_c (void *c, uint8_t * s1, uint8_t * s2, int stride, int h)
6 {
7   int score = 0;
8   int x, y;
9   for (x = 0; x < 16; x++)
10     score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
11               s1[x] + s2[x + stride] :
12               s2[x + stride]);
13   return score;
14 }
15
16 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
17 /* { dg-final { cleanup-tree-dump "vect" } } */