Skip to content

Commit 60e5289

Browse files
committed
Remove rvv_fix_char_t
1 parent 142c976 commit 60e5289

2 files changed

Lines changed: 9 additions & 19 deletions

File tree

include/xsimd/arch/xsimd_rvv.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,6 @@ namespace xsimd
288288
{
289289
namespace detail
290290
{
291-
template <class T>
292-
using rvv_fix_char_t = types::detail::rvv_fix_char_t<T>;
293291
template <class T, size_t Width = XSIMD_RVV_BITS>
294292
using rvv_reg_t = types::detail::rvv_reg_t<T, Width>;
295293
template <class T, size_t Width = XSIMD_RVV_BITS>
@@ -409,7 +407,7 @@ namespace xsimd
409407
// A bit of a dance, here, because rvvmv_splat has no other
410408
// argument from which to deduce type, and T=char is not
411409
// supported.
412-
detail::rvv_fix_char_t<T> arg_not_char(arg);
410+
project_num_t<T> arg_not_char(arg);
413411
const auto splat = detail::rvvmv_splat(arg_not_char);
414412
return detail::rvv_reg_t<T, Width>(splat.get_bytes(), types::detail::XSIMD_RVV_BITCAST);
415413
}
@@ -435,7 +433,7 @@ namespace xsimd
435433
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
436434
XSIMD_INLINE batch<T, A> load_aligned(T const* src, convert<T>, requires_arch<rvv>) noexcept
437435
{
438-
return detail::rvvle(reinterpret_cast<detail::rvv_fix_char_t<T> const*>(src));
436+
return detail::rvvle(reinterpret_cast<project_num_t<T> const*>(src));
439437
}
440438

441439
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
@@ -505,7 +503,7 @@ namespace xsimd
505503
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
506504
XSIMD_INLINE void store_aligned(T* dst, batch<T, A> const& src, requires_arch<rvv>) noexcept
507505
{
508-
detail::rvvse(reinterpret_cast<detail::rvv_fix_char_t<T>*>(dst), src);
506+
detail::rvvse(reinterpret_cast<project_num_t<T>*>(dst), src);
509507
}
510508

511509
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
@@ -536,7 +534,7 @@ namespace xsimd
536534
{
537535
using UU = as_unsigned_integer_t<U>;
538536
const auto uindex = detail::rvv_to_unsigned_batch(index);
539-
auto* base = reinterpret_cast<detail::rvv_fix_char_t<T>*>(dst);
537+
auto* base = reinterpret_cast<project_num_t<T>*>(dst);
540538
// or rvvsuxei
541539
const auto bi = detail::rvvmul_splat(uindex, sizeof(T));
542540
detail::rvvsoxei(base, bi, vals);
@@ -548,7 +546,7 @@ namespace xsimd
548546
{
549547
using UU = as_unsigned_integer_t<U>;
550548
const auto uindex = detail::rvv_to_unsigned_batch(index);
551-
auto const* base = reinterpret_cast<detail::rvv_fix_char_t<T> const*>(src);
549+
auto const* base = reinterpret_cast<project_num_t<T> const*>(src);
552550
// or rvvluxei
553551
const auto bi = detail::rvvmul_splat(uindex, sizeof(T));
554552
return detail::rvvloxei(base, bi);

include/xsimd/types/xsimd_rvv_register.hpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
#ifndef XSIMD_RVV_REGISTER_HPP
1414
#define XSIMD_RVV_REGISTER_HPP
1515

16-
#include "xsimd_common_arch.hpp"
17-
#include "xsimd_register.hpp"
16+
#include "../utils/xsimd_type_traits.hpp"
17+
#include "./xsimd_common_arch.hpp"
18+
#include "./xsimd_register.hpp"
1819

1920
#if XSIMD_WITH_RVV
2021
#include <riscv_vector.h>
@@ -287,15 +288,6 @@ namespace xsimd
287288
{
288289
};
289290

290-
// It's difficult dealing with both char and whichever *int8_t type
291-
// is compatible with char, so just avoid it altogether.
292-
//
293-
using rvv_char_t = std::conditional_t<std::is_signed<char>::value, int8_t, uint8_t>;
294-
template <class T>
295-
using rvv_fix_char_t = std::conditional_t<
296-
std::is_same<char, std::decay_t<T>>::value,
297-
rvv_char_t, T>;
298-
299291
// An explicit constructor isn't really explicit enough to allow
300292
// implicit bit-casting operations between incompatible types, so
301293
// we add this vacuous flag argument when we're serious:
@@ -334,7 +326,7 @@ namespace xsimd
334326
operator register_type() const noexcept { return value.get(); }
335327
};
336328
template <class T, size_t Width = XSIMD_RVV_BITS>
337-
using rvv_reg_t = std::conditional_t<!std::is_void<T>::value, rvv_reg<rvv_fix_char_t<T>, Width>, void>;
329+
using rvv_reg_t = std::conditional_t<!std::is_void<T>::value, rvv_reg<project_num_t<T>, Width>, void>;
338330

339331
// And some more of the same stuff for bool types, which have
340332
// similar problems and similar workarounds.

0 commit comments

Comments
 (0)