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

Asm constraint to require an even register #37

Open
asb opened this issue Apr 26, 2023 · 2 comments · May be fixed by #39
Open

Asm constraint to require an even register #37

asb opened this issue Apr 26, 2023 · 2 comments · May be fixed by #39

Comments

@asb
Copy link

asb commented Apr 26, 2023

We don't currently have an asm constraint to require an even register (for an input or output in a register pair) and I don't believe there's a cross-target constraint already defined. We should likely decide on one. This could be used with the proposed zacas extension (amocas.d on rv32 or amocas.q on rv64), for zdinx, and IIRC the P extension.

@kito-cheng
Copy link
Collaborator

Good catch, Zdinx still using f in GCC internally, but I think we should have one for P and Zacas

@kito-cheng kito-cheng linked a pull request Apr 27, 2023 that will close this issue
@kito-cheng
Copy link
Collaborator

#39

asb added a commit to llvm/llvm-project that referenced this issue Jul 10, 2023
This implements the v1.0-rc1 draft extension.

amocas.d on RV32 and amocas.q have the restriction that rd and rs2 must
be even registers. I've opted to implement this restriction in
RISCVAsmParser::validateInstruction even though for codegen we'll need a
new register class and can then remove this validation. This also
sidesteps, for now, the issue of amocas.d being different on rv32 vs
rv64.

See <riscv-non-isa/riscv-c-api-doc#37> for the
issue of needing an agreed asm register constraint for register pairs.

Differential Revision: https://reviews.llvm.org/D149248
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 a pull request may close this issue.

2 participants