Skip to content

Commit feb61be

Browse files
Fix RiscV build
1 parent 319d9c7 commit feb61be

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

include/xsimd/arch/xsimd_rvv.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ namespace xsimd
513513
return __riscv_vset(tmp, 1, hi);
514514
}
515515

516-
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int>::type = 0> D_INLINE rvv_reg_t<T, W * 2> rvvabut(rvv_reg_t<T, W> const& lo, rvv_reg_t<T, W> const& hi) noexcept
516+
template <class T, size_t W, std::enable_if_t<W < types::detail::rvv_width_m1, int> = 0>
517+
XSIMD_INLINE rvv_reg_t<T, W * 2> rvvabut(rvv_reg_t<T, W> const& lo, rvv_reg_t<T, W> const& hi) noexcept
517518
{
518519
return __riscv_vslideup(lo, hi, lo.vl, lo.vl * 2);
519520
}
@@ -533,12 +534,14 @@ namespace xsimd
533534
typename rvv_reg_t<T, W>::register_type tmp = rvvget_hi_(T {}, vv);
534535
return tmp;
535536
}
536-
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int> = 0> rvv_reg_t<T, W> rvvget_lo(rvv_reg_t<T, W * 2> const& vv) noexcept
537+
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int> = 0>
538+
rvv_reg_t<T, W> rvvget_lo(rvv_reg_t<T, W * 2> const& vv) noexcept
537539
{
538540
typename rvv_reg_t<T, W>::register_type tmp = vv;
539541
return tmp;
540542
}
541-
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int>::type = 0> reg_t<T, W> rvvget_hi(rvv_reg_t<T, W * 2> const& vv) noexcept
543+
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int> = 0>
544+
rvv_reg_t<T, W> rvvget_hi(rvv_reg_t<T, W * 2> const& vv) noexcept
542545
{
543546
return __riscv_vslidedown(vv, vv.vl / 2, vv.vl);
544547
}

include/xsimd/types/xsimd_rvv_register.hpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,25 @@ namespace xsimd
219219
type get() const { return value; }
220220
void set(type v) { value = v; }
221221
};
222+
223+
template <size_t div>
224+
struct semitype;
225+
template <>
226+
struct semitype<2>
227+
{
228+
using type = vuint8mf2_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF2)));
229+
};
230+
template <>
231+
struct semitype<4>
232+
{
233+
using type = vuint8mf4_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF4)));
234+
};
235+
template <>
236+
struct semitype<8>
237+
{
238+
using type = vuint8mf8_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF8)));
239+
};
240+
222241
//
223242
// But sometimes we want our storage type to be less than a whole
224243
// register, while presenting as a whole register to the outside
@@ -233,23 +252,6 @@ namespace xsimd
233252
using super = rvv_type_info<T, rvv_width_m1>;
234253
static constexpr size_t width = rvv_width_m1 / divisor;
235254
using typename super::type;
236-
template <size_t div>
237-
struct semitype;
238-
template <>
239-
struct semitype<2>
240-
{
241-
using type = vuint8mf2_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF2)));
242-
};
243-
template <>
244-
struct semitype<4>
245-
{
246-
using type = vuint8mf4_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF4)));
247-
};
248-
template <>
249-
struct semitype<8>
250-
{
251-
using type = vuint8mf8_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF8)));
252-
};
253255
using fixed_type = typename semitype<divisor>::type;
254256
using super::as_bytes;
255257
using super::bitcast;

0 commit comments

Comments
 (0)