[zerocopy] Re-enable big endian aarch64 types#3073
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3073 +/- ##
=======================================
Coverage 91.87% 91.87%
=======================================
Files 20 20
Lines 6057 6057
=======================================
Hits 5565 5565
Misses 492 492 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I don't know what it wants me to change in the CI file. Adding the new flag to the matrix is straightforward but the |
When initially released the LLVM semantics did not agree with the intrinsics in the order of lanes and hence they got removed from stable on big endian targets. The fix of these semantics was shipped with Rust 1.87 in March 2025 (<rust-lang/rust#136831>). To keep the library working in these previous compiler versions the intrinsics are enabled by their prior condition, a little endian target is detected, or the feature detection cfg of the more recent rust release is present.
jswrenn
left a comment
There was a problem hiding this comment.
Thanks for this, and sorry for the late reply! Looks great, just a few small nits.
| // NOTE(https://github.com/rust-lang/stdarch/issues/1484): NEON intrinsics are currently | ||
| // broken on big-endian platforms. |
There was a problem hiding this comment.
Can you keep some sort of comment here, that explains the fairly complex cfg below?
| #[cfg_attr( | ||
| all(doc_cfg, target_endian = "little"), | ||
| doc(cfg(rust = "1.59.0")) | ||
| )] |
There was a problem hiding this comment.
| #[cfg_attr( | |
| all(doc_cfg, target_endian = "little"), | |
| doc(cfg(rust = "1.59.0")) | |
| )] | |
| #[cfg_attr( | |
| doc_cfg, | |
| doc(cfg(all(target_arch = "aarch64", any( | |
| all(rust = "1.59.0", target_endian = "little"), | |
| rust = "1.87.0", | |
| )))) | |
| )] |
| #[cfg(any( | ||
| all(target_arch = "aarch64", target_endian = "little"), | ||
| all(target_arch = "aarch64", not(no_zerocopy_aarch64_simd_be_1_87_0)) | ||
| ))] |
There was a problem hiding this comment.
Factor out the target_arch = "aarch64"?
| #[cfg(any( | |
| all(target_arch = "aarch64", target_endian = "little"), | |
| all(target_arch = "aarch64", not(no_zerocopy_aarch64_simd_be_1_87_0)) | |
| ))] | |
| #[cfg(all( | |
| target_arch = "aarch64", | |
| any( | |
| target_endian = "little", | |
| not(no_zerocopy_aarch64_simd_be_1_87_0) | |
| ) | |
| ))] |
| no-zerocopy-aarch64-simd-1-59-0 = "1.59.0" | ||
|
|
||
| # Include SIMD types from `core::arch::aarch64` on big endian targets. Prior to | ||
| # 1.87.0 (#136831) the types were only correct on little endian and backed off |
There was a problem hiding this comment.
| # 1.87.0 (#136831) the types were only correct on little endian and backed off | |
| # 1.87.0 (https://github.com/rust-lang/rust/pull/136831) the types were only correct on little endian and backed off |
When initially released the LLVM semantics did not agree with the intrinsics in the order of lanes and hence they got removed from stable on big endian targets. The fix of these semantics was shipped with Rust 1.87 in March 2025 (rust-lang/rust#136831).
To keep the library working in these previous compiler versions the intrinsics are enabled by their prior condition, a little endian target is detected, or the feature detection cfg of the more recent rust release is present.
Interesting point: the tests were never gated on
target_endian = "little"so it seems that CI is not configured for any big endian aarch64 platform.