Skip to content
Closed
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
51 changes: 50 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Setup compiler
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
arch: arm64
- name: Setup Ninja
run: |
python3 -m pip install --upgrade pip setuptools wheel
Expand All @@ -107,3 +107,52 @@ jobs:
run: cmake --build _build
- name: Testing xsimd
run: ./_build/test/test_xsimd
- name: Run benchmark
run: ./_build/benchmark/benchmark_xsimd
- name: Run example
run: ./_build/examples/mandelbrot

build-windows-arm64-clang:
name: 'MSYS2 CLANG64 arm64'
runs-on: windows-11-arm
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup MSYS2 with Clang (ARM64)
uses: msys2/setup-msys2@v2
with:
# CLANG64 environment: uses clang/clang++ targeting Windows ARM64 natively.
# This is the ARM64-native MSYS2 Clang toolchain — not a cross-compiler.
msystem: CLANG64
update: true
path-type: minimal
pacboy: >-
cc:p
cmake:p
ninja:p

- name: Checkout xsimd
uses: actions/checkout@v4

- name: Configure
run: |
cmake -B _build \
-DBUILD_TESTS=ON \
-DDOWNLOAD_DOCTEST=ON \
-DBUILD_BENCHMARK=ON \
-DBUILD_EXAMPLES=ON \
-DCMAKE_BUILD_TYPE=Release \
-G Ninja

- name: Build
run: cmake --build _build

- name: Test xsimd
run: ./_build/test/test_xsimd

- name: Run benchmark
run: ./_build/benchmark/benchmark_xsimd

- name: Run mandelbrot example
run: ./_build/examples/mandelbrot
11 changes: 10 additions & 1 deletion include/xsimd/arch/common/xsimd_common_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <algorithm>
#include <array>
#include <complex>
#include <cstdio>
#include <stdexcept>

#include "../../types/xsimd_batch_constant.hpp"
Expand Down Expand Up @@ -71,6 +72,9 @@ namespace xsimd
for (size_t i = 0; i < sizeof...(Is); ++i)
if ((bitmask >> i) & 1u)
std::swap(mask_buffer[inserted++], mask_buffer[i]);
// Fill remaining positions with the last valid index to avoid undefined behavior
for (size_t i = inserted; i < sizeof...(Is); ++i)
mask_buffer[i] = mask_buffer[inserted > 0 ? inserted - 1 : 0];
return batch<IT, A>::load_aligned(&mask_buffer[0]);
}
}
Expand All @@ -85,7 +89,12 @@ namespace xsimd
auto bitmask = mask.mask();
auto z = select(mask, x, batch<T, A>((T)0));
auto compress_mask = detail::create_compress_swizzle_mask<IT, A>(bitmask, std::make_index_sequence<size>());
return swizzle(z, compress_mask);
alignas(A::alignment()) IT mask_out[size];
compress_mask.store_aligned(&mask_out[0]);
alignas(A::alignment()) T z_out[size];
z.store_aligned(&z_out[0]);
auto res = swizzle(z, compress_mask);
return res;
}

// expand
Expand Down
Loading