On 3/8/24 11:53, Daniel Henrique Barboza wrote:
trans_vmv_x_s, trans_vmv_s_x, trans_vfmv_f_s and trans_vfmv_s_f aren't
setting vstart = 0 after execution. This is usually done by a helper in
vector_helper.c but these functions don't use helpers.

We'll set vstart after any potential 'over' brconds, and that will also
mandate a mark_vs_dirty() too.

Fixes: dedc53cbc9 ("target/riscv: rvv-1.0: integer scalar move instructions")
Signed-off-by: Daniel Henrique Barboza <dbarb...@ventanamicro.com>
---
  target/riscv/insn_trans/trans_rvv.c.inc | 17 +++++++++++++++--
  1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/target/riscv/insn_trans/trans_rvv.c.inc 
b/target/riscv/insn_trans/trans_rvv.c.inc
index e42728990e..f3caabc101 100644
--- a/target/riscv/insn_trans/trans_rvv.c.inc
+++ b/target/riscv/insn_trans/trans_rvv.c.inc
@@ -3356,6 +3356,13 @@ static void vec_element_storei(DisasContext *s, int vreg,
      store_element(val, tcg_env, endian_ofs(s, vreg, idx), s->sew);
  }
+static void vec_set_vstart_zero(void)
+{
+    TCGv_i32 t_zero = tcg_constant_i32(0);
+
+    tcg_gen_st_i32(t_zero, tcg_env, offsetof(CPURISCVState, vstart));
+}

If you have not removed cpu_vstart, then you must use tcg_gen_movi_i32.
You cannot write to the backing store behind tcg's back.


r~

Reply via email to