From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14602 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Looking for a libm suitable for float128 (using softfloat or softfp) Date: Sat, 31 Aug 2019 14:25:01 +0200 Message-ID: <20190831122500.GS22009@port70.net> References: 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="75887"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: ardi To: musl@lists.openwall.com Original-X-From: musl-return-14618-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 31 14:25:16 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 1i42RQ-000JeC-DX for gllmg-musl@m.gmane.org; Sat, 31 Aug 2019 14:25:16 +0200 Original-Received: (qmail 21624 invoked by uid 550); 31 Aug 2019 12:25:14 -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 21603 invoked from network); 31 Aug 2019 12:25:13 -0000 Mail-Followup-To: musl@lists.openwall.com, ardi Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:14602 Archived-At: * ardi [2019-08-31 13:33:48 +0200]: > I'm looking for a software implementation of libm that can deal with > the IEEE float128 (float128 as implemented by either the John Hauser's > softfloat or Fabrice Bellard's softfp libraries). i think you just want an ieee-754 binary128 libm. whether the underlying hw has instructions for it or they are software emulated are not hugely relevant. (some functions can be implemented more efficiently if you know there are no fp units, but then usually you would not use the ieee elementary operations either, e.g. doing plain int arithmetics can be faster than using a soft fp lib) > Looking at the musl source in src/math it certainly implements long > double versions of all libm functions, and it seems that the source > code makes checks to confirm whether to use the Intel 80bit long > double, or a 128bit long double, so, at first glance I think musl > could be a great choice for this task. > > But I'm wondering if I can rely on the 128bit implementations at > src/math, or if this is untested code. you can rely on it when there is actual implementation, but many functions are missing (or just dummy functions calling the double prec version) > > BTW, yes, I know there's libquadmath, but it's LGPL and I'd prefer to > avoid it because sometimes I need static linking. > > Would you recommend me to use musl for this, or would you advice to > use other alternatives? i don't know of opensource 128bit complete libm implementation other than the code in glibc (lgpl), but there are arbitrary precision libraries and they may be good enough if you only need software implementation anyway. i think http://arblib.org/ (lgpl) has quite complete coverage of math functions and should be no more than 2-3x slower than soft fp code optimized for 128bit floats (mpfr is slower than that).