diff options
author | Richard Henderson <rth@twiddle.net> | 2014-07-03 08:52:45 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2014-07-03 08:52:45 -0700 |
commit | ca7b945c7330064f494436611bd35fce6107abf6 (patch) | |
tree | 5176ca06cbb59eea5a267269df6812736eb29a24 /sysdeps/alpha/fpu/s_lround.c | |
parent | alpha: Remove round and roundf implementations (diff) | |
download | glibc-ca7b945c7330064f494436611bd35fce6107abf6.tar.gz glibc-ca7b945c7330064f494436611bd35fce6107abf6.tar.bz2 glibc-ca7b945c7330064f494436611bd35fce6107abf6.zip |
alpha: Fix lround implementations
Use chopped rounding to add 0.5.
Diffstat (limited to 'sysdeps/alpha/fpu/s_lround.c')
-rw-r--r-- | sysdeps/alpha/fpu/s_lround.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/alpha/fpu/s_lround.c b/sysdeps/alpha/fpu/s_lround.c index dedb98e31a..52a88b6b56 100644 --- a/sysdeps/alpha/fpu/s_lround.c +++ b/sysdeps/alpha/fpu/s_lround.c @@ -25,11 +25,11 @@ long int __lround (double x) { - double adj; + double adj, y; - adj = 0x1.fffffffffffffp-2; /* nextafter (0.5, 0.0) */ - adj = copysign (adj, x); - return x + adj; + adj = copysign (0.5, x); + asm("addt/suc %1,%2,%0" : "=&f"(y) : "f"(x), "f"(adj)); + return y; } strong_alias (__lround, __llround) |