Skip to content

Commit 5394ccf

Browse files
WIP
1 parent b201928 commit 5394ccf

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

include/xsimd/arch/xsimd_rvv.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ namespace xsimd
15181518
// (A) Easy case: the number of slots fits in T.
15191519
const auto zero = detail::broadcast<as_unsigned_integer_t<T>, types::detail::rvv_width_m1>(T(0));
15201520
auto ones = detail::broadcast<as_unsigned_integer_t<T>, A::width>(1);
1521-
auto iota = detail::vindex<A, as_unsigned_integer_t<T>>();
1521+
auto iota = detail::rvvid(as_unsigned_integer_t<T> {});
15221522
auto upowers = detail::rvvsll(ones, iota);
15231523
auto r = __riscv_vredor(self.data.as_mask(), upowers, (typename decltype(zero)::register_type)zero, batch_bool<T, A>::size);
15241524
return detail::reduce_scalar<A, as_unsigned_integer_t<T>>(r);
@@ -1539,18 +1539,17 @@ namespace xsimd
15391539
// The low part is similar to the approach in (A).
15401540
const auto zero = detail::broadcast<as_unsigned_integer_t<T>, types::detail::rvv_width_m1>(T(0));
15411541
auto ones = detail::broadcast<as_unsigned_integer_t<T>, A::width>(1);
1542-
auto iota = detail::vindex<A, as_unsigned_integer_t<T>>();
1543-
auto upowers_low = detail::rvvsll(ones, iota);
1542+
auto iota = detail::rvvid(as_unsigned_integer_t<T> {});
1543+
auto upowers = detail::rvvsll(ones, iota);
15441544
auto low_mask = self & make_batch_bool_constant<T, LowerHalf, A>();
1545-
auto r_low = __riscv_vredor(low_mask.data.as_mask(), upowers_low, (typename decltype(zero)::register_type)zero, batch_bool<T, A>::size);
1545+
auto r_low = __riscv_vredor(low_mask.data.as_mask(), upowers, (typename decltype(zero)::register_type)zero, batch_bool<T, A>::size);
15461546

15471547
// The high part requires a sub before the shift.
1548-
auto iota_high = __riscv_vsub(iota, 8 * sizeof(T), batch_bool<T, A>::size);
1549-
auto upowers_high = detail::rvvsll(ones, iota_high);
1548+
upowers = details::rvvslideup(upowers, 8 * sizeof(T));
15501549
auto high_mask = self & make_batch_bool_constant<T, UpperHalf, A>();
1551-
auto r_high = __riscv_vredor(high_mask.data.as_mask(), upowers_high, (typename decltype(zero)::register_type)zero, batch_bool<T, A>::size);
1550+
auto r_high = __riscv_vredor(high_mask.data.as_mask(), upowers, (typename decltype(zero)::register_type)zero, batch_bool<T, A>::size);
15521551

1553-
// Agglomerate the two parts.
1552+
// Concatenate the two parts.
15541553
return (uint64_t)detail::reduce_scalar<A, as_unsigned_integer_t<T>>(r_low) | ((uint64_t)detail::reduce_scalar<A, as_unsigned_integer_t<T>>(r_high) << (8 * sizeof(T)));
15551554
}
15561555
else

0 commit comments

Comments
 (0)