Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jun 2004 18:33:53 -0700 (PDT)
From:      "Steven G. Kargl" <kargl@troutmask.apl.washington.edu>
To:        David Schultz <das@FreeBSD.ORG>
Cc:        freebsd-standards@FreeBSD.ORG
Subject:   Re: standards/59797: Implement C99's round[f]() math fucntions
Message-ID:  <200406070133.i571Xrxu068576@troutmask.apl.washington.edu>
In-Reply-To: <20040605025359.GA3084@VARK.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406070133.i571Xrxu068576>