Skip to content
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

Update list of allowed aarch64 features #84665

Merged
merged 5 commits into from
May 20, 2021

Conversation

adamgemmell
Copy link
Contributor

I recently added these features to std_detect for aarch64 linux, pending review.

I have commented any features not supported by LLVM 9, the current minimum version for Rust. Some (PAuth at least) were renamed between 9 & 12 and I've left them disabled. TME, however, is not in LLVM 9 but I've left it enabled.

See rust-lang/stdarch#993

These features were recently added to std_detect. Features not supported
by LLVM 9, the current minimum version for Rust, are commented.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 28, 2021
@adamgemmell
Copy link
Contributor Author

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned davidtwco Apr 28, 2021
@est31
Copy link
Member

est31 commented Apr 28, 2021

I have commented any features not supported by LLVM 9,

Btw it's 10 (at least on master) #83387

("crc", Some(sym::aarch64_target_feature)),
// Cryptographic extension
("crypto", Some(sym::aarch64_target_feature)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLVM has moved away from a combined "crypto" feature and now uses separate "aes" and "sha2" features. We should do the same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - the crypto feature doesn't really mean much any more and the separate features are better. Wouldn't removing this here affect any users detecting this feature? Likewise with removing it from std_detect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AArch64 target features are still unstable, so it's fine to rename/remove them.

// FEAT_SVE2_BitPerm
("sve2-bitperm", Some(sym::aarch64_target_feature)),
// FEAT_FRINTTS
("fptoint", Some(sym::aarch64_target_feature)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fptoint" is a poor name for this feature, I prefer the original ARM name "frintts".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to rename this

@@ -152,6 +152,12 @@ pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
("x86", "avx512vpclmulqdq") => "vpclmulqdq",
("aarch64", "fp") => "fp-armv8",
("aarch64", "fp16") => "fullfp16",
("aarch64", "fhm") => "fp16fml",
("aarch64", "lse2") => "outline-atomics",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lse2 doesn't have an LLVM equivalent feature: it doesn't add any new instructions, it just relaxes the restrictions on existing atomic instructions.

outline-atomics is something different: it's a codegen option on LLVM to call external functions for atomic operations so that they can take advantage of LSE on targets that support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks a lot!

@adamgemmell
Copy link
Contributor Author

Btw it's 10 (at least on master) #83387

There happens to be no relevant features added in v10. Though it does mean TME is supported on all supported LLVM versions.

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 17, 2021
@Dylan-DPC-zz
Copy link

@adamgemmell any updates on the changes requested?

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 19, 2021
@adamgemmell
Copy link
Contributor Author

@Dylan-DPC here we go

Removing crypto is a little weird as there's a dependency on it in stdarch which is a submodule of rust, and of course we're bootstrapping.

  1. We commit this, which adds AES/SHA2 features in the compiler for arm/aarch64, and removes a test for the crypto feature in std_detect.
  2. We commit the stdarch patch once there's a nightly build of this available.
  3. I have a 2nd patch which removes crypto from the list of arm/aarch64 allowed features and adds a few more std tests for the new features (which are really just duplicates of the ones in std_detect, but consistency is nice). This can be committed when or after the submodule for stdarch is updated.

@Amanieu
Copy link
Member

Amanieu commented May 19, 2021

@bors r+

@bors
Copy link
Contributor

bors commented May 19, 2021

📌 Commit d3737a6 has been approved by Amanieu

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 19, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 19, 2021
…nieu

Update list of allowed aarch64 features

I recently added these features to std_detect for aarch64 linux, pending [review](rust-lang/stdarch#1146).

I have commented any features not supported by LLVM 9, the current minimum version for Rust. Some (PAuth at least) were renamed between 9 & 12 and I've left them disabled. TME, however, is not in LLVM 9 but I've left it enabled.

See rust-lang/stdarch#993
@bors
Copy link
Contributor

bors commented May 20, 2021

⌛ Testing commit d3737a6 with merge feda7ff79fcad3576c95c6336638c2398ac44b29...

@bors
Copy link
Contributor

bors commented May 20, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 20, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@adamgemmell
Copy link
Contributor Author

@bors
Copy link
Contributor

bors commented May 20, 2021

@adamgemmell: 🔑 Insufficient privileges: not in try users

@est31
Copy link
Member

est31 commented May 20, 2021

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2021
@bors
Copy link
Contributor

bors commented May 20, 2021

⌛ Testing commit d3737a6 with merge 8a57820...

@bors
Copy link
Contributor

bors commented May 20, 2021

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing 8a57820 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 20, 2021
@bors bors merged commit 8a57820 into rust-lang:master May 20, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 20, 2021
@adamgemmell adamgemmell deleted the aarch64-features branch March 1, 2022 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants