Skip to content
STIMSMITH

ldst_index_trans

Technique

ldst_index_trans() is a static helper in QEMU's RISC-V vector translation file (trans_rvv.c.inc) that translates indexed vector load/store instructions. The patch series 'trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too' modifies ldst_index_trans() along with sibling helpers to unconditionally invoke mark_vs_dirty(), because vector stores modify the vstart CSR (a vector-state CSR) and therefore must transition mstatus.VS to Dirty per RISC-V Vector spec section 3.2.

First seen 7/29/2026
Last seen 7/29/2026
Evidence 1 chunks
Wiki v1

WIKI

ldst_index_trans

Overview

ldst_index_trans() is a translation-time helper for indexed RISC-V vector load/store instructions (the segment of the V extension whose addressing combines a base register rs1 with an index vector vs2). It lives in target/riscv/insn_trans/trans_rvv.c.inc, the QEMU TCG translation include that materializes every RISC-V Vector instruction, and is part of a family of helpers (ldst_us_trans, ldst_stride_trans, ldst_index_trans, ldst_whole_trans) that share the same overall structure for unit-stride, stride, indexed, and whole-register load/store variants.

READ FULL ARTICLE →

NEIGHBORHOOD

No graph connections found for this entity yet. It may appear in future ingestion runs.

explore full graph →

RELATIONSHIPS

2 connections
mark_vs_dirty uses → 98% 1e
ldst_index_trans() must call mark_vs_dirty() unconditionally to reflect changes in vector CSR state.
trans_rvv.c.inc part of → 95% 1e
ldst_index_trans() is defined in trans_rvv.c.inc.

CITATIONS

5 sources
5 citations — click to expand
[1] ldst_index_trans() originally guarded its mark_vs_dirty() call with `if (!is_store)`, which the patch removes. [PATCH 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too
[2] Per RISC-V Vector spec section 3.2, executing any instruction that changes vector state, including vector CSRs, must transition mstatus.VS to Dirty. [PATCH 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too
[3] Vector stores executed through ldst_index_trans reset env->vstart to zero in vext_ldst_us() in vector_helper.c, which is a vector-state CSR change that requires mark_vs_dirty(). [PATCH 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too
[4] The fix is part of a patch series that makes the same unconditional mark_vs_dirty() change in ldst_us_trans, ldst_stride_trans, ldst_index_trans, and ldst_whole_trans in target/riscv/insn_trans/trans_rvv.c.inc (4 insertions, 15 deletions). [PATCH 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too
[5] The patch Fixes commit 8e1ee1fb57 ('target/riscv: rvv-1.0: add translation-time vector context status'), which introduced the original guarded mark_vs_dirty() calls. [PATCH 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too