| 1 |
/* { dg-do assemble } */ |
| 2 |
/* { dg-require-effective-target arm_v8_1m_mve_ok } */ |
| 3 |
/* { dg-add-options arm_v8_1m_mve } */ |
| 4 |
/* { dg-additional-options "-O3" } */ |
| 5 |
|
| 6 |
#include <stdint.h> |
| 7 |
|
| 8 |
#define FUNC(SIGN, TYPE, BITS, NB, OP, NAME) \ |
| 9 |
void test_ ## NAME ##_ ## SIGN ## BITS ## x ## NB (TYPE##BITS##_t * __restrict__ dest, TYPE##BITS##_t *a, TYPE##BITS##_t *b) { \ |
| 10 |
int i; \ |
| 11 |
for (i=0; i<NB; i++) { \ |
| 12 |
dest[i] = a[i] OP b[i]; \ |
| 13 |
} \ |
| 14 |
} |
| 15 |
|
| 16 |
/* 64-bit vectors. */ |
| 17 |
FUNC(s, int, 32, 2, | ~ , vorn) |
| 18 |
FUNC(u, uint, 32, 2, | ~ , vorn) |
| 19 |
FUNC(s, int, 16, 4, | ~ , vorn) |
| 20 |
FUNC(u, uint, 16, 4, | ~ , vorn) |
| 21 |
FUNC(s, int, 8, 8, | ~ , vorn) |
| 22 |
FUNC(u, uint, 8, 8, | ~ , vorn) |
| 23 |
|
| 24 |
/* 128-bit vectors. */ |
| 25 |
FUNC(s, int, 32, 4, | ~ , vorn) |
| 26 |
FUNC(u, uint, 32, 4, | ~ , vorn) |
| 27 |
FUNC(s, int, 16, 8, | ~ , vorn) |
| 28 |
FUNC(u, uint, 16, 8, | ~ , vorn) |
| 29 |
FUNC(s, int, 8, 16, | ~ , vorn) |
| 30 |
FUNC(u, uint, 8, 16, | ~ , vorn) |
| 31 |
|
| 32 |
/* MVE has only 128-bit vectors, so we can vectorize only half of the |
| 33 |
functions above. */ |
| 34 |
/* Although float16 and float32 types are supported at assembly level, |
| 35 |
we cannot test them with the '| ~ ' operator, so we check only the |
| 36 |
integer variants. */ |
| 37 |
/* No need to test immediates as second operand, they are covered by vorr. */ |
| 38 |
/* { dg-final { scan-assembler-times {vorn\tq[0-9]+, q[0-9]+, q[0-9]+} 6 } } */ |