[PATCH 07/23] target/riscv: Remove vext_continuous_ldst_tlb

Richard Henderson <[email protected]>
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-devel
Message-ID <[email protected]>
Drop the usage in vext_page_ldst_us, merging the nf == 1
case into the vext_ldst_nf_tlb loop.
Inline it into the last use in vext_ldst_us.

Signed-off-by: Richard Henderson <[email protected]>
---
 target/riscv/tcg/vector_helper.c | 34 ++++++++++----------------------
 1 file changed, 10 insertions(+), 24 deletions(-)

diff --git a/target/riscv/tcg/vector_helper.c b/target/riscv/tcg/vector_helper.c
index a571982388..79c1d77a14 100644
--- a/target/riscv/tcg/vector_helper.c
+++ b/target/riscv/tcg/vector_helper.c
@@ -297,17 +297,6 @@ GEN_VEXT_HOST_ST_ELEM(ste_h, uint16_t, H2, stw_le)
 GEN_VEXT_HOST_ST_ELEM(ste_w, uint32_t, H4, stl_le)
 GEN_VEXT_HOST_ST_ELEM(ste_d, uint64_t, H8, stq_le)
 
-static inline QEMU_ALWAYS_INLINE void
-vext_continuous_ldst_tlb(CPURISCVState *env, vext_ldst_elem_fn_tlb *ldst_tlb,
-                         void *vd, uint32_t evl, target_ulong addr,
-                         uint32_t reg_start, uintptr_t ra, uint32_t esz)
-{
-    uint32_t i;
-    for (i = env->vstart; i < evl; env->vstart = ++i, addr += esz) {
-        ldst_tlb(env, adjust_addr(env, addr), i, vd, ra);
-    }
-}
-
 static void vext_set_tail_elems_1s(uint32_t vl, void *vd, uint32_t nf,
                                    uint32_t esz, uint32_t max_elems)
 {
@@ -456,15 +445,10 @@ vext_page_ldst_us(CPURISCVState *env, void *vd, target_ulong addr,
         }
         env->vstart += elems;
     } else {
-        if (nf == 1) {
-            vext_continuous_ldst_tlb(env, ldst_tlb, vd, evl, addr,
-                                     env->vstart, ra, esz);
-        } else {
-            for (uint32_t i = env->vstart; i < evl; env->vstart = ++i) {
-                vext_ldst_nf_tlb(env, vd, addr, i, nf, esz,
-                                 max_elems, ldst_tlb, ra);
-                addr += msize;
-            }
+        for (uint32_t i = env->vstart; i < evl; env->vstart = ++i) {
+            vext_ldst_nf_tlb(env, vd, addr, i, nf, esz,
+                             max_elems, ldst_tlb, ra);
+            addr += msize;
         }
     }
 }
@@ -487,13 +471,15 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
 
 #if defined(CONFIG_USER_ONLY)
     /*
-     * For data sizes <= 6 bytes we get better performance by simply calling
-     * vext_continuous_ldst_tlb
+     * For data sizes <= 6 bytes we get better performance
+     * by simply calling ldst_tlb.
      */
     if (nf == 1 && (evl << log2_esz) <= 6) {
         addr = base + (env->vstart << log2_esz);
-        vext_continuous_ldst_tlb(env, ldst_tlb, vd, evl, addr,
-                                 env->vstart, ra, esz);
+        for (uint32_t i = env->vstart; i < evl;
+             env->vstart = ++i, addr += esz) {
+            ldst_tlb(env, adjust_addr(env, addr), i, vd, ra);
+        }
         env->vstart = 0;
         if (vma) {
             vext_set_tail_elems_1s(evl, vd, nf, esz, max_elems);
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.