From d6edadfc8c5d0cb0fcaf25bbc7b84c2fcd33701d Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Fri, 4 Sep 2026 18:31:57 +0200 Subject: [PATCH 1/3] Enable the ARM64 target on the ARM64EC ABI. ARM64EC enables both _M_AMD64 and _M_ARM64EC. We already exclude ARM64EC from the SSE2 detection, but it was missing for the X64 target detection. However we're now fine to enable the ARM64 target. At least my kernels compile fine (as good as on the raw arm64) on MSVC. Related: https://techcommunity.microsoft.com/blog/windowsosplatform/getting-to-know-arm64ec-defines-and-intrinsic-functions/2957235 --- include/xsimd/config/xsimd_config.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/xsimd/config/xsimd_config.hpp b/include/xsimd/config/xsimd_config.hpp index 4bd2a341b..4107a57b7 100644 --- a/include/xsimd/config/xsimd_config.hpp +++ b/include/xsimd/config/xsimd_config.hpp @@ -51,7 +51,7 @@ * * Set to 1 if the target is the x86 architecture family. */ -#if defined(__x86_64__) || defined(__i386__) || defined(_M_AMD64) || defined(_M_IX86) +#if (defined(__x86_64__) || defined(__i386__) || defined(_M_AMD64) || defined(_M_IX86)) && !defined(_M_ARM64EC) #define XSIMD_TARGET_X86 1 #else #define XSIMD_TARGET_X86 0 @@ -422,7 +422,7 @@ * * Set to 1 if the target is in the ARM architecture family in 64 bits, to 0 otherwise */ -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) #define XSIMD_TARGET_ARM64 1 #else #define XSIMD_TARGET_ARM64 0 From b7094d4bf57aecb93b4760b452c2c36b83c73388 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Mon, 7 Sep 2026 12:51:06 +0200 Subject: [PATCH 2/3] CMake: Don't overwrite CMAKE_EXE_LINKER_FLAGS. I assume the /MANIFAST:NO shall be added as LDFLAGS, not overwrite it. So keep the old LDFLAGS. --- benchmark/CMakeLists.txt | 2 +- test/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 79ad30de8..7fe45a3fd 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -37,7 +37,7 @@ endif() if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /bigobj") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2") - set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a34dafde9..003d31201 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -113,12 +113,12 @@ endif() if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /bigobj") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244 /wd4267 /wd4005 /wd4146 /wd4800") - set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") endif() if(CMAKE_CXX_COMPILER_ID MATCHES Clang AND MSVC AND WIN32) # We are using clang-cl add_compile_options(/EHsc /bigobj) - set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") endif() set(XSIMD_TESTS From 8f8ec44dc9d6c23a0450c1ddb4fb697cdd79361e Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Mon, 7 Sep 2026 12:51:56 +0200 Subject: [PATCH 3/3] CI: Test on ARM64EC. --- .github/workflows/windows.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 10ce6e982..65c37917e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -136,10 +136,15 @@ jobs: run: ./_build/test/test_xsimd build-windows-arm64: - name: 'MSVC arm64' + name: 'MSVC arm64 ${{ matrix.abi.name }}' defaults: run: shell: bash {0} + strategy: + matrix: + abi: + - { name: "native", cflags: "" } + - { name: "arm64ec", cflags: " /arm64EC" } runs-on: windows-11-arm steps: - name: Setup compiler @@ -154,6 +159,9 @@ jobs: uses: actions/checkout@v6 - name: Setup run: cmake -B _build -DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON -DBUILD_BENCHMARK=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -G Ninja + env: + CFLAGS: ${{ matrix.abi.cflags }} + CXXFLAGS: ${{ matrix.abi.cflags }} - name: Build run: cmake --build _build - name: Testing xsimd