Skip to content

Commit 3565672

Browse files
WIP
1 parent 64e2960 commit 3565672

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/xsimd/arch/xsimd_rvv.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,19 @@ namespace xsimd
13351335
return result;
13361336
}
13371337

1338+
// first
1339+
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
1340+
XSIMD_INLINE T first(batch<T, A> const& arg, requires_arch<rvv>) noexcept
1341+
{
1342+
return detail::rvvmv_lane0(arg);
1343+
}
1344+
1345+
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
1346+
XSIMD_INLINE std::complex<T> first(batch<std::complex<T>, A> const& arg, requires_arch<rvv>) noexcept
1347+
{
1348+
return std::complex<T> { detail::rvvmv_lane0(arg.real()), detail::rvvmv_lane0(arg.imag()) };
1349+
}
1350+
13381351
// insert
13391352
template <class A, class T, size_t I, detail::rvv_enable_all_t<T> = 0>
13401353
XSIMD_INLINE batch<T, A> insert(batch<T, A> const& arg, T val, index<I>, requires_arch<rvv>) noexcept

0 commit comments

Comments
 (0)