From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 16:58:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD46106566C; Sun, 16 Sep 2012 16:58:50 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AA448FC08; Sun, 16 Sep 2012 16:58:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GGwn2x034877; Sun, 16 Sep 2012 16:58:49 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GGwnM6034873; Sun, 16 Sep 2012 16:58:49 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201209161658.q8GGwnM6034873@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 16 Sep 2012 16:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240566 - head/lib/msun/i387 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 16:58:50 -0000 Author: tijl Date: Sun Sep 16 16:58:49 2012 New Revision: 240566 URL: http://svn.freebsd.org/changeset/base/240566 Log: Optimise i387 trigonometric functions. Replace "andw 0x400,%ax \ jnz" with "sahf \ jp", "fprem1" with "fprem" and "fstsw %ax" with "fnstsw %ax". Modified: head/lib/msun/i387/s_cos.S head/lib/msun/i387/s_sin.S head/lib/msun/i387/s_tan.S Modified: head/lib/msun/i387/s_cos.S ============================================================================== --- head/lib/msun/i387/s_cos.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_cos.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,16 +40,16 @@ ENTRY(cos) fldl 4(%esp) fcos fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fcos ret Modified: head/lib/msun/i387/s_sin.S ============================================================================== --- head/lib/msun/i387/s_sin.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_sin.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,16 +40,16 @@ ENTRY(sin) fldl 4(%esp) fsin fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fsin ret Modified: head/lib/msun/i387/s_tan.S ============================================================================== --- head/lib/msun/i387/s_tan.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_tan.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,17 +40,17 @@ ENTRY(tan) fldl 4(%esp) fptan fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f fstp %st(0) ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 - fstsw %ax - andw $0x400,%ax - jnz 2b +2: fprem + fnstsw %ax + sahf + jp 2b fstp %st(1) fptan fstp %st(0)