| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3" } */ |
| 3 |
|
| 4 |
#include <arm_neon.h> |
| 5 |
|
| 6 |
#define TEST_SUBL(rettype, intype, ts, rs) \ |
| 7 |
rettype test_vsubl_ ## ts (intype a, intype b, intype c) \ |
| 8 |
{ \ |
| 9 |
rettype t0 = vsubl_ ## ts (vget_high_ ## ts (a), \ |
| 10 |
vget_high_ ## ts (c)); \ |
| 11 |
rettype t1 = vsubl_ ## ts (vget_high_ ## ts (b), \ |
| 12 |
vget_high_ ## ts (c)); \ |
| 13 |
return vaddq ## _ ## rs (t0, t1); \ |
| 14 |
} |
| 15 |
|
| 16 |
TEST_SUBL (int16x8_t, int8x16_t, s8, s16) |
| 17 |
TEST_SUBL (uint16x8_t, uint8x16_t, u8, u16) |
| 18 |
TEST_SUBL (int32x4_t, int16x8_t, s16, s32) |
| 19 |
TEST_SUBL (uint32x4_t, uint16x8_t, u16, u32) |
| 20 |
TEST_SUBL (int64x2_t, int32x4_t, s32, s64) |
| 21 |
TEST_SUBL (uint64x2_t, uint32x4_t, u32, u64) |
| 22 |
|
| 23 |
#define TEST_SUBW(rettype, intype, intypel, ts, rs) \ |
| 24 |
rettype test_vsubw_ ## ts (intype a, intype b, intypel c) \ |
| 25 |
{ \ |
| 26 |
rettype t0 = vsubw_ ## ts (a, vget_high_ ## ts (c)); \ |
| 27 |
rettype t1 = vsubw_ ## ts (b, vget_high_ ## ts (c)); \ |
| 28 |
return vaddq ## _ ## rs (t0, t1); \ |
| 29 |
} |
| 30 |
|
| 31 |
TEST_SUBW (int16x8_t, int16x8_t, int8x16_t, s8, s16) |
| 32 |
TEST_SUBW (uint16x8_t, uint16x8_t, uint8x16_t, u8, u16) |
| 33 |
TEST_SUBW (int32x4_t, int32x4_t, int16x8_t, s16, s32) |
| 34 |
TEST_SUBW (uint32x4_t, uint32x4_t, uint16x8_t, u16, u32) |
| 35 |
TEST_SUBW (int64x2_t, int64x2_t, int32x4_t, s32, s64) |
| 36 |
TEST_SUBW (uint64x2_t, uint64x2_t, uint32x4_t, u32, u64) |
| 37 |
|
| 38 |
/* { dg-final { scan-assembler-not "dup\\t" } } */ |