gen/target: make real 128bit on RISC-V targets

RISC-V ILP32/LP64 ABI defines `long double` as 128bit.

Reference: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#cc-type-details
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
Luís Ferreira 2022-01-07 01:06:20 +00:00
parent 6a56267699
commit 3b175db8af
No known key found for this signature in database
GPG key ID: 730750D54B7A9F66

View file

@ -49,7 +49,8 @@ llvm::Type *getRealType(const llvm::Triple &triple) {
// AArch64 targets except Darwin (64-bit) use 128-bit quadruple precision. // AArch64 targets except Darwin (64-bit) use 128-bit quadruple precision.
// FIXME: PowerPC, SystemZ, ... // FIXME: PowerPC, SystemZ, ...
if ((anyAarch64 && !triple.isOSDarwin()) || if ((anyAarch64 && !triple.isOSDarwin()) ||
(isAndroid && a == llvm::Triple::x86_64)) { (isAndroid && a == llvm::Triple::x86_64) ||
triple.isRISCV()) {
return llvm::Type::getFP128Ty(ctx); return llvm::Type::getFP128Ty(ctx);
} }