rustc_target/asm: add LoongArch LSX/LASX inline asm register support#158364
rustc_target/asm: add LoongArch LSX/LASX inline asm register support#158364heiher wants to merge 3 commits into
Conversation
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
|
|
This looks fine to me but I'm not sure whether we typically need T-lang to sign off on extensions to stable inline asm. @Amanieu do you know if this needs a T-lang FCP? |
|
AFAIK, a common way to add support for new registers in architectures where inline assembly is stable is to use asm_experimental_reg (#133416). |
Thanks for pointing that out. I think gating new inline assembly register support behind |
Add support for LoongArch LSX and LASX registers in inline assembly by introducing the `vreg` and `xreg` register classes, along with their associated vector types and operand modifiers. The new register classes are gated behind the `asm_experimental_reg` feature. Also model the overlap between FPU, LSX, and LASX registers so register conflict checking works correctly for aliased registers.
Add UI tests for LoongArch LSX/LASX inline asm registers, including target-feature gating and overlap diagnostics between `fN`, `vrN`, and `xrN` registers.
Add assembly tests for LoongArch inline asm register modifiers. Verify that the `w` and `u` modifiers correctly select LSX and LASX register views for `freg`, `vreg`, and `xreg` operands and produce the expected register names in the generated assembly.
|
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. |
|
The newly added |
Add support for LoongArch LSX and LASX registers in inline assembly by introducing the
vregandxregregister classes, along with their associated vector types and operand modifiers. The new register classes are gated behind theasm_experimental_regfeature. Also model the overlap between FPU, LSX, and LASX registers so register conflict checking works correctly for aliased registers.