Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/riscv/insn_trans/trans_rvv.c.inc | 54 ++++++-------------------
1 file changed, 13 insertions(+), 41 deletions(-)
diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc
index caefd38216..4df9a40b44 100644
--- a/target/riscv/insn_trans/trans_rvv.c.inc
+++ b/target/riscv/insn_trans/trans_rvv.c.inc
@@ -1181,60 +1181,32 @@ static bool ldst_whole_trans(uint32_t vd, uint32_t rs1, uint32_t nf,
* Update vstart with the number of processed elements.
* Use the helper function if either:
* - vstart is not 0.
- * - the target has 32 bit registers and we are loading/storing 64 bit long
- * elements. This is to ensure that we process every element with a single
- * memory instruction.
*/
- bool use_helper_fn = !(s->vstart_eq_zero) ||
- (TCG_TARGET_REG_BITS == 32 && log2_esz == 3);
+ bool use_helper_fn = !s->vstart_eq_zero;
if (!use_helper_fn) {
- TCGv addr = tcg_temp_new();
uint32_t size = s->cfg_ptr->vlenb * nf;
TCGv_i64 t8 = tcg_temp_new_i64();
- TCGv_i32 t4 = tcg_temp_new_i32();
MemOp atomicity = MO_ATOM_NONE;
if (log2_esz == 0) {
atomicity = MO_ATOM_NONE;
} else {
atomicity = MO_ATOM_IFALIGN_PAIR;
}
- if (TCG_TARGET_REG_BITS == 64) {
- for (int i = 0; i < size; i += 8) {
- addr = get_address(s, rs1, i);
- if (is_load) {
- tcg_gen_qemu_ld_i64(t8, addr, s->mem_idx,
- MO_LE | MO_64 | atomicity);
- tcg_gen_st_i64(t8, tcg_env, vreg_ofs(s, vd) + i);
- } else {
- tcg_gen_ld_i64(t8, tcg_env, vreg_ofs(s, vd) + i);
- tcg_gen_qemu_st_i64(t8, addr, s->mem_idx,
- MO_LE | MO_64 | atomicity);
- }
- if (i == size - 8) {
- tcg_gen_movi_tl(cpu_vstart, 0);
- } else {
- tcg_gen_addi_tl(cpu_vstart, cpu_vstart, 8 >> log2_esz);
- }
+ for (int i = 0; i < size; i += 8) {
+ TCGv addr = get_address(s, rs1, i);
+ if (is_load) {
+ tcg_gen_qemu_ld_i64(t8, addr, s->mem_idx, MO_LEUQ | atomicity);
+ tcg_gen_st_i64(t8, tcg_env, vreg_ofs(s, vd) + i);
+ } else {
+ tcg_gen_ld_i64(t8, tcg_env, vreg_ofs(s, vd) + i);
+ tcg_gen_qemu_st_i64(t8, addr, s->mem_idx, MO_LEUQ | atomicity);
}
- } else {
- for (int i = 0; i < size; i += 4) {
- addr = get_address(s, rs1, i);
- if (is_load) {
- tcg_gen_qemu_ld_i32(t4, addr, s->mem_idx,
- MO_LE | MO_32 | atomicity);
- tcg_gen_st_i32(t4, tcg_env, vreg_ofs(s, vd) + i);
- } else {
- tcg_gen_ld_i32(t4, tcg_env, vreg_ofs(s, vd) + i);
- tcg_gen_qemu_st_i32(t4, addr, s->mem_idx,
- MO_LE | MO_32 | atomicity);
- }
- if (i == size - 4) {
- tcg_gen_movi_tl(cpu_vstart, 0);
- } else {
- tcg_gen_addi_tl(cpu_vstart, cpu_vstart, 4 >> log2_esz);
- }
+ if (i == size - 8) {
+ tcg_gen_movi_tl(cpu_vstart, 0);
+ } else {
+ tcg_gen_addi_tl(cpu_vstart, cpu_vstart, 8 >> log2_esz);
}
}
} else {
--
2.43.0