From 5518f2d4d0c45a26cea3e3f9984765dad8200bd9 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 acb47c366730811d268b8b6e6796df3416b452f3 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 79cf3a94197720f681d5ecff6d8f4ecc8e332324 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