Date: Sat, 25 May 2019 23:30:58 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Yuri <yuri@rawbw.com>, Freebsd hackers list <freebsd-hackers@freebsd.org> Subject: Re: What is the portable 128-bit floating point type? Message-ID: <3E0ACABC-D17B-45AD-9810-06ADA52F597A@FreeBSD.org> In-Reply-To: <20190525210311.GW2748@kib.kiev.ua> References: <eb15d9e4-c1d4-3886-a3b7-1264c12396cd@rawbw.com> <20190525200437.GV2748@kib.kiev.ua> <e13bc70d-4d7e-3407-a0a0-14a64f94addd@rawbw.com> <20190525210311.GW2748@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_76C08A40-D0CB-4F7E-8593-DEE4D48C7C96 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 25 May 2019, at 23:03, Konstantin Belousov <kostikbel@gmail.com> wrote: > > On Sat, May 25, 2019 at 01:50:24PM -0700, Yuri wrote: >> On 2019-05-25 13:04, Konstantin Belousov wrote: >>> 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. >> >> >> So it looks like there is no true quad-precision float available. >> >> >> Based on this conversation https://github.com/bluescarni/mppp/issues/186 >> FreeBSD used to support __float128. Why was it removed? > No idea, it seems to be clang-specific. gcc 8.3 does accept the type. Gcc appears to support __float128 since ~2007, roughly from gcc 4.3 onwards: https://gcc.gnu.org/onlinedocs/gcc-4.3.6/gcc/Floating-Types.html There it says "__float128 is supported on x86_64 and ia64 targets", but in the most recent version: https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html it says "__float128 is available on i386, x86_64, IA-64, and hppa HP-UX, as well as on PowerPC GNU/Linux targets that enable the vector scalar (VSX) instruction set". Of course it is also dependent on libgcc, if the hardware does not have native support for this float width. Clang modeled its support on gcc's example, and similarly the library support is in compiler-rt, at least for x86_64 and some other architectures. But from clang's OSTargets.h file, it looks like 128 bit float support is never set to enabled for FreeBSD. > On the other hand, I have no idea if any support is required from > libgcc (probably it is), and we almost certainly do not have it in > the base library. In libcompiler_rt, it's only enabled for aarch64 and riscv: # # 128-bit quad precision long double support, # only used on some architectures. # .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" SRCF+= addtf3 SRCF+= comparetf2 SRCF+= divtf3 SRCF+= extenddftf2 SRCF+= extendsftf2 SRCF+= fixtfdi SRCF+= fixtfsi SRCF+= fixtfti SRCF+= fixunstfdi SRCF+= fixunstfsi SRCF+= fixunstfti SRCF+= floatunsitf SRCF+= multf3 SRCF+= subtf3 SRCF+= trunctfdf2 SRCF+= trunctfsf2 .endif -Dimitry --Apple-Mail=_76C08A40-D0CB-4F7E-8593-DEE4D48C7C96 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXOm0EgAKCRCwXqMKLiCW o4a1AJ9HVVGYB4jFtcx7dFBQEacl1MEFVACfV2kgGQgBotHOCDHsvhCZEiwBDcs= =zsnN -----END PGP SIGNATURE----- --Apple-Mail=_76C08A40-D0CB-4F7E-8593-DEE4D48C7C96--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E0ACABC-D17B-45AD-9810-06ADA52F597A>