| 1 |
/* { dg-do compile { target aarch64*-*-* } } */ |
| 2 |
/* { dg-options "-O3" } */ |
| 3 |
|
| 4 |
#pragma GCC target "+nosve" |
| 5 |
|
| 6 |
#include <stdint.h> |
| 7 |
|
| 8 |
#define USRA(func, vtype, n) \ |
| 9 |
void func () \ |
| 10 |
{ \ |
| 11 |
int i; \ |
| 12 |
for (i = 0; i < n; i++) \ |
| 13 |
{ \ |
| 14 |
u1##vtype[i] += u2##vtype[i] >> 2; \ |
| 15 |
} \ |
| 16 |
} |
| 17 |
|
| 18 |
#define TEST_VDQ_I_MODES(FUNC) \ |
| 19 |
FUNC (test_v8qi_v16qi, _char, 16) \ |
| 20 |
FUNC (test_v4hi_v8h1, _short, 8) \ |
| 21 |
FUNC (test_v2si_v4si, _int, 4) \ |
| 22 |
FUNC (test_v2di, _ll, 2) \ |
| 23 |
|
| 24 |
uint8_t u1_char[16], u2_char[16]; |
| 25 |
uint16_t u1_short[8], u2_short[8]; |
| 26 |
uint32_t u1_int[4], u2_int[4]; |
| 27 |
uint64_t u1_ll[2], u2_ll[2]; |
| 28 |
|
| 29 |
TEST_VDQ_I_MODES(USRA) |
| 30 |
|
| 31 |
/* { dg-final { scan-assembler "usra" } } */ |
| 32 |
/* { dg-final { scan-assembler-not "ushr" } } */ |
| 33 |
|
| 34 |
/* { dg-final { scan-assembler-times {usra\tv[0-9]+\.16b, v[0-9]+\.16b, [0-9]+} 1 } } */ |
| 35 |
/* { dg-final { scan-assembler-times {usra\tv[0-9]+\.8h, v[0-9]+\.8h, [0-9]+} 1 } } */ |
| 36 |
/* { dg-final { scan-assembler-times {usra\tv[0-9]+\.4s, v[0-9]+\.4s, [0-9]+} 1 } } */ |
| 37 |
/* { dg-final { scan-assembler-times {usra\tv[0-9]+\.2d, v[0-9]+\.2d, [0-9]+} 1 } } */ |