Skip to content

Commit c0caf45

Browse files
Optimize loading of batch_bool from memory on arm
Use the same approach as #1172
1 parent 005f629 commit c0caf45

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,20 @@ namespace xsimd
573573
return vld1q_f32(src);
574574
}
575575

576+
/* batch bool version */
577+
template <class T, class A, detail::enable_sized_t<T, 1> = 0>
578+
XSIMD_INLINE batch_bool<T, A> load_unaligned(bool const* mem, batch_bool<T, A>, requires_arch<neon>) noexcept
579+
{
580+
auto vmem = load_unaligned((unsigned char const*)mem, convert<bool>, T {});
581+
return bitwise_cast<T>(0 - vmem);
582+
}
583+
template <class T, class A, detail::enable_sized_t<T, 1> = 0>
584+
XSIMD_INLINE batch_bool<T, A> load_aligned(bool const* mem, batch_bool<T, A>, requires_arch<neon>) noexcept
585+
{
586+
auto vmem = load_aligned((unsigned char const*)mem, convert<bool>, T {});
587+
return bitwise_cast<T>(0 - vmem);
588+
}
589+
576590
/*********
577591
* store *
578592
*********/

0 commit comments

Comments
 (0)