From owner-freebsd-standards@FreeBSD.ORG Mon Jun 7 01:33:54 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D1F616A4CE; Mon, 7 Jun 2004 01:33:54 +0000 (GMT) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id D523E43D31; Sun, 6 Jun 2004 18:33:53 -0700 (PDT) (envelope-from kargl@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) i571XrHl068577; Sun, 6 Jun 2004 18:33:53 -0700 (PDT) (envelope-from kargl@troutmask.apl.washington.edu) Received: (from kargl@localhost)i571Xrxu068576; Sun, 6 Jun 2004 18:33:53 -0700 (PDT) (envelope-from kargl) From: "Steven G. Kargl" Message-Id: <200406070133.i571Xrxu068576@troutmask.apl.washington.edu> In-Reply-To: <20040605025359.GA3084@VARK.homeunix.com> To: David Schultz Date: Sun, 6 Jun 2004 18:33:53 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL99f (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII cc: FreeBSD-gnats-submit@FreeBSD.ORG cc: freebsd-standards@FreeBSD.ORG Subject: Re: standards/59797: Implement C99's round[f]() math fucntions X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2004 01:33:54 -0000 David Schultz wrote: > > BTW, benchmarking shows that using the sample implementation that > appears in the C99 standard results in a slowdown of two orders of > magnitude over your round() implementation and four orders of > magnitude over the x87 frndint instruction. Just setting the > rounding mode and calling rint() also results in a significant > slowdown. Thus, we definitely want something that's in the spirit > of what you wrote, but perhaps one that operates on the bits directly. > I looked at the glibc implementation of round(). It does bit twiddling, but I would definitely recommend not using the glibc version because of licensing and possible copyright infringement concerns [hiint compare glibc's round() with fdlibm's ceil()]. -- Steve http://troutmask.apl.washington.edu/~kargl/