Closed a4lg closed 1 year ago
Current status is:
__riscv_32e
if RVE
is enabled (regardless which XLEN is in use). Afaik RVE is limited to rv32 in GCC at the moment, so this change won't break anything.__riscv_abi_rve
if ABIName == "ilp32e"
(see clang/lib/Basic/Targets/RISCV.cpp
).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.
Additional changes:
Added LP64E ABI references to the definitions of __riscv_abi_rve
and __riscv_float_abi_soft
.
@cmuellner
Seems GCC also defines __riscv{,_float}_abi
macros (cf. riscv_cpu_cpp_builtins
function in gcc/config/riscv/riscv-c.cc
).
LGTM, we also need the LLVM community comments.
The LLVM implementation (https://reviews.llvm.org/D70401) is the same as the proposal, so I will give a LGTM. Thanks! :-)
Are there patches for GCC available?
@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.
@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.
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.
Ok, so let's merge this.
Thanks!
__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 theE
extension, there is__riscv_e
preprocessor macro.