aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorMax Chou <max.chou@sifive.com>2024-09-19 01:14:07 +0800
committerAlistair Francis <alistair.francis@wdc.com>2024-11-07 08:22:48 +1000
commit2f077842f2b356a086f70e54c831be53c6f0e101 (patch)
tree46c04a176a5f8903818d46ebf22480cd31e662b2 /target
parentb48381b1ee55053dfad6f5c10ca277bef29ee7c5 (diff)
target/riscv: rvv: Replace VSTART_CHECK_EARLY_EXIT in vext_ldst_us
Because the real vl (evl) of vext_ldst_us may be different (e.g. vlm.v/vsm.v/etc.), so the VSTART_CHECK_EARLY_EXIT checking function should be replaced by checking evl in vext_ldst_us. Signed-off-by: Max Chou <max.chou@sifive.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Message-ID: <20240918171412.150107-3-max.chou@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target')
-rw-r--r--target/riscv/vector_helper.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index ccb32e6122..93cac23a13 100644
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -277,7 +277,10 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
uint32_t max_elems = vext_max_elems(desc, log2_esz);
uint32_t esz = 1 << log2_esz;
- VSTART_CHECK_EARLY_EXIT(env);
+ if (env->vstart >= evl) {
+ env->vstart = 0;
+ return;
+ }
/* load bytes from guest memory */
for (i = env->vstart; i < evl; env->vstart = ++i) {