-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_target: Add various aarch64 features #128192
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
r? @Amanieu |
If I bump |
This is blocked on #128083. |
It's not clear to me what the plan is for the FPMR feature. If it doesn't make sense to maintain it as a codegen feature in rustc, we could just only have it in std_detect like the |
Yes, that's the approach we settled on as well. The issue is that LLVM 18 versions have it as an explicit feature, while from LLVM 19 onwards it's just supposed to be on by default. I made a separate commit for removing it from the codegen features to highlight this in case someone looks for it later. With this PR it will not be a Rust codegen feature. We switch it on by default through target specs on LLVM 18, it's already switched on on LLVM 19+ and it doesn't exist on older LLVM versions. But we do keep the detection in |
Thanks! Will there be a separate tracking issue for these? |
Yes, already here: #127764 |
Rather than modifying the target specs, can you instead hard-code rustc to always add that feature when compiling on aarch64 for LLVM <= 18? That makes it easier to remove this in the future once we upgrade our minimum LLVM version to 19. |
Why do we have to add this feature now at all, when we haven't been enabling it before? |
☔ The latest upstream changes (presumably #125443) made this pull request unmergeable. Please resolve the merge conflicts. |
8142c49
to
c79f701
Compare
Sure, done. This also made the changes to llvm_util unnecessary so I dropped those as well. |
It's a target feature. If we don't handle it explicitly in some way then people who want to make use of it in Rust will not be able to do so until LLVM is bumped to 19 which would not be ideal. Explicitly enabling it ensures consistent behaviour with the upcoming changes. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #128466) made this pull request unmergeable. Please resolve the merge conflicts. |
c79f701
to
bf61974
Compare
This comment has been minimized.
This comment has been minimized.
@Amanieu it's failing because a lot of these features were only added in LLVM 18, should I just make using them conditional on |
FEAT_FPMR has been removed from upstream LLVM as of LLVM 19. Remove the feature from the target features list and temporarily hack the LLVM codegen to always enable it until the minimum LLVM version is bumped to 19.
Convert to_llvm_features to return Option<LLVMFeature> so that it can return None if the requested feature is not available for the current LLVM version. Add match rules to filter out aarch64 features not available in LLVM 17.
Additionally, remove optional matching for +v8a given that the minimum LLVM version is now past 14.
2762869
to
0f871b5
Compare
@rustbot ready |
I rebased the branch and updated the Was a little surprised that the pipeline didn't catch it earlier, looks like it does not run aarch64 codegen tests on pushes to PRs. They're not mentioned here either for what that's worth. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@bors r+ |
rustc_target: Add various aarch64 features Add various aarch64 features already supported by LLVM and Linux. Additionally include some comment fixes to ensure consistency of feature names with the Arm ARM. Compiler support for features added to stdarch by rust-lang/stdarch#1614. Tracking issue for unstable aarch64 features is rust-lang#127764. List of added features: - FEAT_CSSC - FEAT_ECV - FEAT_FAMINMAX - FEAT_FLAGM2 - FEAT_FP8 - FEAT_FP8DOT2 - FEAT_FP8DOT4 - FEAT_FP8FMA - FEAT_HBC - FEAT_LSE128 - FEAT_LSE2 - FEAT_LUT - FEAT_MOPS - FEAT_LRCPC3 - FEAT_SVE_B16B16 - FEAT_SVE2p1 - FEAT_WFxT - FEAT_SME - FEAT_SME_F16F16 - FEAT_SME_F64F64 - FEAT_SME_F8F16 - FEAT_SME_F8F32 - FEAT_SME_FA64 - FEAT_SME_I16I64 - FEAT_SME_LUTv2 - FEAT_SME2 - FEAT_SME2p1 - FEAT_SSVE_FP8DOT2 - FEAT_SSVE_FP8DOT4 - FEAT_SSVE_FP8FMA FEAT_FPMR is added in the first commit and then removed in a separate one to highlight it being removed from upstream LLVM 19. The intention is for it to be detectable at runtime through stdarch but not have a corresponding Rust compile-time feature.
…kingjubilee Rollup of 14 pull requests Successful merges: - rust-lang#128192 (rustc_target: Add various aarch64 features) - rust-lang#129170 (Add an ability to convert between `Span` and `visit::Location`) - rust-lang#129343 (Emit specific message for time<=0.3.35) - rust-lang#129378 (Clean up cfg-gating of ProcessPrng extern) - rust-lang#129401 (Partially stabilize `feature(new_uninit)`) - rust-lang#129467 (derive(SmartPointer): assume pointee from the single generic and better error messages) - rust-lang#129494 (format code in tests/ui/threads-sendsync) - rust-lang#129617 (Update books) - rust-lang#129673 (Add fmt::Debug to sync::Weak<T, A>) - rust-lang#129683 (copysign with sign being a NaN can have non-portable results) - rust-lang#129689 (Move `'tcx` lifetime off of impl and onto methods for `CrateMetadataRef`) - rust-lang#129695 (Fix path to run clippy on rustdoc) - rust-lang#129712 (Correct trusty targets to be tier 3) - rust-lang#129715 (Update `compiler_builtins` to `0.1.123`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128192 - mrkajetanp:feature-detect, r=Amanieu rustc_target: Add various aarch64 features Add various aarch64 features already supported by LLVM and Linux. Additionally include some comment fixes to ensure consistency of feature names with the Arm ARM. Compiler support for features added to stdarch by rust-lang/stdarch#1614. Tracking issue for unstable aarch64 features is rust-lang#127764. List of added features: - FEAT_CSSC - FEAT_ECV - FEAT_FAMINMAX - FEAT_FLAGM2 - FEAT_FP8 - FEAT_FP8DOT2 - FEAT_FP8DOT4 - FEAT_FP8FMA - FEAT_HBC - FEAT_LSE128 - FEAT_LSE2 - FEAT_LUT - FEAT_MOPS - FEAT_LRCPC3 - FEAT_SVE_B16B16 - FEAT_SVE2p1 - FEAT_WFxT - FEAT_SME - FEAT_SME_F16F16 - FEAT_SME_F64F64 - FEAT_SME_F8F16 - FEAT_SME_F8F32 - FEAT_SME_FA64 - FEAT_SME_I16I64 - FEAT_SME_LUTv2 - FEAT_SME2 - FEAT_SME2p1 - FEAT_SSVE_FP8DOT2 - FEAT_SSVE_FP8DOT4 - FEAT_SSVE_FP8FMA FEAT_FPMR is added in the first commit and then removed in a separate one to highlight it being removed from upstream LLVM 19. The intention is for it to be detectable at runtime through stdarch but not have a corresponding Rust compile-time feature.
Add various aarch64 features already supported by LLVM and Linux.
Additionally include some comment fixes to ensure consistency of feature names with the Arm ARM.
Compiler support for features added to stdarch by rust-lang/stdarch#1614.
Tracking issue for unstable aarch64 features is #127764.
List of added features:
FEAT_FPMR is added in the first commit and then removed in a separate one to highlight it being removed from upstream LLVM 19. The intention is for it to be detectable at runtime through stdarch but not have a corresponding Rust compile-time feature.