Skip to content
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

Support predicate registers (clobber-only) in Hexagon inline assembly #133452

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Nov 25, 2024

The result of the Hexagon instructions such as comparison, store conditional, etc. is stored in predicate registers (p[0-3]), but currently there is no way to mark it as clobbered in asm!.

This is also needed for clobber_abi (although implementing clobber_abi will require the addition of support for several more register classes. see also #93335 (comment)).

Refs:

cc @androm3da (target maintainer of hexagon-unknown-{none-elf,linux-musl})

r? @Amanieu

@rustbot label +A-inline-assembly
(Currently there is no O-hexagon label...)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 25, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 25, 2024

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added the A-inline-assembly Area: Inline assembly (`asm!(…)`) label Nov 25, 2024
@androm3da
Copy link
Contributor

This change LGTM.

Thanks @taiki-e !

@Amanieu
Copy link
Member

Amanieu commented Nov 28, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Nov 28, 2024

📌 Commit 59f01cd has been approved by Amanieu

It is now in the queue for this repository.

@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 Nov 28, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2024
…llaumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133358 (Don't type error if we fail to coerce `Pin<T>` because it doesnt contain a ref)
 - rust-lang#133422 (Fix clobber_abi in RV32E and RV64E inline assembly)
 - rust-lang#133452 (Support predicate registers (clobber-only) in Hexagon inline assembly)
 - rust-lang#133463 (Fix handling of x18 in AArch64 inline assembly on ohos/trusty or with -Zfixed-x18)
 - rust-lang#133487 (fix confusing diagnostic for reserved `##`)
 - rust-lang#133557 (Small doc fixes in `rustc_codegen_ssa`)
 - rust-lang#133560 (Trim extra space in 'repeated `mut`' diagnostic)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 470c4f9 into rust-lang:master Nov 28, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Nov 28, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2024
Rollup merge of rust-lang#133452 - taiki-e:hexagon-asm-pred, r=Amanieu

Support predicate registers (clobber-only) in Hexagon inline assembly

The result of the Hexagon instructions such as comparison, store conditional, etc. is stored in predicate registers (`p[0-3]`), but currently there is no way to mark it as clobbered in `asm!`.

This is also needed for `clobber_abi` (although implementing `clobber_abi` will require the addition of support for [several more register classes](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp#L71-L90). see also rust-lang#93335 (comment)).

Refs:
- [Section 6 "Conditional Execution" in Qualcomm Hexagon V73 Programmer’s Reference Manual](https://docs.qualcomm.com/bundle/publicresource/80-N2040-53_REV_AB_Qualcomm_Hexagon_V73_Programmers_Reference_Manual.pdf#page=90)
- [Register definition in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/Hexagon/HexagonRegisterInfo.td#L155)

cc `@androm3da` (target maintainer of hexagon-unknown-{[none-elf](https://doc.rust-lang.org/nightly/rustc/platform-support/hexagon-unknown-none-elf.html#target-maintainers),[linux-musl](https://doc.rust-lang.org/nightly/rustc/platform-support/hexagon-unknown-linux-musl.html#target-maintainers)})

r? `@Amanieu`

`@rustbot` label +A-inline-assembly
(Currently there is no O-hexagon label...)
@taiki-e taiki-e deleted the hexagon-asm-pred branch November 28, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) 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.

5 participants