On 2/16/24 03:57, Daniel Henrique Barboza wrote:
In the Vector spec section 3.2 [1]:
"When mstatus.VS is set to Initial or Clean, executing any instruction
that changes vector state, including the vector CSRs, will change
mstatus.VS to Dirty."
ldst_us_trans(), ldst_stride_trans(), ldst_index_trans() and
ldst_whole_trans() will change vector state regardless of being a store
op or not. Stores will set env->vstart to zero after execution (see
vext_ldst_us() in vector_helper.c), and this is vector CSR state change.
In Initial or Clean state, it could be argued that vstart is already zero, so is there
really a change to state?
OTOH, on the exception path out of a vector store, where we *do* set vstart != 0, we do
not also set vs dirty.
Therefore I think that loads and stores need to manage dirty within the helper, alongside
the management of vstart, or perhaps move the mark_vs_dirty call to *before* the call to
the helper.
r~