[llvm-dev] [compiler-rt] Support 128 bits soft-floating point without int128_t support

Alex Bradbury via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 30 06:39:09 PST 2018

On 30 January 2018 at 14:12, Kito Cheng via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hi all:
> I'm porting RISC-V[1] for compiler-rt recently, and I've got a problem
> when adding soft float routine for rv32, RISC-V ABI required 128 bits
> bits for long double, but it's implemented by int128_t, however rv32
> don't support __int128_t.
> Of cause, it not hard thing to support __int128_t by overriding
> TargetInfo::hasInt128Type for LLVM, but its will cause some ABI
> incompatible with GCC, because GCC don't support __int128_t for 32
> bits target.
> So I guess I've few option here:
> 1. Implement 128 bits soft-float with int64_t.
> 2. Add an option to force enable int128_t support during building
> compiler-rt for rv32.
> Any other suggestion?

As a point of information, it would be useful to know if there are any
major drawbacks or challenges to adding __int128_t support to GCC for
RV32. Looking at Clang, it seems (by my reading) that Wasm32 is the
only 32-bit target supporting __int128_t (though x86-64 with 32-bit
ABI and Mips64 with 32-bit ABI also support it). Given that `long
double` is 128 bits on both RV32 and RV64, __int128_t wouldn't be the
only 128-bit type.



More information about the llvm-dev mailing list