-
Notifications
You must be signed in to change notification settings - Fork 14k
asm! support for the Xtensa architecture #147302
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
base: main
Are you sure you want to change the base?
Conversation
|
Some changes occurred in compiler/rustc_codegen_gcc |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
This is also missing an update to the unstable book entry for asm_experimental_arch.
| def_reg_class! { | ||
| Xtensa XtensaInlineAsmRegClass { | ||
| reg, | ||
| freg, |
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.
LLVM doesn't seem to support this. XtensaTargetLowering::getRegForInlineAsmConstraint only handles r constraints.
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.
It will just not yet. I'll back out the floating point bits for now, unless you think it's okay to land ready for the LLVM updates.
|
☔ The latest upstream changes (presumably #147645) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Taiki Endo <te316e89@gmail.com> Co-authored-by: Kerry Jones <kerry@iodrive.co.za>
|
I've made most of the updates here (sorry for the delay!). It turns out we'll need a patch that landed just after rust branched LLVM: https://github.com/rust-lang/llvm-project/tree/rustc/21.1-2025-08-01/llvm/lib/Target/Xtensa , otherwise the asm tests fail :(. The good news is that we've since landed FP support in LLVM upstream too, so maybe the next time rust branches LLVM 21 (I guess 21.2?) we can rerun CI on this PR and it will be green. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This implements the asm! support for Xtensa. We've been using this code for a few years in our fork and it's been working well. I finally found some time to clean it up a bit and start the upstreaming process. This should be one of the final PRs for Xtensa support on the Rust side (minus bug fixes of course). After this, we're mostly just waiting on the LLVM upstreaming which is going well. This PR doesn't cover all possible asm options for Xtensa, but the base ISA plus a few extras that are used in Espressif chips.
r? Amanieu