riscv-non-isa / riscv-elf-psabi-doc

A RISC-V ELF psABI Document
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
691 stars 163 forks source link

Calling convention uses RV64GQ without definition or reference #411

Closed PerMildner closed 10 months ago

PerMildner commented 10 months ago

https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#default-abis says:

Although RV64GQ systems can technically use LP64Q, it is strongly recommended to use LP64D on general-purpose RV64GQ systems for compatibility with standard RV64G software.

The term "RV64GQ" is used without reference or link. The term is not common (48 hits on Google, all of them pointing at the above quote), so perhaps a link or definition should be added.

jrtc27 commented 10 months ago

It's an ISA string like any other. We're not here to define what a RISC-V ISA string is.

nick-knight commented 10 months ago

I think it is fair for this document to assume a reading of the ISA spec without making explicit references: there would simply be too many.

"RV64GQ" is well defined following the ISA spec, Vol. I, Ch. 30.

PerMildner commented 10 months ago

Thanks for the pointers.

The information is surprisingly hard to find, even with the above information (as I mentioned, the string "RV64GQ" is essentially absent from Internet). I eventually found the Subset Naming Convention.

I understand that it makes sense to close this ticket, as there is a lot of "you should already know this" which makes some references redundant.

I do not know whether I fit the target audience: I am porting a commercial programming language implementation, based on an emulator written in C, so most things "just works" in Ubuntu on risc64, but I need to write a small assembly stub for calling from our language to "foreign functions" written in C.

So, I know next to nothing about RISC-V but I need the details about the calling convention. For other targets (x86/x64/PPC/ARM64) I have done this by just looking at calling convention documentation (and the assembly reference, of course).