Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes#154719
Conversation
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in compiler/rustc_codegen_gcc |
|
@rustbot reroll |
|
Looks good, could you squash fixup commits? |
9041897 to
baf51fc
Compare
done, thanks |
|
Should named register pairs work for input/output? When using any of the non-blocked register pairs they get rejected: |
baf51fc to
718f5cf
Compare
Good catch. Fixed. TBH I didn't know this inline asm feature existed. Also improved the test coverage. |
This comment has been minimized.
This comment has been minimized.
…classes Add new Hexagon inline asm register classes: - reg_pair: GPR double registers (r1:0 through r27:26) for i64/f64 types - vreg: HVX vector registers (v0-v31) for mode-dependent vector types - vreg_pair: HVX vector pair registers (v1:0 through v31:30) for vector pairs - qreg: HVX predicate registers (q0-q3), clobber-only Key implementation details: - GPR pairs use LLVM's 'd' register naming (d0-d13) for constraints - HVX vector pairs use LLVM's 'w' register naming (w0-w15) for constraints - Register overlap tracking for GPR pair<->single and HVX pair<->single conflicts - HVX vector types are mode-dependent (64B vs 128B HVX length) Note: vreg_quad (HVX vector quads) is not supported as LLVM's Hexagon backend does not support vector quad types in inline asm constraints.
718f5cf to
aa9da4b
Compare
|
I left out a file by mistake from the previous commit. While reviewing the omitted file I also noticed that we can/should support vreg pairs in this update. So the update in aa9da4b now includes support for those. |
|
LGTM 👍 |
…uwer Rollup of 6 pull requests Successful merges: - #154912 (Remove `BuiltinLintDiag`) - #154598 (test `#[naked]` with `#[link_section = "..."]` on windows) - #154719 (Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes) - #154057 (Parenthesize block-like expressions in index base of pretty printer) - #154893 (make `expected_literal` positive) - #155002 (Clarify that `core::range` ranges do not have special syntax)
Rollup merge of #154719 - androm3da:hexagon-inline-asm-register-classes, r=JohnTitor Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes Add three new register classes for the Hexagon inline assembly backend: * `reg_pair`: GPR double registers (r1:0 through r27:26) * `vreg`: HVX vector registers (v0-v31) * `qreg`: HVX predicate registers (q0-q3), clobber-only for now
Add three new register classes for the Hexagon inline assembly backend:
reg_pair: GPR double registers (r1:0 through r27:26)vreg: HVX vector registers (v0-v31)qreg: HVX predicate registers (q0-q3), clobber-only for now