mirror of
https://github.com/qemu/qemu.git
synced 2024-12-11 20:53:51 +08:00
target/arm: Implement SVE2 saturating multiply (indexed)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-58-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
c5c455d783
commit
b95f5eebf6
@ -2688,3 +2688,8 @@ DEF_HELPER_FLAGS_5(sve2_sqdmlsl_idx_s, TCG_CALL_NO_RWG,
|
||||
void, ptr, ptr, ptr, ptr, i32)
|
||||
DEF_HELPER_FLAGS_5(sve2_sqdmlsl_idx_d, TCG_CALL_NO_RWG,
|
||||
void, ptr, ptr, ptr, ptr, i32)
|
||||
|
||||
DEF_HELPER_FLAGS_4(sve2_sqdmull_idx_s, TCG_CALL_NO_RWG,
|
||||
void, ptr, ptr, ptr, i32)
|
||||
DEF_HELPER_FLAGS_4(sve2_sqdmull_idx_d, TCG_CALL_NO_RWG,
|
||||
void, ptr, ptr, ptr, i32)
|
||||
|
@ -255,6 +255,12 @@
|
||||
@rrx_2 ........ .. . index:2 rm:3 ...... rn:5 rd:5 &rrx_esz
|
||||
@rrx_1 ........ .. . index:1 rm:4 ...... rn:5 rd:5 &rrx_esz
|
||||
|
||||
# Two registers and a scalar by N-bit index, alternate
|
||||
@rrx_3a ........ .. . .. rm:3 ...... rn:5 rd:5 \
|
||||
&rrx_esz index=%index3_19_11
|
||||
@rrx_2a ........ .. . . rm:4 ...... rn:5 rd:5 \
|
||||
&rrx_esz index=%index2_20_11
|
||||
|
||||
# Three registers and a scalar by N-bit index
|
||||
@rrxr_3 ........ .. . .. rm:3 ...... rn:5 rd:5 \
|
||||
&rrxr_esz ra=%reg_movprfx index=%index3_22_19
|
||||
@ -817,6 +823,12 @@ SQDMLSLB_zzxw_d 01000100 11 1 ..... 0011.0 ..... ..... @rrxr_2a esz=3
|
||||
SQDMLSLT_zzxw_s 01000100 10 1 ..... 0011.1 ..... ..... @rrxr_3a esz=2
|
||||
SQDMLSLT_zzxw_d 01000100 11 1 ..... 0011.1 ..... ..... @rrxr_2a esz=3
|
||||
|
||||
# SVE2 saturating multiply (indexed)
|
||||
SQDMULLB_zzx_s 01000100 10 1 ..... 1110.0 ..... ..... @rrx_3a esz=2
|
||||
SQDMULLB_zzx_d 01000100 11 1 ..... 1110.0 ..... ..... @rrx_2a esz=3
|
||||
SQDMULLT_zzx_s 01000100 10 1 ..... 1110.1 ..... ..... @rrx_3a esz=2
|
||||
SQDMULLT_zzx_d 01000100 11 1 ..... 1110.1 ..... ..... @rrx_2a esz=3
|
||||
|
||||
# SVE2 integer multiply (indexed)
|
||||
MUL_zzx_h 01000100 0. 1 ..... 111110 ..... ..... @rrx_3 esz=1
|
||||
MUL_zzx_s 01000100 10 1 ..... 111110 ..... ..... @rrx_2 esz=2
|
||||
|
@ -1565,6 +1565,26 @@ DO_ZZXW(sve2_sqdmlsl_idx_d, int64_t, int32_t, , H1_4, DO_SQDMLSL_D)
|
||||
|
||||
#undef DO_ZZXW
|
||||
|
||||
#define DO_ZZX(NAME, TYPEW, TYPEN, HW, HN, OP) \
|
||||
void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
|
||||
{ \
|
||||
intptr_t i, j, oprsz = simd_oprsz(desc); \
|
||||
intptr_t sel = extract32(desc, SIMD_DATA_SHIFT, 1) * sizeof(TYPEN); \
|
||||
intptr_t idx = extract32(desc, SIMD_DATA_SHIFT + 1, 3) * sizeof(TYPEN); \
|
||||
for (i = 0; i < oprsz; i += 16) { \
|
||||
TYPEW mm = *(TYPEN *)(vm + HN(i + idx)); \
|
||||
for (j = 0; j < 16; j += sizeof(TYPEW)) { \
|
||||
TYPEW nn = *(TYPEN *)(vn + HN(i + j + sel)); \
|
||||
*(TYPEW *)(vd + HW(i + j)) = OP(nn, mm); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
DO_ZZX(sve2_sqdmull_idx_s, int32_t, int16_t, H1_4, H1_2, do_sqdmull_s)
|
||||
DO_ZZX(sve2_sqdmull_idx_d, int64_t, int32_t, , H1_4, do_sqdmull_d)
|
||||
|
||||
#undef DO_ZZX
|
||||
|
||||
#define DO_BITPERM(NAME, TYPE, OP) \
|
||||
void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
|
||||
{ \
|
||||
|
@ -3866,6 +3866,20 @@ DO_SVE2_RRX(trans_MUL_zzx_d, gen_helper_gvec_mul_idx_d)
|
||||
|
||||
#undef DO_SVE2_RRX
|
||||
|
||||
#define DO_SVE2_RRX_TB(NAME, FUNC, TOP) \
|
||||
static bool NAME(DisasContext *s, arg_rrx_esz *a) \
|
||||
{ \
|
||||
return do_sve2_zzz_data(s, a->rd, a->rn, a->rm, \
|
||||
(a->index << 1) | TOP, FUNC); \
|
||||
}
|
||||
|
||||
DO_SVE2_RRX_TB(trans_SQDMULLB_zzx_s, gen_helper_sve2_sqdmull_idx_s, false)
|
||||
DO_SVE2_RRX_TB(trans_SQDMULLB_zzx_d, gen_helper_sve2_sqdmull_idx_d, false)
|
||||
DO_SVE2_RRX_TB(trans_SQDMULLT_zzx_s, gen_helper_sve2_sqdmull_idx_s, true)
|
||||
DO_SVE2_RRX_TB(trans_SQDMULLT_zzx_d, gen_helper_sve2_sqdmull_idx_d, true)
|
||||
|
||||
#undef DO_SVE2_RRX_TB
|
||||
|
||||
static bool do_sve2_zzzz_data(DisasContext *s, int rd, int rn, int rm, int ra,
|
||||
int data, gen_helper_gvec_4 *fn)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user