From 7c1a2f583d36009544a2e584000928ce5a59d2e9 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Tue, 29 Oct 2024 09:07:46 +0100 Subject: [PATCH] Force zero tail for risc-v vcompress Fix #1060 --- include/xsimd/arch/xsimd_rvv.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/xsimd/arch/xsimd_rvv.hpp b/include/xsimd/arch/xsimd_rvv.hpp index 75f1145cd..ef00e7567 100644 --- a/include/xsimd/arch/xsimd_rvv.hpp +++ b/include/xsimd/arch/xsimd_rvv.hpp @@ -1129,13 +1129,14 @@ namespace xsimd *************/ namespace detail { - XSIMD_RVV_OVERLOAD(rvvcompress, (__riscv_vcompress), , vec(vec, bvec)) + XSIMD_RVV_OVERLOAD(rvvcompress, (__riscv_vcompress_tu), , vec(vec, vec, bvec)) } // compress template XSIMD_INLINE batch compress(batch const& x, batch_bool const& mask, requires_arch) noexcept { - return detail::rvvcompress(x, mask); + auto zero = broadcast(T(0), rvv {}); + return detail::rvvcompress(zero, x, mask); } /***************