Skip to content

Fix Windows ARM64EC build issues and correct SIMD ARM NEON path for ARM64/EC#2344

Merged
cary-ilm merged 2 commits intoAcademySoftwareFoundation:mainfrom
navvyswethgraphics:support_arm64_arm64ec_msvc
Apr 25, 2026
Merged

Fix Windows ARM64EC build issues and correct SIMD ARM NEON path for ARM64/EC#2344
cary-ilm merged 2 commits intoAcademySoftwareFoundation:mainfrom
navvyswethgraphics:support_arm64_arm64ec_msvc

Conversation

@navvyswethgraphics
Copy link
Copy Markdown
Contributor

Issue description

This PR improves Windows ARM64 and ARM64EC support in OpenEXR by fixing SIMD feature detection, resolving ARM64EC build failures, and ensuring the correct NEON code paths are selected while x86 SIMD paths (SSE/AVX) are disabled.
These changes ensure that ARM64EC builds succeed with MSVC and no longer accidentally include x86 SIMD headers or translation units.

Note:
The corresponding OpenJPH Windows ARM64EC fixes have already been upstreamed and merged:
aous72/OpenJPH#265

Build failure evidence (before fix)

OpenEXR-ARM64EC build issue

7>ImfSystemSpecific.cpp
7>C:\Working_DIR\GAME_TECH_GITHUB\FORK_OPENEXR\temp\openexr\src\lib\OpenEXR\ImfOutputFile.cpp(555,46): warning C4244: '=': conversion from '__int64' to 'int', possible loss of data
7>C:\Working_DIR\GAME_TECH_GITHUB\FORK_OPENEXR\temp\openexr\src\lib\OpenEXR\ImfOutputFile.cpp(805,57): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data
7>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\include\emmintrin.h(24,1): error C1189: #error: this header should only be included through <intrin.h>
7>(compiling source file '../../../../src/lib/OpenEXR/ImfSystemSpecific.cpp')
7>C:\Working_DIR\GAME_TECH_GITHUB\FORK_OPENEXR\temp\openexr\src\lib\OpenEXR\ImfTiledOutputFile.cpp(1025,57): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data
7>Done building project "OpenEXR.vcxproj" -- FAILED.
========== Rebuild All: 6 succeeded, 1 failed, 0 skipped ==========
========== Rebuild completed at 12:20 PM and took 20.612 seconds ==========

OpenJPH-ARM64EC build issue.

1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug ARM64EC ------
1>1>Checking Build System
2>------ Rebuild All started: Project: openjph, Configuration: Debug ARM64EC ------
2>Compiling...
2>Generating Code...
2>ojph_mem_c.c
2>cl : command line warning D9002: ignoring unknown option '/arch:AVX'
2>ojph_codestream_avx.cpp
2>ojph_colour_avx.cpp
2>ojph_transform_avx.cpp
2>Generating Code...
2>C:\FORK\TEMP\OpenJPH\src\core\transform\ojph_transform_avx.cpp(1,1): error C7302: AVX types (__m256) are not currently supported in ARM64EC code
2>C:\FORK\TEMP\OpenJPH\src\core\codestream\ojph_codestream_avx.cpp(1,1): error C7302: AVX types (__m256) are not currently supported in ARM64EC code
2>Done building project "openjph.vcxproj" -- FAILED.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
========== Rebuild completed at 11:54 AM and took 09.063 seconds ==========

Type of change

  • SIMD detection fixes

  • Disable SSE2 / SSE4.1 paths when _M_ARM64EC is defined

  • Introduce NEON function selection from IMF_HAVE_NEON_AARCH64 to the "IMF_HAVE_NEON_ARM64" to common capability macro covering:
    - [ ]Linux and macOS AArch64
    - [ ]Windows ARM64
    - [ ]Windows ARM64EC

  • MSVC ARM64 correctness improvements

  • Use <arm64_neon.h> when compiling with MSVC

  • Avoid static SIMD vector initializers not supported by MSVC

Impact

  • Windows ARM64 & ARM64EC: NEON implementations are enabled; SSE paths are disabled
  • Linux/macOS AArch64: No behavior change
  • Windows x64 / Linux x86_64: No behavior change

Build & Test

  • Environment: Windows 11 on ARM64; MSVC (VS 2022 v143 toolset).
  • Result: ARM64 and ARM64EC configurations compile cleanly; x86/x64 unchanged.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 9, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: cary-ilm / name: Cary Phillips (efe1b45)
  • ✅ login: navvyswethgraphics / name: Naveen Regulla (644ea59)

@cary-ilm
Copy link
Copy Markdown
Member

cary-ilm commented Apr 9, 2026

This looks good to me, thanks.

The ASWF policy is to require a signed Contributor License Agreement for all contributions. Can you click the red "SIGNED AGREEMENT MISSING" button above and complete the form?

Also, we require commits with a "Developer Certificate of Origin", i.e. signed commits. Can you amend your commit with -s and force-push it? It won't do to add a second signed commit as each commit needs a "signed-off-by" line.

git commit -s --amend --no-edit
git push --force

I would also like to add a CI job that validates the Windows ARM64EC build, but I can add that later myself.

cary-ilm added a commit to cary-ilm/openexr that referenced this pull request Apr 9, 2026
Intended to validate the configuration addressed in AcademySoftwareFoundation#2344

Signed-off-by: Cary Phillips <cary@ilm.com>
@cary-ilm
Copy link
Copy Markdown
Member

I have a CI extension prepared. Are you able to resolve the CLA and DCO?

@navvyswethgraphics
Copy link
Copy Markdown
Contributor Author

I have a CI extension prepared. Are you able to resolve the CLA and DCO?

Thank you very much for reviewing my code and for the update. My CLA process is currently in progress with my employer. Once it is completed, I will proceed with resolving the CLA and DCO.

@cary-ilm
Copy link
Copy Markdown
Member

Thank you!

cary-ilm added a commit to cary-ilm/openexr that referenced this pull request Apr 13, 2026
Intended to validate the configuration addressed in AcademySoftwareFoundation#2344

Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: nregulla <nregulla@qti.qualcomm.com>
@navvyswethgraphics navvyswethgraphics force-pushed the support_arm64_arm64ec_msvc branch from 398fc96 to 644ea59 Compare April 24, 2026 08:14
@navvyswethgraphics
Copy link
Copy Markdown
Contributor Author

CLA and DCO have been completed from my side. Kindly have a look.
Thank you.

@cary-ilm cary-ilm merged commit ca2e513 into AcademySoftwareFoundation:main Apr 25, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants