riscv-non-isa / riscv-c-api-doc

Documentation of the RISC-V C API
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
68 stars 38 forks source link

Add support for RV64E and LP64E #52

Closed a4lg closed 9 months ago

a4lg commented 10 months ago

__riscv_64e is defined analogously to __riscv_32e.

Changing the meaning of __riscv_32e should not cause any problems since if we are just testing for existence of the E extension, there is __riscv_e preprocessor macro.

cmuellner commented 10 months ago

Current status is:

The referenced GCC patch looks good. We probably want to have a equal behavior in GCC and LLVM (we could define __riscv_abi macros in GCC and define __riscv_*e macros in LLVM).

In general, I am fine with the change.

a4lg commented 10 months ago

Additional changes:

Added LP64E ABI references to the definitions of __riscv_abi_rve and __riscv_float_abi_soft.

a4lg commented 10 months ago

@cmuellner Seems GCC also defines __riscv{,_float}_abi macros (cf. riscv_cpu_cpp_builtins function in gcc/config/riscv/riscv-c.cc).

pz9115 commented 10 months ago

LGTM, we also need the LLVM community comments.

wangpc-pp commented 9 months ago

The LLVM implementation (https://reviews.llvm.org/D70401) is the same as the proposal, so I will give a LGTM. Thanks! :-)

cmuellner commented 9 months ago

Are there patches for GCC available?

a4lg commented 9 months ago

@cmuellner My RFC PATCH submission: https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633846.html and corresponding commit: https://github.com/a4lg/gcc/commit/72be4bc48fb0a1cdd15a99220fc951ab7aa00d30

I'll rebase against the latest master and make a ping, removing "RFC" status.

cmuellner commented 9 months ago

@kito-cheng: any objections to merging this? The change here is straight-forward and we have patches. The ABI side (https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/299) is not finalized, but I think this won't have an influence on this PR.

a4lg commented 9 months ago

Since this proposal and my GCC patch set (with a bit of modification from RFC PATCH) are approved, GCC's RV64E/LP64E support is merged into its master/trunk.

cmuellner commented 9 months ago

Ok, so let's merge this.

Thanks!