This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

rint/nearbyint for x86-64


Regarding rint/nearbyint for x86_64, Andreas Jaeger <aj@suse.de> wrote:
> These use the x87 fpu and passed all tests.  Does anybody have a better
> implementation using only the SSE unit?

Take absolute value, ADD then SUBtract the power of 2 whose LSB in f.p.
representation has the place value 1 (namely: 2**23 or 2**52), copy the
sign of the original argument.
This uses the hardware rounding for the ADD as round-to-integer.
Beware exceptional conditions: NaN, denormal, overflow on ADD.
Compare implementation with non-x86 and non-IEEE754 hardware.
Measure the speed and other characteristics [define "better."]

-- 
John Reiser, jreiser@BitWagon.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]