Skip to content

Add tmm_reg clobbers #97097

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
May 18, 2022
Merged

Add tmm_reg clobbers #97097

merged 5 commits into from
May 18, 2022

Conversation

chorman0773
Copy link
Contributor

This adds support for naming the 8 tile registers from intel AMX as clobbers from asm! invocations on x86_64 (only). It does not add the registers as input or output operands.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 17, 2022
@rust-highfive
Copy link
Contributor

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

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 May 17, 2022
@@ -6,6 +6,13 @@

use std::arch::asm;

// CHECK-LABEL: @avx512_clobber
Copy link
Member

Choose a reason for hiding this comment

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

Should be @amx_clobber I think.

Copy link
Contributor Author

@chorman0773 chorman0773 May 17, 2022

Choose a reason for hiding this comment

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

Yeah, you'd be right 🤦
I'll fix that in the morning.

@rust-log-analyzer

This comment has been minimized.

@Amanieu
Copy link
Member

Amanieu commented May 17, 2022

You should add the tmm registers to the clobber_abi definitions in rustc_target/src/asm/mod.rs.

@michaelwoerister
Copy link
Member

I think @joshtriplett might be a good reviewer for this.
r? @joshtriplett

@chorman0773
Copy link
Contributor Author

chorman0773 commented May 17, 2022

You should add the tmm registers to the clobber_abi definitions in rustc_target/src/asm/mod.rs.

I'm checking whether they're considered volatile or non-volatile. Win64 doesn't appear to say anything about them yet, and I need to find a recent version of Sys-V x86_64.

@chorman0773
Copy link
Contributor Author

chorman0773 commented May 17, 2022

Sys-V does consider them temporary and caller saved (https://ccs.neu.edu/home/ntuck/courses/2021/01/cs3650/asm/x86-64-sysv-abi.pdf, 2020 edition). I've also conservatively marked them as clobbered on Win64.
It might be a good idea to indicate that relying on it being clobbered is unstable on Win64 until their ABI updates to include AMX.
Edit: I've filled an issue on Microsoft's C++ Documentation Github reguarding the matter: https://github.com/MicrosoftDocs/cpp-docs/issues/3902

@rust-log-analyzer

This comment has been minimized.

@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented May 17, 2022

📌 Commit eabe851 has been approved by joshtriplett

@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 17, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#96647 (rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate)
 - rust-lang#96651 (Omit unnecessary help to add `#[cfg(test)]` when already annotated)
 - rust-lang#96761 (rustdoc: don't build `rayon` for non-windows targets)
 - rust-lang#97096 (Types with reachable constructors are reachable)
 - rust-lang#97097 (Add tmm_reg clobbers)
 - rust-lang#97113 (Search GUI fixes)
 - rust-lang#97116 (interpret/validity: reject references to uninhabited types)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7361b22 into rust-lang:master May 18, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 18, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants