[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.85% -0.02%
==========================================
Files 20 20
Lines 6057 6067 +10
==========================================
+ Hits 5565 5573 +8
- Misses 492 494 +2 ☔ 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 |
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.
| #[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", | |
| )))) | |
| )] |
There was a problem hiding this comment.
Since I took those recommendations verbatim, I wanted to mark the commit with you in Co-Authored-By. It seems the CLA tool does not like it. How would you like me to refer to you?
There was a problem hiding this comment.
Try jswrenn@google.com or jack@wrenn.fyi? Not sure why since the email you used is in the recent Git history 🤷♂️
src/impls.rs
Outdated
| #[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) | |
| ) | |
| ))] |
Cargo.toml
Outdated
| 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. Co-Authored-By: Jack Wrenn <jswrenn@google.com>
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.