rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.95k stars 12.68k forks source link

Stabilise std::is_aarch64_feature_detected #86941

Closed adamgemmell closed 2 years ago

adamgemmell commented 3 years ago

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: https://github.com/rust-lang/rust/issues/48556 for the tracking issue for the stdsimd feature. https://github.com/rust-lang/rust/issues/90620 for stabilising the target_feature attribute on aarch64 platforms.

adamgemmell commented 2 years ago

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 (https://github.com/rust-lang/rust/issues/90620), apologies for not closing the issues.