From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14316 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] powerpc64: add IEEE binary128 long double support Date: Mon, 1 Jul 2019 00:02:41 +0200 Message-ID: <20190630220241.GC21055@port70.net> References: <20190630193825.65174-1-samuel@sholland.org> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="162311"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Samuel Holland To: musl@lists.openwall.com Original-X-From: musl-return-14332-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 01 00:02:57 2019 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.89) (envelope-from ) id 1hhhuS-000g1R-SM for gllmg-musl@m.gmane.org; Mon, 01 Jul 2019 00:02:56 +0200 Original-Received: (qmail 24542 invoked by uid 550); 30 Jun 2019 22:02:54 -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 24521 invoked from network); 30 Jun 2019 22:02:54 -0000 Mail-Followup-To: musl@lists.openwall.com, Samuel Holland Content-Disposition: inline In-Reply-To: <20190630193825.65174-1-samuel@sholland.org> Xref: news.gmane.org gmane.linux.lib.musl.general:14316 Archived-At: * Samuel Holland [2019-06-30 14:38:24 -0500]: > This is added under a new "ieee128" sub-architecture. The 128-bit scalar > floating-point ABI uses the Altivec registers for parameter passing, but > no special instructions; thus, the ABI can be used with any CPU that > supports Altivec. However, hardware instructions to operate on a 128-bit > scalar are only available starting with POWER9. Any older CPU will use > software fp. > > With "-mlong-double-128 -mabi=ieeelongdouble", gcc defines both > __LONG_DOUBLE_128__ and __LONG_DOUBLE_IEEE128__. clang, when patched > with "LongDoubleFormat = &llvm::APFloat::IEEEquad();", defines > __LONG_DOUBLE_128__ but not __LONG_DOUBLE_IEEE128__, so we use > __LDBL_MANT_DIG__ to distinguish IEEE binary128 from IBM double-double. > --- > > So far the suggested ABI names have been "ld128", "ieee128", "ieeequad", > and "f128". "ieee128" is the shortest while still being unambiguous > about which 128-bit FP format is being used. > > Ideally we could use __LONG_DOUBLE_IEEE128__ as the preprocessor > condition, but it's not provided by clang. Since we have to check > __LDBL_MANT_DIG__ anyway, is checking __LONG_DOUBLE_128__ redundant? i'd only check __LDBL_MANT_DIG__ since that's what is used internally in musl where this matters.