target/riscv: rvv: Fix missing exit TB flow for ldff_trans
PATCH 1/1 target/riscv: rvv: Fix missing exit TB flow for ldff_trans
According to the V spec, the vector fault-only-first load instructions may change the VL CSR.
So the ldff_trans TCG translation function should generate the lookup_and_goto_ptr flow as the vsetvl/vsetvli translation function to make sure the vl_eq_vlmax TB flag is correct.
--- target/riscv/insn_trans/trans_rvv.c.inc | 6 ++++++ 1 file changed, 6 insertions(+)
target/riscv/insn_trans/trans_rvv.c.inc +6 -0
@@ -1361,6 +1361,12 @@ static bool ldff_trans(uint32_t vd, uint32_t rs1, uint32_t data, fn(dest, mask, base, tcg_env, desc); finalize_rvv_inst(s); + + /* vector unit-stride fault-only-first load may modify vl CSR */ + gen_update_pc(s, s->cur_insn_len); + lookup_and_goto_ptr(s); + s->base.is_jmp = DISAS_NORETURN; + return true; }
Signature · 1 line
2.43.0
Quoted 18 lines · Max Chou
According to the V spec, the vector fault-only-first load instructions may change the VL CSR.
So theldff_transTCG translation function should generate thelookup_and_goto_ptrflow as the vsetvl/vsetvli translation function to make sure thevl_eq_vlmaxTB flag is correct.Signed-off-by Max Chou <[email protected]>--- target/riscv/insn_trans/trans_rvv.c.inc | 6 ++++++ 1 file changed, 6 insertions(+)target/riscv/insn_trans/trans_rvv.c.inc +0
-0@@ -1361,6 +1361,12 @@ static bool ldff_trans(uint32_t vd, uint32_t rs1, uint32_t data, fn(dest, mask, base, tcg_env, desc);
target/riscv/insn_trans/trans_rvv.c.inc static bool ldff_trans(uint32_t vd, uint32_t rs1, uint32_t data, · line 1372
Quoted 10 lines
target/riscv/insn_trans/trans_rvv.c.inc +6
-0finalize_rvv_inst(s); + + /* vector unit-stride fault-only-first load may modify vl CSR */ + gen_update_pc(s, s->cur_insn_len); + lookup_and_goto_ptr(s); + s->base.is_jmp = DISAS_NORETURN; + return true; }
r~
Alistair Francis
AppliedQuoted 8 lines · Max Chou
According to the V spec, the vector fault-only-first load instructions may change the VL CSR.
So theldff_transTCG translation function should generate thelookup_and_goto_ptrflow as the vsetvl/vsetvli translation function to make sure thevl_eq_vlmaxTB flag is correct.Signed-off-by Max Chou <[email protected]>
Thanks!
Applied to riscv-to-apply.next
Alistair
Quoted 25 lines
--- target/riscv/insn_trans/trans_rvv.c.inc | 6 ++++++ 1 file changed, 6 insertions(+)target/riscv/insn_trans/trans_rvv.c.inc +6
-1@@ -1361,6 +1361,12 @@ static bool ldff_trans(uint32_t vd, uint32_t rs1, uint32_t data, fn(dest, mask, base, tcg_env, desc); finalize_rvv_inst(s); + + /* vector unit-stride fault-only-first load may modify vl CSR */ + gen_update_pc(s, s->cur_insn_len); + lookup_and_goto_ptr(s); + s->base.is_jmp = DISAS_NORETURN; + return true; } --2.43.0