| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-require-effective-target arm_neon_hw } */ |
| 3 |
/* { dg-options "-O -ftree-vectorize" } */ |
| 4 |
/* { dg-add-options arm_neon } */ |
| 5 |
|
| 6 |
void fill (short *buf) __attribute__ ((noinline)); |
| 7 |
void fill (short *buf) |
| 8 |
{ |
| 9 |
int i; |
| 10 |
|
| 11 |
for (i = 0; i < 11 * 8; i++) |
| 12 |
buf[i] = i; |
| 13 |
} |
| 14 |
|
| 15 |
void test (unsigned char *dst) __attribute__ ((noinline)); |
| 16 |
void test (unsigned char *dst) |
| 17 |
{ |
| 18 |
short tmp[11 * 8], *tptr; |
| 19 |
int i; |
| 20 |
|
| 21 |
fill (tmp); |
| 22 |
|
| 23 |
tptr = tmp; |
| 24 |
for (i = 0; i < 8; i++) |
| 25 |
{ |
| 26 |
dst[0] = (-tptr[0] + 9 * tptr[0 + 1] + 9 * tptr[0 + 2] - tptr[0 + 3]) >> 7; |
| 27 |
dst[1] = (-tptr[1] + 9 * tptr[1 + 1] + 9 * tptr[1 + 2] - tptr[1 + 3]) >> 7; |
| 28 |
dst[2] = (-tptr[2] + 9 * tptr[2 + 1] + 9 * tptr[2 + 2] - tptr[2 + 3]) >> 7; |
| 29 |
dst[3] = (-tptr[3] + 9 * tptr[3 + 1] + 9 * tptr[3 + 2] - tptr[3 + 3]) >> 7; |
| 30 |
dst[4] = (-tptr[4] + 9 * tptr[4 + 1] + 9 * tptr[4 + 2] - tptr[4 + 3]) >> 7; |
| 31 |
dst[5] = (-tptr[5] + 9 * tptr[5 + 1] + 9 * tptr[5 + 2] - tptr[5 + 3]) >> 7; |
| 32 |
dst[6] = (-tptr[6] + 9 * tptr[6 + 1] + 9 * tptr[6 + 2] - tptr[6 + 3]) >> 7; |
| 33 |
dst[7] = (-tptr[7] + 9 * tptr[7 + 1] + 9 * tptr[7 + 2] - tptr[7 + 3]) >> 7; |
| 34 |
|
| 35 |
dst += 8; |
| 36 |
tptr += 11; |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
int main (void) |
| 41 |
{ |
| 42 |
char buf [8 * 8]; |
| 43 |
|
| 44 |
test (buf); |
| 45 |
|
| 46 |
return 0; |
| 47 |
} |
| 48 |
|