]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Optimized rvv slide_hash
authorAlex Chiang <alex.chiang@sifive.com>
Mon, 25 Mar 2024 08:27:01 +0000 (01:27 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 4 Apr 2024 11:48:54 +0000 (13:48 +0200)
Signed-off-by: Alex Chiang <alex.chiang@sifive.com>
arch/riscv/slide_hash_rvv.c

index d8fa46264ab5fab5341632ec6395c60bee5736e1..ac28bbd9f26e5ee9b509d5233a835a09aed1fa7c 100644 (file)
@@ -16,10 +16,8 @@ static inline void slide_hash_chain(Pos *table, uint32_t entries, uint16_t wsize
     while (entries > 0) {
         vl = __riscv_vsetvl_e16m4(entries);
         vuint16m4_t v_tab = __riscv_vle16_v_u16m4(table, vl);
-        vuint16m4_t v_diff = __riscv_vsub_vx_u16m4(v_tab, wsize, vl);
-        vbool4_t mask = __riscv_vmsltu_vx_u16m4_b4(v_tab, wsize, vl);
-        v_tab = __riscv_vmerge_vxm_u16m4(v_diff, 0, mask, vl);
-        __riscv_vse16_v_u16m4(table, v_tab, vl);
+        vuint16m4_t v_diff = __riscv_vssubu_vx_u16m4(v_tab, wsize, vl);
+        __riscv_vse16_v_u16m4(table, v_diff, vl);
         table += vl, entries -= vl;
     }
 }