What is the portable 128-bit floating point type?

Konstantin Belousov kostikbel at gmail.com
Sat May 25 20:04:48 UTC 2019


On Sat, May 25, 2019 at 12:42:26PM -0700, Yuri wrote:
> 'long double' is 12 bytes on i386 and 16 bytes on amd64.
> 
> There is a gcc-specific  __float128 type: 
> https://stackoverflow.com/questions/13516476/long-double-gcc-specific-and-float128
> 
Neither i386 nor amd64 have hardware-supported 128 bit floating point
type. long double is defined by both i386 and amd64 Unix ABI as 80 bits
(10 bytes) representation as defined by IEEEE FP standard and supported
by x87 FPU (not-SSE). The difference in size is due to the different
natural alignment between 32 and 64 bit ISA.

The x86_64 psABI has interesting note that Android (non-Unix) ABI defines
128bit representation for long double.  Operations on it must be implemented
in software.


More information about the freebsd-hackers mailing list