standards/59797: Implement C99's round[f]() math fucntions
Steven G. Kargl
kargl at troutmask.apl.washington.edu
Mon Jun 7 01:40:12 GMT 2004
The following reply was made to PR standards/59797; it has been noted by GNATS.
From: "Steven G. Kargl" <kargl at troutmask.apl.washington.edu>
To: David Schultz <das at FreeBSD.ORG>
Cc: FreeBSD-gnats-submit at FreeBSD.ORG, freebsd-standards at FreeBSD.ORG
Subject: Re: standards/59797: Implement C99's round[f]() math fucntions
Date: Sun, 6 Jun 2004 18:33:53 -0700 (PDT)
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/
More information about the freebsd-standards
mailing list