|
10 | 10 | #ifndef XSIMD_RVV_HPP |
11 | 11 | #define XSIMD_RVV_HPP |
12 | 12 |
|
13 | | -#include <complex> |
14 | | -#include <type_traits> |
15 | | -#include <utility> |
| 13 | +//#include <complex> |
| 14 | +//#include <type_traits> |
| 15 | +//#include <utility> |
16 | 16 |
|
17 | 17 | #include "../types/xsimd_rvv_register.hpp" |
18 | 18 | #include "xsimd_constants.hpp" |
|
76 | 76 | #define XSIMD_RVV_M , _M, |
77 | 77 | #define XSIMD_RVV_TSM XSIMD_RVV_T XSIMD_RVV_S XSIMD_RVV_M |
78 | 78 |
|
| 79 | +#define XSIMD_RVV_MASKED _m |
| 80 | + |
79 | 81 | // XSIMD_RVV_OVERLOAD, below, expands to a head section, a number of body sections |
80 | 82 | // (depending on which types are supported), and a tail section. Different |
81 | 83 | // variants of these sections are implemented with different suffixes on the |
@@ -1507,6 +1509,16 @@ namespace xsimd |
1507 | 1509 | const auto mask = abs(arg) < constants::maxflint<batch<T, A>>(); |
1508 | 1510 | return select(mask, to_float(detail::rvvfcvt_default(arg)), arg, rvv {}); |
1509 | 1511 | } |
| 1512 | + |
| 1513 | + // mask |
| 1514 | + template <class A, class T> |
| 1515 | + XSIMD_INLINE uint64_t mask(batch_bool<T, A> const& self, requires_arch<rvv>) noexcept |
| 1516 | + { |
| 1517 | + auto ones = detail::broadcast<as_unsigned_integer_t<T>, A::width>(1); |
| 1518 | + auto iota = vindex<A, T>(); |
| 1519 | + auto powers = detail::rvvsll(ones, iota); |
| 1520 | + return __riscv_vredor(self.data, powers); |
| 1521 | + } |
1510 | 1522 | } // namespace kernel |
1511 | 1523 | } // namespace xsimd |
1512 | 1524 |
|
|
0 commit comments