Skip to content

Commit 2408302

Browse files
kalenedraelserge-sans-paille
authored andcommitted
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 0f44c97 commit 2408302

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
@@ -575,39 +575,39 @@ namespace xsimd
575575
}
576576

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

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

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

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

610-
template <class T, class A, detail::enable_sized_t<T, 4> = 0>
610+
template <class A, class T, detail::enable_sized_t<T, 4> = 0>
611611
XSIMD_INLINE batch_bool<T, A> load_aligned(bool const* mem, batch_bool<T, A> t, requires_arch<neon> r) noexcept
612612
{
613613
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)