From 22f24bb582641b0981e80814b3d0ba181308d0f5 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Tue, 15 Oct 2024 22:46:24 +0200 Subject: [PATCH] WIP --- include/xsimd/types/xsimd_rvv_register.hpp | 32 ++++++---------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/include/xsimd/types/xsimd_rvv_register.hpp b/include/xsimd/types/xsimd_rvv_register.hpp index 5c2702d32..371e918db 100644 --- a/include/xsimd/types/xsimd_rvv_register.hpp +++ b/include/xsimd/types/xsimd_rvv_register.hpp @@ -102,7 +102,14 @@ namespace xsimd const auto words = XSIMD_RVV_JOINT5(__riscv_vreinterpret_, u, s, m, vmul)(x); \ return XSIMD_RVV_JOINT5(__riscv_vreinterpret_, u, 8, m, vmul)(words); \ } \ - }; + }; \ + template <> \ + XSIMD_INLINE rvv_type_info::type \ + rvv_type_info::bitcast( \ + XSIMD_RVV_TYPE(u, 8, vmul) x) noexcept \ + { \ + return XSIMD_RVV_JOINT5(__riscv_vreinterpret_, t, s, m, vmul)(x); \ + } #define XSIMD_RVV_MAKE_TYPES(vmul) \ XSIMD_RVV_MAKE_TYPE(int8_t, i, 8, vmul) \ @@ -127,28 +134,7 @@ namespace xsimd #undef XSIMD_RVV_MAKE_TYPES #undef XSIMD_RVV_MAKE_TYPE - // Specialization needed for #1058 - template <> - XSIMD_INLINE rvv_type_info::type - rvv_type_info::bitcast<__rvv_uint8m8_t>( - __rvv_uint8m8_t x) noexcept - { - return __riscv_vreinterpret_i8m8(x); - } - template <> - XSIMD_INLINE rvv_type_info::type - rvv_type_info::bitcast<__rvv_uint8m1_t>( - __rvv_uint8m1_t x) noexcept - { - return __riscv_vreinterpret_i8m1(x); - } - template <> - XSIMD_INLINE rvv_type_info::type - rvv_type_info::bitcast<__rvv_uint8m1_t>( - __rvv_uint8m1_t x) noexcept - { - return __riscv_vreinterpret_u32m1(x); - } + // Specialization of as_bytes needed for #1058 template <> XSIMD_INLINE rvv_type_info::byte_type rvv_type_info::as_bytes<__rvv_int8m8_t>(__rvv_int8m8_t x) noexcept