From owner-cvs-all@FreeBSD.ORG Mon Feb 25 13:33:21 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B40316A40E; Mon, 25 Feb 2008 13:33:21 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1DCD813C469; Mon, 25 Feb 2008 13:33:21 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1PDXKQj077566; Mon, 25 Feb 2008 13:33:20 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1PDXKau077565; Mon, 25 Feb 2008 13:33:20 GMT (envelope-from bde) Message-Id: <200802251333.m1PDXKau077565@repoman.freebsd.org> From: Bruce Evans Date: Mon, 25 Feb 2008 13:33:20 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/msun/src e_rem_pio2f.c math_private.h s_cosf.c s_sinf.c s_tanf.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 13:33:21 -0000 bde 2008-02-25 13:33:20 UTC FreeBSD src repository Modified files: lib/msun/src e_rem_pio2f.c math_private.h s_cosf.c s_sinf.c s_tanf.c Log: Change __ieee754_rem_pio2f() to return double instead of float so that this function and its callers cosf(), sinf() and tanf() don't waste time converting values from doubles to floats and back for |x| > 9pi/4. All these functions were optimized a few years ago to mostly use doubles internally and across the __kernel*() interfaces but not across the __ieee754_rem_pio2f() interface. This saves about 40 cycles in cosf(), sinf() and tanf() for |x| > 9pi/4 on amd64 (A64), and about 20 cycles on i386 (A64) (except for cosf() and sinf() in the upper range). 40 cycles is about 35% for |x| < 9pi/4 <= 2**19pi/2 and about 5% for |x| > 2**19pi/2. The saving is much larger on amd64 than on i386 since the conversions are not easy to optimize except on i386 where some of them are automatic and others are optimized invalidly. amd64 is still about 10% slower in cosf() and tanf() in the lower range due to conversion overhead. This also gives a tiny speedup for |x| <= 9pi/4 on amd64 (by simplifying the code). It also avoids compiler bugs and/or additional slowness in the conversions on (not yet supported) machines where double_t != double. Revision Changes Path 1.26 +8 -11 src/lib/msun/src/e_rem_pio2f.c 1.26 +1 -1 src/lib/msun/src/math_private.h 1.17 +6 -6 src/lib/msun/src/s_cosf.c 1.16 +6 -6 src/lib/msun/src/s_sinf.c 1.16 +3 -3 src/lib/msun/src/s_tanf.c