Skip to content

[mathcore] Work around libstdc++ <experimental/simd> AVX-512 bug#22437

Merged
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:issue-22370
Jun 2, 2026
Merged

[mathcore] Work around libstdc++ <experimental/simd> AVX-512 bug#22437
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:issue-22370

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

The libstdc++'s _VecBltnBtmsk (AVX-512 mask) ABI fails to compile with non-GCC front ends (Clang, Intel icpx) due to a static_assert requiring long long and long to be the same type, reproducible at least with GCC 15 and 16.

Detect this in CMake and, when the AVX-512 path is broken but the 256-bit AVX path compiles, pin ROOT's SIMD alias in Math/Types.h to simd_abi::__avx (which corresponds to AVX-256). ABI stays consistent across all translation units and interpreted contexts, no -mno-avx512f is needed, and the rest of ROOT keeps native AVX-512 codegen.

Closes #22370.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

Test Results

    21 files      21 suites   3d 7h 25m 7s ⏱️
 3 863 tests  3 862 ✅ 0 💤 1 ❌
72 733 runs  72 732 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 76f8a02.

♻️ This comment has been updated with latest results.

The `libstdc++`'s `_VecBltnBtmsk` (AVX-512 mask) ABI fails to compile
with non-GCC front ends (Clang, Intel icpx) due to a static_assert
requiring `long long` and `long` to be the same type, reproducible at
least with GCC 15 and 16.

Detect this in CMake and, when the AVX-512 path is broken but the
256-bit AVX path compiles, pin ROOT's SIMD alias in `Math/Types.h` to
`simd_abi::__avx` (which corresponds to AVX-256). ABI stays consistent
across all translation units and interpreted contexts, no `-mno-avx512f`
is needed, and the rest of ROOT keeps native AVX-512 codegen.

Closes root-project#22370.
@guitargeek guitargeek merged commit 83dd2e4 into root-project:master Jun 2, 2026
30 of 33 checks passed
@guitargeek guitargeek deleted the issue-22370 branch June 2, 2026 14:19
@guitargeek
Copy link
Copy Markdown
Contributor Author

/backport to 6.40

@root-project-bot
Copy link
Copy Markdown

Preparing to backport PR #22437 to branch 6.40 requested by guitargeek

@root-project-bot
Copy link
Copy Markdown

This PR has been backported to branch 6.40: #22456

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.

ROOT 6.40.00 seems won't compile with Clang + GCC 16 standard library

3 participants