Skip to content

Commit

Permalink
[RISCV] Apply the optimization of vle/vse for small sizes only to use…
Browse files Browse the repository at this point in the history
…r emulation.

This commit limits to used mode the use of a loop that emulates vle/vse
RVV instructions that avoids some overhead in user mode but is ineffective
in system mode.

Signed-off-by: Paolo Savini <[email protected]>
  • Loading branch information
PaoloS02 committed Oct 2, 2024
1 parent 9669f1a commit 0e316c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion target/riscv/vector_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,

VSTART_CHECK_EARLY_EXIT(env);

#ifdef CONFIG_USER_ONLY
/* For data sizes <= 64 bits and for LMUL=1 with VLEN=128 bits we get a
* better performance by doing a simple simulation of the load/store
* without the overhead of prodding the host RAM */
Expand Down Expand Up @@ -692,7 +693,7 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
vext_set_tail_elems_1s(evl, vd, desc, nf, esz, max_elems);
return;
}

#endif

vext_cont_ldst_elements(&info, base, env->vreg, env->vstart, evl, desc,
log2_esz, false);
Expand Down

0 comments on commit 0e316c5

Please sign in to comment.