mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
target/arm: Implement SVE2 saturating extract narrow
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-25-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
289a17976d
commit
5ff2838d3d
4 changed files with 330 additions and 0 deletions
|
@ -1269,6 +1269,62 @@ DO_ZZZW_ACC(sve2_uabal_d, uint64_t, uint32_t, , H1_4, DO_ABD)
|
|||
|
||||
#undef DO_ZZZW_ACC
|
||||
|
||||
#define DO_XTNB(NAME, TYPE, OP) \
|
||||
void HELPER(NAME)(void *vd, void *vn, uint32_t desc) \
|
||||
{ \
|
||||
intptr_t i, opr_sz = simd_oprsz(desc); \
|
||||
for (i = 0; i < opr_sz; i += sizeof(TYPE)) { \
|
||||
TYPE nn = *(TYPE *)(vn + i); \
|
||||
nn = OP(nn) & MAKE_64BIT_MASK(0, sizeof(TYPE) * 4); \
|
||||
*(TYPE *)(vd + i) = nn; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DO_XTNT(NAME, TYPE, TYPEN, H, OP) \
|
||||
void HELPER(NAME)(void *vd, void *vn, uint32_t desc) \
|
||||
{ \
|
||||
intptr_t i, opr_sz = simd_oprsz(desc), odd = H(sizeof(TYPEN)); \
|
||||
for (i = 0; i < opr_sz; i += sizeof(TYPE)) { \
|
||||
TYPE nn = *(TYPE *)(vn + i); \
|
||||
*(TYPEN *)(vd + i + odd) = OP(nn); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DO_SQXTN_H(n) do_sat_bhs(n, INT8_MIN, INT8_MAX)
|
||||
#define DO_SQXTN_S(n) do_sat_bhs(n, INT16_MIN, INT16_MAX)
|
||||
#define DO_SQXTN_D(n) do_sat_bhs(n, INT32_MIN, INT32_MAX)
|
||||
|
||||
DO_XTNB(sve2_sqxtnb_h, int16_t, DO_SQXTN_H)
|
||||
DO_XTNB(sve2_sqxtnb_s, int32_t, DO_SQXTN_S)
|
||||
DO_XTNB(sve2_sqxtnb_d, int64_t, DO_SQXTN_D)
|
||||
|
||||
DO_XTNT(sve2_sqxtnt_h, int16_t, int8_t, H1, DO_SQXTN_H)
|
||||
DO_XTNT(sve2_sqxtnt_s, int32_t, int16_t, H1_2, DO_SQXTN_S)
|
||||
DO_XTNT(sve2_sqxtnt_d, int64_t, int32_t, H1_4, DO_SQXTN_D)
|
||||
|
||||
#define DO_UQXTN_H(n) do_sat_bhs(n, 0, UINT8_MAX)
|
||||
#define DO_UQXTN_S(n) do_sat_bhs(n, 0, UINT16_MAX)
|
||||
#define DO_UQXTN_D(n) do_sat_bhs(n, 0, UINT32_MAX)
|
||||
|
||||
DO_XTNB(sve2_uqxtnb_h, uint16_t, DO_UQXTN_H)
|
||||
DO_XTNB(sve2_uqxtnb_s, uint32_t, DO_UQXTN_S)
|
||||
DO_XTNB(sve2_uqxtnb_d, uint64_t, DO_UQXTN_D)
|
||||
|
||||
DO_XTNT(sve2_uqxtnt_h, uint16_t, uint8_t, H1, DO_UQXTN_H)
|
||||
DO_XTNT(sve2_uqxtnt_s, uint32_t, uint16_t, H1_2, DO_UQXTN_S)
|
||||
DO_XTNT(sve2_uqxtnt_d, uint64_t, uint32_t, H1_4, DO_UQXTN_D)
|
||||
|
||||
DO_XTNB(sve2_sqxtunb_h, int16_t, DO_UQXTN_H)
|
||||
DO_XTNB(sve2_sqxtunb_s, int32_t, DO_UQXTN_S)
|
||||
DO_XTNB(sve2_sqxtunb_d, int64_t, DO_UQXTN_D)
|
||||
|
||||
DO_XTNT(sve2_sqxtunt_h, int16_t, int8_t, H1, DO_UQXTN_H)
|
||||
DO_XTNT(sve2_sqxtunt_s, int32_t, int16_t, H1_2, DO_UQXTN_S)
|
||||
DO_XTNT(sve2_sqxtunt_d, int64_t, int32_t, H1_4, DO_UQXTN_D)
|
||||
|
||||
#undef DO_XTNB
|
||||
#undef DO_XTNT
|
||||
|
||||
void HELPER(sve2_adcl_s)(void *vd, void *vn, void *vm, void *va, uint32_t desc)
|
||||
{
|
||||
intptr_t i, opr_sz = simd_oprsz(desc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue