| 1 |
/* PR target/99195. */ |
| 2 |
/* Check that we take advantage of 64-bit Advanced SIMD operations clearing |
| 3 |
the top half of the vector register and no explicit zeroing instructions |
| 4 |
are emitted. */ |
| 5 |
/* { dg-do compile } */ |
| 6 |
/* { dg-options "-O" } */ |
| 7 |
|
| 8 |
#include <arm_neon.h> |
| 9 |
|
| 10 |
#define MYOP(OT,IT,IMT,OP,IS,OS) \ |
| 11 |
OT \ |
| 12 |
foo_##OP##_##OS (IT a) \ |
| 13 |
{ \ |
| 14 |
IMT zeros = vcreate_##OS (0); \ |
| 15 |
return vcombine_##OS (v##OP##_##IS (a, 3), zeros); \ |
| 16 |
} |
| 17 |
|
| 18 |
#define FUNC(OT,IT,IMT,IS,OS) \ |
| 19 |
MYOP (OT, IT, IMT, qshrn_n, IS, OS) \ |
| 20 |
MYOP (OT, IT, IMT, qrshrn_n, IS, OS) \ |
| 21 |
MYOP (OT, IT, IMT, shrn_n, IS, OS) \ |
| 22 |
MYOP (OT, IT, IMT, rshrn_n, IS, OS) |
| 23 |
|
| 24 |
#define FUNCUN(OT,IT,IMT,IS,OS) \ |
| 25 |
MYOP (OT, IT, IMT, qshrun_n, IS, OS) \ |
| 26 |
MYOP (OT, IT, IMT, qrshrun_n, IS, OS) |
| 27 |
|
| 28 |
FUNC (int8x16_t, int16x8_t, int8x8_t, s16, s8) |
| 29 |
FUNC (int16x8_t, int32x4_t, int16x4_t, s32, s16) |
| 30 |
FUNC (int32x4_t, int64x2_t, int32x2_t, s64, s32) |
| 31 |
FUNCUN (uint8x16_t, int16x8_t, uint8x8_t, s16, u8) |
| 32 |
FUNCUN (uint16x8_t, int32x4_t, uint16x4_t, s32, u16) |
| 33 |
FUNCUN (uint32x4_t, int64x2_t, uint32x2_t, s64, u32) |
| 34 |
|
| 35 |
FUNC (uint8x16_t, uint16x8_t, uint8x8_t, u16, u8) |
| 36 |
FUNC (uint16x8_t, uint32x4_t, uint16x4_t, u32, u16) |
| 37 |
FUNC (uint32x4_t, uint64x2_t, uint32x2_t, u64, u32) |
| 38 |
|
| 39 |
|
| 40 |
/* { dg-final { scan-assembler-not {\tfmov\t} } } */ |
| 41 |
/* { dg-final { scan-assembler-not {\tmov\t} } } */ |
| 42 |
|