|
From: | Richard Henderson |
Subject: | Re: [PATCH v2 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too |
Date: | Fri, 16 Feb 2024 09:06:45 -1000 |
User-agent: | Mozilla Thunderbird |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |