Skip to content

Add RVC GPR Pair Constraint - cR #102

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

lenary
Copy link
Contributor

@lenary lenary commented Jan 23, 2025

This follows the notion of using c as a prefix to mean "RVC-compatible", and R to mean "even-odd GPR Pair".

The Zclsd specification adds registers with this constraint, in particular the c.ld and c.sd instructions need it.

This follows the notion of using `c` as a prefix to mean
"RVC-compatible", and `R` to mean "GPR Pair".

The Zclsd specification adds registers with this constraint, in
particular the `c.ld` and `c.sd` instructions need it.
lenary added a commit to lenary/llvm-project that referenced this pull request Jan 23, 2025
This denotes RVC-compatible GPR Pairs, which are used by the Zclsd
extension.

C API PR: riscv-non-isa/riscv-c-api-doc#102
lenary added a commit to llvm/llvm-project that referenced this pull request Jan 24, 2025
This denotes RVC-compatible GPR Pairs, which are used by the Zclsd
extension.

C API PR: riscv-non-isa/riscv-c-api-doc#102
github-actions bot pushed a commit to arm/arm-toolchain that referenced this pull request Jan 24, 2025
This denotes RVC-compatible GPR Pairs, which are used by the Zclsd
extension.

C API PR: riscv-non-isa/riscv-c-api-doc#102
Copy link
Collaborator

@kito-cheng kito-cheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it's reasonable and also trivial to implement, I saw you already implemented in LLVM and I believe it's also trivial to support on GCC side, although it's kinda late to GCC since it's become bug fix only development stage, so that may defer to GCC 16, but I think it's fine to moving forward here.

@lenary
Copy link
Contributor Author

lenary commented Feb 10, 2025

Sorry for missing your release window :( I figured this would be uncontroversial enough that I could add it to LLVM for our release.

@cmuellner
Copy link
Collaborator

We discussed this briefly in today's SIG Toolchain call and agreed to land this.
LLVM support landed already and GCC support is in development.

@cmuellner cmuellner merged commit fdd554c into riscv-non-isa:main May 8, 2025
2 checks passed
@kito-cheng
Copy link
Collaborator

The patch has been sent, and will land once CI pass: https://gcc.gnu.org/pipermail/gcc-patches/2025-May/683737.html

@lenary
Copy link
Contributor Author

lenary commented May 15, 2025

Thanks @kito-cheng!

@lenary lenary deleted the pr/inline-asm-rvc-pair branch May 15, 2025 05:09
hubot pushed a commit to gcc-mirror/gcc that referenced this pull request May 19, 2025
This commit introduces a new operand constraint `cR` for the RISC-V
architecture, which allows the use of an even-odd RVC general purpose register
(x8-x15) in inline asm.

Ref: riscv-non-isa/riscv-c-api-doc#102

gcc/ChangeLog:

	* config/riscv/constraints.md (cR): New constraint.
	* doc/md.texi (Machine Constraints::RISC-V): Document the new cR
	constraint.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/constraint-cR-pair.c: New test case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants