From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11169 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] aarch64: add single instruction math functions Date: Sun, 19 Mar 2017 15:51:34 +0100 Message-ID: <20170319145134.GR2082@port70.net> References: <20170319042644.GP2082@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 1489935107 20950 195.159.176.226 (19 Mar 2017 14:51:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Mar 2017 14:51:47 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) To: musl@lists.openwall.com Original-X-From: musl-return-11184-gllmg-musl=m.gmane.org@lists.openwall.com Sun Mar 19 15:51:43 2017 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 1cpcBK-00050L-CL for gllmg-musl@m.gmane.org; Sun, 19 Mar 2017 15:51:42 +0100 Original-Received: (qmail 26536 invoked by uid 550); 19 Mar 2017 14:51:46 -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 26518 invoked from network); 19 Mar 2017 14:51:46 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11169 Archived-At: * David Edelsohn [2017-03-19 08:55:58 -0400]: > I thought that the goal of musl was "Minimal machine-specific code". > Does musl want to start a new arms race? this is not ideal, but the generic code is not ideal either. gcc will inline most calls and those will behave differently compared to the generic code as explained (at least for some of the rounding functions and fma) i plan to add FP_FAST_FMA support in math.h but for that targets with fma should have a single instruction implementation. (it turns out gcc does not set __FP_FAST_FMA correctly so the libc has to work harder) another approach i thought of but did not implement was math/builtin/foo.c has '.. return __builtin_foo(); ..' and math/arch/foo.c has '#include "../builtin/foo.c"' ifdefed if the compiler has support for the builtin and it is known to be not a call libc. (then the maintenance is minimized on the musl side, it's on the compiler to get it right, but we need much more configure check machinery)