Skip to content

Commit 1bb0a11

Browse files
WIP
1 parent c79341a commit 1bb0a11

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/xsimd/arch/xsimd_emulated.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ namespace xsimd
230230
return r;
231231
}
232232

233+
// first
234+
template <class A, class T, size_t N = 8 * sizeof(T) * batch<T, A>::size>
235+
T XSIMD_INLINE first(batch<T, A> const& self, requires_arch<emulated<N>>) noexcept
236+
{
237+
return self.data[0];
238+
}
239+
233240
#if 0
234241
// count
235242
template <class A, class T, size_t N = 8 * sizeof(T) * batch<T, A>::size>

include/xsimd/arch/xsimd_sve.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,13 @@ namespace xsimd
949949
return svsel(index_predicate, broadcast<A, T>(val, sve {}), arg);
950950
}
951951

952+
// first
953+
template <class A, class T, typename std::enable_if<std::is_scalar<T>::value, void>::type>
954+
XSIMD_INLINE T first(batch<T, A> const& self, requires_arch<sve>) noexcept
955+
{
956+
return self.data[0];
957+
}
958+
952959
// all
953960
template <class A, class T, detail::sve_enable_all_t<T> = 0>
954961
XSIMD_INLINE bool all(batch_bool<T, A> const& arg, requires_arch<sve>) noexcept

0 commit comments

Comments
 (0)