Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/cross-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- { platform: 'aarch64', arch: 'armv8-a', dir: 'aarch64-linux-gnu', flags: '', full: 'ON' }
sys:
- { compiler: 'gcc', version: '10' }
- { compiler: 'gcc', version: '14' }
steps:
- name: Setup compiler
if: ${{ matrix.sys.compiler == 'gcc' }}
Expand Down
16 changes: 12 additions & 4 deletions include/xsimd/arch/xsimd_neon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,28 +766,36 @@ namespace xsimd
XSIMD_INLINE void store(batch_bool<T, A> b, bool* mem, requires_arch<neon>) noexcept
{
uint8x16_t val = vshrq_n_u8(b.data, 7);
vst1q_u8((uint8_t*)mem, val);
alignas(A::alignment()) uint8_t buffer[batch_bool<T, A>::size];
vst1q_u8(buffer, val);
memcpy(mem, buffer, sizeof(buffer));
}

template <class T, class A, detail::enable_sized_t<T, 2> = 0>
XSIMD_INLINE void store(batch_bool<T, A> b, bool* mem, requires_arch<neon>) noexcept
{
uint8x8_t val = vshr_n_u8(vqmovn_u16(b.data), 7);
vst1_u8((uint8_t*)mem, val);
alignas(A::alignment()) uint8_t buffer[batch_bool<T, A>::size];
vst1_u8(buffer, val);
memcpy(mem, buffer, sizeof(buffer));
}

template <class T, class A, detail::enable_sized_t<T, 4> = 0>
XSIMD_INLINE void store(batch_bool<T, A> b, bool* mem, requires_arch<neon>) noexcept
{
uint8x8_t val = vshr_n_u8(vqmovn_u16(vcombine_u16(vqmovn_u32(b.data), vdup_n_u16(0))), 7);
vst1_lane_u32((uint32_t*)mem, vreinterpret_u32_u8(val), 0);
alignas(A::alignment()) uint8_t buffer[8];
vst1_u8(buffer, val);
memcpy(mem, buffer, batch_bool<T, A>::size);
}

template <class T, class A, detail::enable_sized_t<T, 8> = 0>
XSIMD_INLINE void store(batch_bool<T, A> b, bool* mem, requires_arch<neon>) noexcept
{
uint8x8_t val = vshr_n_u8(vqmovn_u16(vcombine_u16(vqmovn_u32(vcombine_u32(vqmovn_u64(b.data), vdup_n_u32(0))), vdup_n_u16(0))), 7);
vst1_lane_u16((uint16_t*)mem, vreinterpret_u16_u8(val), 0);
alignas(A::alignment()) uint8_t buffer[8];
vst1_u8(buffer, val);
memcpy(mem, buffer, batch_bool<T, A>::size);
}

template <class A>
Expand Down
4 changes: 1 addition & 3 deletions test/test_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct xsimd_api_test
batch_type b = batch_type::load(v.data(), xsimd::aligned_mode());
V res(size);

bool* b_data = new bool[size];
alignas(arch_type::alignment()) bool b_data[size];

xsimd::store_as(res.data(), b, xsimd::unaligned_mode());
INFO(name, " unaligned");
Expand All @@ -159,8 +159,6 @@ struct xsimd_api_test
xsimd::store_as(b_data, bb, xsimd::aligned_mode());
INFO(name, " batch_bool aligned");
CHECK_UNARY(std::accumulate(b_data, b_data + size, true, std::logical_and<bool>()));

delete[] b_data;
}

template <class T>
Expand Down
Loading