| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -Wall -march=armv8.2-a+sve" } */ |
| 3 |
|
| 4 |
#include <arm_neon.h> |
| 5 |
#include <arm_sve.h> |
| 6 |
|
| 7 |
int8x8_t f1 (int16x4_t a, int16x4_t b) { |
| 8 |
int8x8_t ab = vdup_n_s8 (0); |
| 9 |
int16x8_t ab_concat = vcombine_s16 (a, b); |
| 10 |
ab = vmovn_s16 (ab_concat); |
| 11 |
return ab; |
| 12 |
} |
| 13 |
|
| 14 |
int16x4_t f2 (int32x2_t a, int32x2_t b) { |
| 15 |
int16x4_t ab = vdup_n_s16 (0); |
| 16 |
int32x4_t ab_concat = vcombine_s32 (a, b); |
| 17 |
ab = vmovn_s32 (ab_concat); |
| 18 |
return ab; |
| 19 |
} |
| 20 |
|
| 21 |
int32x2_t f3 (svint64_t a, svint64_t b) { |
| 22 |
int32x2_t ab = vdup_n_s32 (0); |
| 23 |
ab = vset_lane_s32 ((int)svaddv_s64 (svptrue_b64 (), a), ab, 0); |
| 24 |
ab = vset_lane_s32 ((int)svaddv_s64 (svptrue_b64 (), b), ab, 1); |
| 25 |
return ab; |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler-not {\txtn\t} } }*/ |
| 29 |
/* { dg-final { scan-assembler-not {\tfcvtn\t} } }*/ |
| 30 |
/* { dg-final { scan-assembler-times {\tuzp1\tv[0-9]+\.8b, v[0-9]+\.8b, v[0-9]+\.8b} 1 } }*/ |
| 31 |
/* { dg-final { scan-assembler-times {\tuzp1\tv[0-9]+\.4h, v[0-9]+\.4h, v[0-9]+\.4h} 1 } }*/ |
| 32 |
/* { dg-final { scan-assembler-times {\tuzp1\tv[0-9]+\.2s, v[0-9]+\.2s, v[0-9]+\.2s} 1 } }*/ |