-
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
Add asm!() support for PowerPC #84732
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) 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. |
r? @Amanieu |
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.
The main issue is that you need to disallow the use of LLVM reserved registers. Refer to LLVM's getReservedRegisters
for the full list.
Thanks for the review! I'm still very unfamiliar with the compiler, so I copied another similar pull request almost verbatim. I'm a bit confused about reserved registers - does marking them as reserved simply prevent users from using them as in/out parameters to the |
Yes, we mark them with |
Should I add any tests to verify the compiler outputs errors for the reserved registers? |
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.
In the docs, add entries in the "Template modifiers" section: this should indicate that PowerPC registers are rendered as plain integers in inline assembly without any prefix letters.
Looks like we got the fix merged for the LLVM bug :) |
You need to update the llvm-project submodule in this PR to actually pick up the fix. |
Ah - dang. I didn't catch that it was a submodule. Will do in a few jiffies. |
Alright - I verified locally that my test is fixed. |
@bors r+ |
📌 Commit 3a2df79b55f16a6ac0d18b26a2de58beacb64458 has been approved by |
@bors r+ |
📌 Commit c03e125fc71bcf40db8547f34c65eab56e839bf4 has been approved by |
⌛ Testing commit c03e125fc71bcf40db8547f34c65eab56e839bf4 with merge 293f82850c006376f8bdc124b2cb371c20a51283... |
This comment has been minimized.
This comment has been minimized.
Ack. I didn't find and replace the ones with |
💔 Test failed - checks-actions |
☔ The latest upstream changes (presumably #83894) made this pull request unmergeable. Please resolve the merge conflicts. |
This includes GPRs and FPRs only
Rebased the branch and it should be good to go. |
@bors r+ |
📌 Commit b1bb5d6 has been approved by |
☀️ Test successful - checks-actions |
Add asm!() support for PowerPC64 I was anticipating this to be difficult so I didn't do it as part of rust-lang#84732... but this was pretty easy to do 👀
This includes GPRs and FPRs only.
Note that this does not include PowerPC64.
For my reference, this was mostly duplicated from PR #73214.