Skip to content

Commit 8705787

Browse files
committed
Fix template argument order for batch_bool loads
`batch_bool<T, A>::load_(un)aligned` dispatches to `kernel::load_(un)aligned<A>`, which requires that the architecture be the first template parameter.
1 parent 21f4b7c commit 8705787

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

include/xsimd/arch/xsimd_avx2.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ namespace xsimd
573573

574574
// load_unaligned<batch_bool>
575575

576-
template <class T, class A, class = typename std::enable_if<std::is_integral<T>::value>::type>
576+
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
577577
XSIMD_INLINE batch_bool<T, A> load_unaligned(bool const* mem, batch_bool<T, A>, requires_arch<avx2>) noexcept
578578
{
579579
XSIMD_IF_CONSTEXPR(sizeof(T) == 1)

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,39 +574,39 @@ namespace xsimd
574574
}
575575

576576
/* batch bool version */
577-
template <class T, class A, detail::enable_sized_t<T, 1> = 0>
577+
template <class A, class T, detail::enable_sized_t<T, 1> = 0>
578578
XSIMD_INLINE batch_bool<T, A> load_unaligned(bool const* mem, batch_bool<T, A>, requires_arch<neon>) noexcept
579579
{
580580
auto vmem = load_unaligned<A>((unsigned char const*)mem, convert<unsigned char> {}, A {});
581581
return { 0 - vmem.data };
582582
}
583-
template <class T, class A, detail::enable_sized_t<T, 1> = 0>
583+
template <class A, class T, detail::enable_sized_t<T, 1> = 0>
584584
XSIMD_INLINE batch_bool<T, A> load_aligned(bool const* mem, batch_bool<T, A> t, requires_arch<neon> r) noexcept
585585
{
586586
return load_unaligned(mem, t, r);
587587
}
588588

589-
template <class T, class A, detail::enable_sized_t<T, 2> = 0>
589+
template <class A, class T, detail::enable_sized_t<T, 2> = 0>
590590
XSIMD_INLINE batch_bool<T, A> load_unaligned(bool const* mem, batch_bool<T, A>, requires_arch<neon>) noexcept
591591
{
592592
uint16x8_t vmem = vmovl_u8(vld1_u8((unsigned char const*)mem));
593593
return { 0 - vmem };
594594
}
595595

596-
template <class T, class A, detail::enable_sized_t<T, 2> = 0>
596+
template <class A, class T, detail::enable_sized_t<T, 2> = 0>
597597
XSIMD_INLINE batch_bool<T, A> load_aligned(bool const* mem, batch_bool<T, A> t, requires_arch<neon> r) noexcept
598598
{
599599
return load_unaligned(mem, t, r);
600600
}
601601

602-
template <class T, class A, detail::enable_sized_t<T, 4> = 0>
602+
template <class A, class T, detail::enable_sized_t<T, 4> = 0>
603603
XSIMD_INLINE batch_bool<T, A> load_unaligned(bool const* mem, batch_bool<T, A>, requires_arch<neon>) noexcept
604604
{
605605
uint8x8_t tmp = vreinterpret_u8_u32(vset_lane_u32(*(unsigned int*)mem, vdup_n_u32(0), 0));
606606
return { 0 - vmovl_u16(vget_low_u16(vmovl_u8(tmp))) };
607607
}
608608

609-
template <class T, class A, detail::enable_sized_t<T, 4> = 0>
609+
template <class A, class T, detail::enable_sized_t<T, 4> = 0>
610610
XSIMD_INLINE batch_bool<T, A> load_aligned(bool const* mem, batch_bool<T, A> t, requires_arch<neon> r) noexcept
611611
{
612612
return load_unaligned(mem, t, r);

include/xsimd/arch/xsimd_sse4_1.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ namespace xsimd
125125

126126
// load_unaligned<batch_bool>
127127

128-
template <class T, class A, class = typename std::enable_if<(std::is_integral<T>::value && sizeof(T) > 1)>::type>
128+
template <class A, class T, class = typename std::enable_if<(std::is_integral<T>::value && sizeof(T) > 1)>::type>
129129
XSIMD_INLINE batch_bool<T, A> load_unaligned(bool const* mem, batch_bool<T, A>, requires_arch<sse4_1>) noexcept
130130
{
131131
// GCC <12 have missing or buggy unaligned load intrinsics; use memcpy to work around this.

0 commit comments

Comments
 (0)