From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14990 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Stefan Kanthak" Newsgroups: gmane.linux.lib.musl.general Subject: More additions for the math/i386 subtree Date: Tue, 10 Dec 2019 22:48:18 +0100 Organization: Me, myself & IT Message-ID: <2DBF29D377CC4516BCB01E382C0EEF31@H270> 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="147634"; mail-complaints-to="usenet@blaine.gmane.org" To: Original-X-From: musl-return-15006-gllmg-musl=m.gmane.org@lists.openwall.com Tue Dec 10 22:57:38 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 1ienVh-000cHX-AO for gllmg-musl@m.gmane.org; Tue, 10 Dec 2019 22:57:37 +0100 Original-Received: (qmail 5228 invoked by uid 550); 10 Dec 2019 21:57:35 -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 5189 invoked from network); 10 Dec 2019 21:57:34 -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:14990 Archived-At: Optimised branch-free implementations of fmax() and fmin() for i386 JFTR: I'm NOT subscribed to your mailing list, so CC: me in replies! --- -/dev/null +++ +/src/math/i386/fmax.S @@ -0,0 +1,26 @@ +.global fmaxf +.type fmaxf,@function +fmaxf: + flds 4(%esp) + flds 8(%esp) + jmp 1f + +.global fmaxl +.type fmaxl,@function +fmaxl: + fldt 4(%esp) + fldt 16(%esp) + jmp 1f + +.global fmax +.type fmax,@function +fmax: + fldl 4(%esp) + fldl 12(%esp) +1: fucomi %st(0),%st(0) + fcmovu %st(1),%st(0) + fxch %st(1) + fucomi %st(1),%st(0) + fcmovu %st(1),%st(0) + fstp %st(1) + ret --- -/dev/null +++ +/src/math/i386/fmin.S @@ -0,0 +1,26 @@ +.global fminf +.type fminf,@function +fminf: + flds 4(%esp) + flds 8(%esp) + jmp 1f + +.global fminl +.type fminl,@function +fminl: + fldt 4(%esp) + fldt 16(%esp) + jmp 1f + +.global fmin +.type fmin,@function +fmin: + fldl 4(%esp) + fldl 12(%esp) +1: fucomi %st(0),%st(0) + fcmovu %st(1),%st(0) + fucomi %st(1),%st(0) + fcmovu %st(1),%st(0) + fstp %st(1) + ret