From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13397 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] PPC64 IEEE128 bit FP support Date: Fri, 2 Nov 2018 15:06:49 -0400 Message-ID: <20181102190649.GN5150@brightrain.aerifal.cx> References: <20181026042829.GB28637@voyager> <20181026130119.GD3880@port70.net> <20181102161335.GL5150@brightrain.aerifal.cx> <20181102175515.GC2032@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1541185502 9904 195.159.176.226 (2 Nov 2018 19:05:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2018 19:05:02 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13413-gllmg-musl=m.gmane.org@lists.openwall.com Fri Nov 02 20:04:58 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gIekY-0002N2-Sq for gllmg-musl@m.gmane.org; Fri, 02 Nov 2018 20:04:54 +0100 Original-Received: (qmail 14322 invoked by uid 550); 2 Nov 2018 19:07:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 14071 invoked from network); 2 Nov 2018 19:07:01 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13397 Archived-At: On Fri, Nov 02, 2018 at 02:00:36PM -0400, David Edelsohn wrote: > IEEE binary64 still will be available for long double. > > Current musl libc has not been compatible with the ABI and with > current GLIBC because it did not implement IBM double-double format. > > Musl libc can call it an ABI break, but musl libc has not been compatible. We do not implement the same ABI as glibc on all systems. On a very few, it's mostly or entirely the same, but at least on PowerPC and MIPS there are significant differences. > And the new configuration in GCC, LLVM and GLIBC allow both IBM > double-double and IEEE 754 binary128 to co-exist. Changing the musl > libc dynamic linker name doesn't fix that and actually makes musl libc > even less compatible with the rest of the PPC64LE Linux Ecosystem. I don't know what you mean by "allow double-double and IEEE [quad] to co-exist". Object files/shared libraries built for one obviously cannot be linked with the other. The way incompatible archs/ABIs co-exist on musl is always via different ldso names and library paths; this is regardless of arch (and even across different archs). If there's some other way of doing it on glibc/powerpc, like having a shared dynamic linker that selects the right-ABI libraries to load, that's fine for glibc but unrelated to musl. Rich > On Fri, Nov 2, 2018 at 1:55 PM Szabolcs Nagy wrote: > > > > * David Edelsohn [2018-11-02 13:32:55 -0400]: > > > I don't know if it would be necessary for musl libc long double to be > > > selectable for backward compatibility or one can implement a "flag > > > day" where a musl libc release switches to only 128 bit quad precision > > > long double. > > > > since currently long double is ieee-binary64 in musl, > > if we want it to be ieee-binary128 then that's a new > > abi and in musl new abi means a new dynamic linker name: > > current toolchain uses /lib/ld-musl-powerpc64le.so.1, a new > > toolchain would use e.g. /lib/ld-musl-powerpc64le_f128.so.1 > > > > i think even if the 64bit long double is deprecated and not > > selectable in gcc anymore, we would use a new dynamic > > linker name (but i think in musl we can easily keep supporting > > two long double variants, the difficulty is in the gcc config > > machinery and ux issues if there are no abi markers for > > relocatable objects to detect abi mismatch at link time). > > > > > > > > Thanks, David > > > On Fri, Nov 2, 2018 at 12:13 PM Rich Felker wrote: > > > > > > > > On Fri, Oct 26, 2018 at 03:01:20PM +0200, Szabolcs Nagy wrote: > > > > > * Markus Wichmann [2018-10-26 06:28:29 +0200]: > > > > > > Now you just need to look through all the maths code to find all the > > > > > > places that need changing. __floatscan() comes to mind immediately. And > > > > > > I don't know if any of the libm functions needs adjustment for this new > > > > > > format. > > > > > > > > > > generic c code in musl should work for all supported > > > > > floating-point formats, which includes ieee binary128 > > > > > for long double. > > > > > > > > > > only float.h needs to be set up according to the abi. > > > > > > > > > > some long double math functions don't have high quality > > > > > implementations for ieee binary128 format though. > > > > > > > > Yes. Assuming there aren't other problems revealed by my questions > > > > about argument passing and ISA levels, I think the only blocking issue > > > > here is naming the ABI. I forgot to mention but that should also > > > > involve a gcc patch that we can put in mcm and eventually upstream. > > > > > > > > QoI issues for IEEE-quad-based [sub]archs can be improved later; > > > > aarch64 and s390x are already affected IIRC. > > > > > > > > Rich