From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14982 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Stefan Kanthak" Newsgroups: gmane.linux.lib.musl.general Subject: Patches for math subtree Date: Sat, 7 Dec 2019 21:15:34 +0100 Organization: Me, myself & IT Message-ID: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="151445"; mail-complaints-to="usenet@blaine.gmane.org" To: Original-X-From: musl-return-14998-gllmg-musl=m.gmane.org@lists.openwall.com Sat Dec 07 21:23:58 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 1idgcQ-000dIC-D5 for gllmg-musl@m.gmane.org; Sat, 07 Dec 2019 21:23:58 +0100 Original-Received: (qmail 9572 invoked by uid 550); 7 Dec 2019 20:23:56 -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 8023 invoked from network); 7 Dec 2019 20:21:49 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.24158 X-VADE-STATUS: LEGIT Xref: news.gmane.org gmane.linux.lib.musl.general:14982 Archived-At: Just some optimisations. --- -/src/math/i386/remquo.s +++ +/src/math/i386/remquo.s @@ -23,23 +23,17 @@ remquo: mov 20(%esp),%ecx fldl 12(%esp) fldl 4(%esp) mov 19(%esp),%dh xor 11(%esp),%dh 1: fprem1 fnstsw %ax sahf jp 1b fstp %st(1) - mov %ah,%dl - shr %dl - and $1,%dl - mov %ah,%al - shr $5,%al - and $2,%al - or %al,%dl - mov %ah,%al - shl $2,%al - and $4,%al - or %al,%dl + setc %dl + shl $2,%ah + adc %dl,%dl + shl $5,%ah + adc %dl,%dl test %dh,%dh --- -/src/math/ceil.c +++ +/src/math/ceil.c @@ -18,10 +18,10 @@ + /* special case because of non-nearest rounding modes */ + if (e < 0x3ff) { + FORCE_EVAL(y); + return u.i >> 63 ? -0.0 : 1.0; + } /* y = int(x) - x, where int(x) is an integer neighbor of x */ if (u.i >> 63) y = x - toint + toint - x; else y = x + toint - toint - x; - /* special case because of non-nearest rounding modes */ - if (e <= 0x3ff-1) { - FORCE_EVAL(y); - return u.i >> 63 ? -0.0 : 1; - } --- -/src/math/floor.c +++ +/src/math/floor.c @@ -18,10 +18,10 @@ + /* special case because of non-nearest rounding modes */ + if (e < 0x3ff) { + FORCE_EVAL(y); + return u.i >> 63 ? -1.0 : 0.0; + } /* y = int(x) - x, where int(x) is an integer neighbor of x */ if (u.i >> 63) y = x - toint + toint - x; else y = x + toint - toint - x; - /* special case because of non-nearest rounding modes */ - if (e <= 0x3ff-1) { - FORCE_EVAL(y); - return u.i >> 63 ? -1 : 0; - }