From owner-cvs-all@FreeBSD.ORG Sat Oct 29 08:15:30 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FAE516A41F; Sat, 29 Oct 2005 08:15:30 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E46343D46; Sat, 29 Oct 2005 08:15:30 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9T8FUwG004389; Sat, 29 Oct 2005 08:15:30 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9T8FU1e004388; Sat, 29 Oct 2005 08:15:30 GMT (envelope-from bde) Message-Id: <200510290815.j9T8FU1e004388@repoman.freebsd.org> From: Bruce Evans Date: Sat, 29 Oct 2005 08:15:30 +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 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: Sat, 29 Oct 2005 08:15:30 -0000 bde 2005-10-29 08:15:30 UTC FreeBSD src repository Modified files: lib/msun/src e_rem_pio2f.c Log: Start trying to make the float precision trig functions actually worth using under FreeBSD. Before this commit, all float precision functions except exp2f() were implemented using only float precision, apparently because Cygnus needed this in 1993 for embedded systems with slow or inefficient double precision. For FreeBSD, except possibly on systems that do floating point entirely in software (very old i386 and now arm), this just gives a more complicated implementation, many bugs, and usually worse performance for float precision than for double precision. The bugs and worse performance were particulary large in arg reduction for trig functions. We want to divide by an approximation to pi/2 which has as many as 1584 bits, so we should use the widest type that is efficient and/or easy to use, i.e., double. Use fdlibm's __kernel_rem_pio2() to do this as Sun apparently intended. Cygnus's k_rem_pio2f.c is now unused. e_rem_pio2f.c still needs to be separate from e_rem_pio2.c so that it can be optimized for float args. Similarly for long double precision. This speeds up cosf(x) on large args by a factor of about 2. Correct arg reduction on large args is still inherently very slow, so hopefully these args rarely occur in practice. There is much more efficiency to be gained by using double precision to speed up arg reduction on medium and small float args. Revision Changes Path 1.13 +28 -30 src/lib/msun/src/e_rem_pio2f.c