Repository navigation
Stabilise std::is_aarch64_feature_detected #86941
Description
This issue constitutes the stabilisation report as per the rustc dev guide
Summary
I'm hoping to stabilise std::is_aarch64_feature_detected which allows for runtime feature detection on aarch64 platforms. It was recently updated to include all features supported by both linux and LLVM 12, though the detection for some features isn't on non-linux platforms yet.
Documentation
The documentation for it is in this file. There's doc comments for individual features in the macro but I don't see these exposed anywhere, just on a hidden enum. Perhaps this could be improved. I've also got a small patch to mention it in the Rust Reference here.
Tests
There are tests for it in stdarch as well as rust. These are currently all up to date.
Unresolved questions
The only backwards-compatible question left to resolve is whether to split pauth into paca (address authentication) and pacg (generic authentication) as linux does. The current behaviour (together) matches LLVM (and the ARMv8-A feature FEAT_PAuth).
The x86 macro was stabilised under the simd_x86 feature - does this mean I should create a new simd_aarch64 feature to stabilise this and other aarch64 stdsimd work under?
See also:
#48556 for the tracking issue for the stdsimd feature.
#90620 for stabilising the target_feature attribute on aarch64 platforms.
Activity
Rollup merge of rust-lang#87729 - adamgemmell:dev/deprecate-crypto, r…
Rollup merge of rust-lang#87729 - adamgemmell:dev/deprecate-crypto, r…
adamgemmell commentedon Oct 25, 2021
One possible issue I've noticed is that I can't see a way to view https://doc.rust-lang.org/std/macro.is_aarch64_feature_detected.html under a different platform like you can with other crates on docs.rs. Until we can I'm not sure it's possible to make the documentation for the macro easily visible.
bjorn3 commentedon Oct 25, 2021
The documentation on doc.rust-lang.org is for all platforms at the same time.
adamgemmell commentedon Oct 25, 2021
The issue is there's different output for multiple different platforms. I'll try removing the doc comment on the error macro in there to see if that helps. It's not useful on the docs page anyway and should just be a normal comment
CryZe commentedon Oct 25, 2021
Is the general ARM one different enough to not just stabilize it at the same time as well?
Amanieu commentedon Oct 25, 2021
@rfcbot merge
Amanieu commentedon Oct 25, 2021
@rfcbot merge
rfcbot commentedon Oct 25, 2021
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:
Concerns:
move to a module?resolved by Stabilise std::is_aarch64_feature_detected #86941 (comment)to splitresolved by Stabilise std::is_aarch64_feature_detected #86941 (comment)pauthor not to splitpauthOnce a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
BurntSushi commentedon Oct 26, 2021
Have the unresolved questions here been addressed?
Also, are we stabilizing any corresponding
#[target_feature(enable = "...")]values for aarch64?44 remaining items
adamgemmell commentedon Feb 14, 2022
@ehuss also mentioned that the docs still show the error_macro docs for none-x86 platforms. Yet to find the reason but everything's fine with
cargo docin stdarch, but not with./x.py doc.Amanieu commentedon Feb 14, 2022
Maybe some issue due to std_detect being a separate crate from std which causes
#[cfg(doc)]to not work correctly?ehuss commentedon Feb 14, 2022
When a dependency is built for rustdoc,
cfg(doc)is not set. So the re-export is just re-exporting the normal macros, not thecfg(doc)ones.adamgemmell commentedon Feb 16, 2022
That makes sense rust-lang/cargo#8811
So, with beta cutoff next week, we could:
[package.metadata.docs.rs]in std_detect's Cargo.toml. Does that docs.rs section also affect doc.rust-lang? Is there another (presumably unused as I couldn't find any) section for doc.rust-lang.org?aarch64.rsto the error macro. It will look the same with the exception of thesrclink, and the list of cases in the macro (which are duplicates of what's in the doc comments anyway.#[doc(hidden)]) regardless of architecture so we can put some#[cfg(doc)]logic inlibrary/std/src/lib.rs? Potentially through a wrapper macro or reexporting under a different name/module.The third option seems to be more invasive so I'm going to go with the second for now until someone says otherwise.
ehuss commentedon Feb 16, 2022
Cutoff is Friday morning this week.
It does not.
Adding comments to the error macros might help a little, but I imagine will still show up as unstable so it might still be confusing.
Unfortunately I don't have much time to help here. It's a bit of a thorny issue that can be tricky to fix.
Amanieu commentedon Feb 16, 2022
I opened rust-lang/stdarch#1283 which should fix this.
Rollup merge of rust-lang#91608 - workingjubilee:fold-neon-fp, r=Amanieu
Rollup merge of rust-lang#91608 - workingjubilee:fold-neon-fp, r=nagi…
joshtriplett commentedon Jul 16, 2022
Following up on this: what are the remaining blockers to merge this?
Amanieu commentedon Jul 16, 2022
I believe all of the concerns have been addressed so this is just waiting on a stabilization PR.
adamgemmell commentedon Jul 18, 2022
https://doc.rust-lang.org/std/arch/macro.is_aarch64_feature_detected.html I stabilised this back in 1.60 https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html
Likewise with aarch64_target_feature (#90620), apologies for not closing the issues.