From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11177 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] aarch64: add single instruction math functions Date: Tue, 21 Mar 2017 12:50:37 -0400 Message-ID: <20170321165037.GC17319@brightrain.aerifal.cx> 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 1490115063 13874 195.159.176.226 (21 Mar 2017 16:51:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Mar 2017 16:51:03 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11191-gllmg-musl=m.gmane.org@lists.openwall.com Tue Mar 21 17:50:59 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 1cqMzf-00024o-Bu for gllmg-musl@m.gmane.org; Tue, 21 Mar 2017 17:50:47 +0100 Original-Received: (qmail 6021 invoked by uid 550); 21 Mar 2017 16:50:52 -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 5999 invoked from network); 21 Mar 2017 16:50:51 -0000 Content-Disposition: inline In-Reply-To: <20170319042644.GP2082@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11177 Archived-At: On Sun, Mar 19, 2017 at 05:26:45AM +0100, Szabolcs Nagy wrote: > this should increase performance and reduce code size on aarch64. > > the compiled code was checked against using __builtin_* instead > of inline asm with gcc-6.2.0. > > lrint is two instructions. > > c with inline asm is used because it is safer than a pure asm > implementation, this prevents ll{rint,round} to be an alias > of l{rint,round} (because the types don't match) and depends > on gcc style inline asm support. > > ceil, floor, round, trunc can either raise inexact on finite > non-integer inputs or not raise any exceptions. the new > implementation does not raise exceptions while the generic > c code does. > > on aarch64, the underflow exception is signaled before rounding > (ieee 754 allows both before and after rounding, but it must be > consistent), the generic fma c code signals it after rounding > so using single instruction fixes a slight conformance issue too. > --- Thanks, committing. Rich