Skip to content

Commit

Permalink
target/arm: Handle mte in do_ldrq, do_ldro
Browse files Browse the repository at this point in the history
These functions "use the standard load helpers", but
fail to clean_data_tbi or populate mtedesc.

Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20240207025210.8837-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 623507c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
rth7680 authored and Michael Tokarev committed Feb 16, 2024
1 parent da80471 commit 2d1a29e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions target/arm/tcg/translate-sve.c
Original file line number Diff line number Diff line change
Expand Up @@ -4861,8 +4861,13 @@ static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype)
unsigned vsz = vec_full_reg_size(s);
TCGv_ptr t_pg;
int poff;
uint32_t desc;

/* Load the first quadword using the normal predicated load helpers. */
if (!s->mte_active[0]) {
addr = clean_data_tbi(s, addr);
}

poff = pred_full_reg_offset(s, pg);
if (vsz > 16) {
/*
Expand All @@ -4886,7 +4891,8 @@ static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype)

gen_helper_gvec_mem *fn
= ldr_fns[s->mte_active[0]][s->be_data == MO_BE][dtype][0];
fn(tcg_env, t_pg, addr, tcg_constant_i32(simd_desc(16, 16, zt)));
desc = make_svemte_desc(s, 16, 1, dtype_msz(dtype), false, zt);
fn(tcg_env, t_pg, addr, tcg_constant_i32(desc));

/* Replicate that first quadword. */
if (vsz > 16) {
Expand Down Expand Up @@ -4929,6 +4935,7 @@ static void do_ldro(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype)
unsigned vsz_r32;
TCGv_ptr t_pg;
int poff, doff;
uint32_t desc;

if (vsz < 32) {
/*
Expand All @@ -4941,6 +4948,9 @@ static void do_ldro(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype)
}

/* Load the first octaword using the normal predicated load helpers. */
if (!s->mte_active[0]) {
addr = clean_data_tbi(s, addr);
}

poff = pred_full_reg_offset(s, pg);
if (vsz > 32) {
Expand All @@ -4965,7 +4975,8 @@ static void do_ldro(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype)

gen_helper_gvec_mem *fn
= ldr_fns[s->mte_active[0]][s->be_data == MO_BE][dtype][0];
fn(tcg_env, t_pg, addr, tcg_constant_i32(simd_desc(32, 32, zt)));
desc = make_svemte_desc(s, 32, 1, dtype_msz(dtype), false, zt);
fn(tcg_env, t_pg, addr, tcg_constant_i32(desc));

/*
* Replicate that first octaword.
Expand Down

0 comments on commit 2d1a29e

Please sign in to comment.