From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9570 Path: news.gmane.org!not-for-mail From: Bobby Bingham Newsgroups: gmane.linux.lib.musl.general Subject: long double on powerpc64 Date: Thu, 10 Mar 2016 21:16:36 -0600 Message-ID: <20160311031636.GA3851@gordon.members.linode.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1457666226 9022 80.91.229.3 (11 Mar 2016 03:17:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2016 03:17:06 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9583-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 11 04:17:00 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aeDZU-0006k2-5N for gllmg-musl@m.gmane.org; Fri, 11 Mar 2016 04:17:00 +0100 Original-Received: (qmail 32729 invoked by uid 550); 11 Mar 2016 03:16:57 -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 32675 invoked from network); 11 Mar 2016 03:16:48 -0000 Content-Disposition: inline X-Operating-System: Linux gordon 3.18.1-gentoo User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9570 Archived-At: I've been working on a PPC64 port of musl lately. I've made some good progress, and it's time to decide what to do about the long double type. The PPC64 ELFv2 ABI [1] calls for a 128 bit long double. It allows an implementation to choose to use either IEEE quad, or IBM double double, with IEEE quad being preferred. On the compiler side, it looks like things are a bit of a mess. Clang only supports IBM double double on PPC64, AFAICS, and therefore won't work for us currently. GCC support is more complicated. It supports both 128 bit variants, as well as supporting (and defaulting to) a 64 bit long double. To get a 128 bit long double, you must build gcc with --with-long-double-128 or pass -mlong-double-128, and even then you get IBM double double. To get IEEE quad, you must additionally pass -mlong-double-128, though there are whispers that the default may change in gcc 7 [2]. The final piece of bad news is that gcc can't successfully build musl on PPC64 with IEEE quad long double. It chokes on even trivial code using long double complex [3]. So only 64 bit long double is usable for now. The good news is that gcc's predefined macros are sufficient to detect which long double variant is in use. My current thinking is that we can support both 64 bit long and IEEE quad as two powerpc64 subarchs, even if we can only implement 64 bit for now. Because it looks like the future direction is for IEEE quad to become the default, I think that should be the suffix-less subarch, and the 64 bit long double subarch should have a -ld64 suffix or similar. 1. https://members.openpowerfoundation.org/document/dl/576 2. https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02507.html 3. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70179 -- Bobby