| 1 |
extern void abort (void); |
| 2 |
|
| 3 |
poly16x4_t |
| 4 |
test_vext_p16_1 (poly16x4_t a, poly16x4_t b) |
| 5 |
{ |
| 6 |
return vext_p16 (a, b, 1); |
| 7 |
} |
| 8 |
|
| 9 |
poly16x4_t |
| 10 |
test_vext_p16_2 (poly16x4_t a, poly16x4_t b) |
| 11 |
{ |
| 12 |
return vext_p16 (a, b, 2); |
| 13 |
} |
| 14 |
|
| 15 |
poly16x4_t |
| 16 |
test_vext_p16_3 (poly16x4_t a, poly16x4_t b) |
| 17 |
{ |
| 18 |
return vext_p16 (a, b, 3); |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
main (int argc, char **argv) |
| 23 |
{ |
| 24 |
int i, off; |
| 25 |
poly16_t arr1[] = {0, 1, 2, 3}; |
| 26 |
poly16x4_t in1 = vld1_p16 (arr1); |
| 27 |
poly16_t arr2[] = {4, 5, 6, 7}; |
| 28 |
poly16x4_t in2 = vld1_p16 (arr2); |
| 29 |
poly16_t exp[4]; |
| 30 |
poly16x4_t expected; |
| 31 |
poly16x4_t actual = test_vext_p16_1 (in1, in2); |
| 32 |
|
| 33 |
for (i = 0; i < 4; i++) |
| 34 |
exp[i] = i + 1; |
| 35 |
expected = vld1_p16 (exp); |
| 36 |
for (i = 0; i < 4; i++) |
| 37 |
if (actual[i] != expected[i]) |
| 38 |
abort (); |
| 39 |
|
| 40 |
actual = test_vext_p16_2 (in1, in2); |
| 41 |
for (i = 0; i < 4; i++) |
| 42 |
exp[i] = i + 2; |
| 43 |
expected = vld1_p16 (exp); |
| 44 |
for (i = 0; i < 4; i++) |
| 45 |
if (actual[i] != expected[i]) |
| 46 |
abort (); |
| 47 |
|
| 48 |
actual = test_vext_p16_3 (in1, in2); |
| 49 |
for (i = 0; i < 4; i++) |
| 50 |
exp[i] = i + 3; |
| 51 |
expected = vld1_p16 (exp); |
| 52 |
for (i = 0; i < 4; i++) |
| 53 |
if (actual[i] != expected[i]) |
| 54 |
abort (); |
| 55 |
|
| 56 |
return 0; |
| 57 |
} |
| 58 |
|