From 8026095224080a8c426d1b720d30a2851d13ea72 Mon Sep 17 00:00:00 2001 From: Alex Chiang Date: Mon, 25 Mar 2024 01:27:01 -0700 Subject: [PATCH] Optimized rvv slide_hash Signed-off-by: Alex Chiang --- arch/riscv/slide_hash_rvv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/riscv/slide_hash_rvv.c b/arch/riscv/slide_hash_rvv.c index d8fa4626..ac28bbd9 100644 --- a/arch/riscv/slide_hash_rvv.c +++ b/arch/riscv/slide_hash_rvv.c @@ -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; } } -- 2.47.2