-
Notifications
You must be signed in to change notification settings - Fork 275
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
Improve feature detect for combined aarch64 features #1527
Merged
Amanieu
merged 1 commit into
rust-lang:master
from
adamgemmell:dev/adagem01/combined-feature-detect
Feb 16, 2024
Merged
Improve feature detect for combined aarch64 features #1527
Amanieu
merged 1 commit into
rust-lang:master
from
adamgemmell:dev/adagem01/combined-feature-detect
Feb 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Feb 15, 2024
I've bisected the CI failure down to the LLVM 18 upgrade - I'll be able to look into it next week if no-one gets there first. |
Amanieu
approved these changes
Feb 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once CI is fixed (when the nightly updates)
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Feb 15, 2024
…target-features, r=Amanieu Update aarch64 target feature docs to match LLVM rust-lang/stdarch#1432 rust-lang/stdarch#1527 r? `@Amanieu`
oli-obk
added a commit
to oli-obk/rust
that referenced
this pull request
Feb 15, 2024
…target-features, r=Amanieu Update aarch64 target feature docs to match LLVM rust-lang/stdarch#1432 rust-lang/stdarch#1527 r? ``@Amanieu``
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Feb 15, 2024
…target-features, r=Amanieu Update aarch64 target feature docs to match LLVM rust-lang/stdarch#1432 rust-lang/stdarch#1527 r? ```@Amanieu```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 16, 2024
Rollup merge of rust-lang#121145 - adamgemmell:dev/adagem01/combined-target-features, r=Amanieu Update aarch64 target feature docs to match LLVM rust-lang/stdarch#1432 rust-lang/stdarch#1527 r? ```@Amanieu```
LLVM's `ssbs` and `mte` target_features represent two Arm features. Linux's HWCAP also represents the same two features, so this is just a documentation update. LLVM's `ras` target_feature represents two Arm features - FEAT_RAS and FEAT_RASv1p1. There is no runtime detection for this, so this is a no-op in stdarch. LLVM's `aes` feature covers both `FEAT_AES` and `FEAT_PMULL`, but Linux exposes seperate feature bits. This patch makes the `aes` target_feature correctly shortcut runtime `pmull` detection and also makes the `aes` feature check for `pmull` at runtime to bring it in line with the target_feature behaviour. In practice I think this makes the two runtime features identical since the ID_AA64ISAR0_EL1 register does not allow for PMULL without AES.
Amanieu
force-pushed
the
dev/adagem01/combined-feature-detect
branch
from
February 16, 2024 15:58
14a9b30
to
cbff686
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
LLVM's
ssbs
andmte
target_features represent two Arm features. Linux's HWCAP also represents the same two features, so this is just a documentation update.LLVM's
ras
target_feature represents two Arm features - FEAT_RAS and FEAT_RASv1p1. There is no runtime detection for this, so this is a no-op in stdarch.LLVM's
aes
feature covers bothFEAT_AES
andFEAT_PMULL
, but Linux exposes seperate feature bits. This patch makes theaes
target_feature correctly shortcut runtimepmull
detection and also makes theaes
feature check forpmull
at runtime to bring it in line with the target_feature behaviour. In practice I think this makes the two runtime features identical since the ID_AA64ISAR0_EL1 register does not allow for PMULL without AES. I haven't added apmull
target_feature because it would behave identically to theaes
one, but I could do if you see fit.#1432
For reference:
Linux HWCAPs are documented here: https://www.kernel.org/doc/html/latest/arch/arm64/elf_hwcaps.html
They reference the ID registers documented here: https://developer.arm.com/documentation/ddi0595/2021-12/AArch64-Registers
LLVM target features are defined here: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AArch64/AArch64.td