| 1 |
#include "p9-vec-length.h" |
| 2 |
|
| 3 |
/* Test the case that the loop which has multiple vectors (concatenated vectors) |
| 4 |
with different types. */ |
| 5 |
|
| 6 |
#define test(TYPE1, TYPE2) \ |
| 7 |
void __attribute__ ((noinline, noclone)) \ |
| 8 |
test_mv_##TYPE1##TYPE2 (TYPE1 *restrict a, TYPE2 *restrict b, int n) \ |
| 9 |
{ \ |
| 10 |
for (int i = 0; i < n; ++i) \ |
| 11 |
{ \ |
| 12 |
a[i * 2] += 1; \ |
| 13 |
a[i * 2 + 1] += 2; \ |
| 14 |
b[i * 2] += 3; \ |
| 15 |
b[i * 2 + 1] += 4; \ |
| 16 |
} \ |
| 17 |
} |
| 18 |
|
| 19 |
#define TEST_ALL2(T) \ |
| 20 |
T (int8_t, uint16_t) \ |
| 21 |
T (uint8_t, int16_t) \ |
| 22 |
T (int16_t, uint32_t) \ |
| 23 |
T (uint16_t, int32_t) \ |
| 24 |
T (int32_t, double) \ |
| 25 |
T (uint32_t, int64_t) \ |
| 26 |
T (float, uint64_t) |
| 27 |
|
| 28 |
TEST_ALL2 (test) |
| 29 |
|