镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

MSVC compile error for NEON (win/arm64) #611

Open

Description

@niyas-sait

XSIMD library cannot be built using MSVC compiler on a windows/arm64 target.

Steps to reproduce

Visual Studio 2019 or higher is required for compilation.

Compilation can be done natively on a win/arm64 machine or can be cross-compiled from an x86/x64 machine.

From a command terminal

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_arm64.bat

cmake -G "NMake Makefiles" -D DOWNLOAD_GTEST=1 -D CMAKE_BUILD_TYPE=Debug .

nmake test_xsimd

The issue has been noticed while building the apache arrow library and would be required to build an apache arrow for win/arm64 using MSVC.

Activity

  1. niyas-sait commented on Oct 19, 2021

    @niyas-sait
    Author

    The main issue seems to be due to MSVC arm/neon intrinsic vector type using the same underlying type for the neon vectors.

    e.g: int8x16_t and uint8x16_t maps to __n128 type

    This causes a couple of issues

    • Function overloading issues as functions with same functions redefined in xsimd
    • Neon dispatcher doesn't pick the right function as all of the functions might be using the same underlying type.

    And other issues are

    • reinterpret_cast doesn't work on neon vector types
    • intrinsic functions defined using macro which might overwrite functions with the same name even defined under a namespace (e.g: wrap::vadd_f32)
    • NEON identification require different flag checks
    • Initializer_list constructor missing for neon vector types
  2. niyas-sait commented on Oct 19, 2021

    @niyas-sait
    Author

    Few approaches I can think of

    • A) Replace the dispatcher to not use target vector type and use the scalar vector type to find the functions to use.
    • B) Define a wrapper class for msvc neon vector types so that they are distinguishable and can be used with the current dispatcher mechanism.
  3. niyas-sait commented on Oct 19, 2021

    @niyas-sait
    Author

    Pull Request for approach (A)

  4. stwiegand commented on Sep 25, 2024

    @stwiegand

    Any news on this issue, since nowadays ARM64 on Windows is a thing?

  5. JohanMabille commented on Oct 13, 2025

    @JohanMabille
    Member

    We should probably revive #612 , but I cannot give a deadline for now. Any help on that would be appreciated.

  6. serge-sans-paille commented on Jan 24, 2026

    @serge-sans-paille
    Contributor

    proved obsolete by #1248.

  7. jgiannuzzi commented on Jan 25, 2026

    @jgiannuzzi

    @serge-sans-paille I'm afraid this issue is not proved obsolete by the new CI job. It's about building with the MSVC compiler targeting arm64, not about building with gcc/mingw. Could you please reopen the issue?

  8. serge-sans-paille commented on Jan 25, 2026

    @serge-sans-paille
    Contributor

    As noted in #1248 (comment), I mistyped the label, but it's indeed msvc being run.
    And this build: https://github.com/xtensor-stack/xsimd/actions/runs/21322768338/job/61375021654 makes me think everything is good?

    -- The C compiler identification is MSVC 19.44.35222.0
    -- The CXX compiler identification is MSVC 19.44.35222.0
    

    ...
    or so I thought, but no, It's targeting amd64, my bad. Reopening

  9. jgiannuzzi commented on Jan 25, 2026

    @jgiannuzzi

    @serge-sans-paille yes that looks good to me! Thank you!

  10. serge-sans-paille commented on Feb 4, 2026

    @serge-sans-paille
    Contributor

    Some feedback: I cana ctually reproduce your issue in #1250, which is somehow good. I had great hope that /Zc:arm64-aliased-neon-types- would help, but that doesn't seem to be enough, unfortunately.

  11. degasus commented on Mar 30, 2026

    @degasus
    Contributor

    This issue actually got worse with #1254. Before, including "xsimd" was basicly a no-op. I was even able to use the emulated SIMD xsimd::emulated as fallback. Now it detects neon (which is correct), but so this error here breaks building the emulated fallback.

  12. DiamonDinoia commented on Mar 30, 2026

    @DiamonDinoia
    Contributor

    can you try something like this in the meantime? https://github.com/flatironinstitute/finufft/blob/e137ec92f1cc1e91191f50072460a80307195304/include/finufft/simd.hpp#L8
    then you can check if NEON is detected and force emulated.

  13. pdeep854 commented on Apr 1, 2026

    @pdeep854

    The project now builds successfully with MSVC on Windows on ARM, with all tests passing. Additionally, a CI script has been added to support builds using LLVM Clang and MSYS2 CLANGARM64. Refer below PR
    #1285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions