target/arm: Implement SME2 MOVA to/from array, multiple registers

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250704142112.1018902-27-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2025-07-04 08:19:49 -06:00 committed by Peter Maydell
parent 72cd08eb76
commit e9de40e538
3 changed files with 47 additions and 0 deletions

View file

@ -27,6 +27,8 @@ ZERO_zt0 11000000 01 001 00000000000 00000001
### SME Move into/from Array
%mova_rs 13:2 !function=plus_12
%mova_rv 13:2 !function=plus_8
&mova_a rv zr off
&mova_p esz rs pg zr za off v:bool
&mova_t esz rs zr za off v:bool
@ -88,6 +90,16 @@ MOVA_zt4 11000000 10 00011 0 v:1 .. 001 000 za:2 zr:3 00 \
MOVA_zt4 11000000 11 00011 0 v:1 .. 001 00 za:3 zr:3 00 \
&mova_t rs=%mova_rs esz=3 off=0
MOVA_az2 11000000 00 00010 00 .. 010 zr:4 000 off:3 \
&mova_a rv=%mova_rv
MOVA_az4 11000000 00 00010 00 .. 011 zr:3 0000 off:3 \
&mova_a rv=%mova_rv
MOVA_za2 11000000 00 00011 00 .. 010 00 off:3 zr:4 0 \
&mova_a rv=%mova_rv
MOVA_za4 11000000 00 00011 00 .. 011 00 off:3 zr:3 00 \
&mova_a rv=%mova_rv
### SME Move into/from ZT0
MOVT_rzt 1100 0000 0100 1100 0 off:3 00 11111 rt:5

View file

@ -298,6 +298,36 @@ TRANS_FEAT(MOVA_tz4, aa64_sme2, do_mova_tile_n, a, 4, false)
TRANS_FEAT(MOVA_zt2, aa64_sme2, do_mova_tile_n, a, 2, true)
TRANS_FEAT(MOVA_zt4, aa64_sme2, do_mova_tile_n, a, 4, true)
static bool do_mova_array_n(DisasContext *s, arg_mova_a *a, int n, bool to_vec)
{
TCGv_ptr t_za;
int svl;
if (!sme_smza_enabled_check(s)) {
return true;
}
svl = streaming_vec_reg_size(s);
t_za = get_zarray(s, a->rv, a->off, n, 0);
for (int i = 0; i < n; ++i) {
int o_za = (svl / n * sizeof(ARMVectorReg)) * i;
int o_zr = vec_full_reg_offset(s, a->zr * n + i);
if (to_vec) {
tcg_gen_gvec_mov_var(MO_8, tcg_env, o_zr, t_za, o_za, svl, svl);
} else {
tcg_gen_gvec_mov_var(MO_8, t_za, o_za, tcg_env, o_zr, svl, svl);
}
}
return true;
}
TRANS_FEAT(MOVA_az2, aa64_sme2, do_mova_array_n, a, 2, false)
TRANS_FEAT(MOVA_az4, aa64_sme2, do_mova_array_n, a, 4, false)
TRANS_FEAT(MOVA_za2, aa64_sme2, do_mova_array_n, a, 2, true)
TRANS_FEAT(MOVA_za4, aa64_sme2, do_mova_array_n, a, 4, true)
static bool do_movt(DisasContext *s, arg_MOVT_rzt *a,
void (*func)(TCGv_i64, TCGv_ptr, tcg_target_long))
{

View file

@ -210,6 +210,11 @@ static inline int plus_2(DisasContext *s, int x)
return x + 2;
}
static inline int plus_8(DisasContext *s, int x)
{
return x + 8;
}
static inline int plus_12(DisasContext *s, int x)
{
return x + 12;