Skip to content

Commit

Permalink
alpha: Always handle inexact in rint implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Henderson committed Jun 15, 2012
1 parent f56ed78 commit 7fd8e5a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
30 changes: 30 additions & 0 deletions ChangeLog.alpha
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
2012-06-15 Richard Henderson <rth@twiddle.net>

* sysdeps/alpha/fpu/s_rint.c (__rint): Handle inexact regardless
of -mieee-with-inexact.
* sysdeps/alpha/fpu/s_rintf.c (__rintf): Likewise.

[BZ #13848]
* sysdeps/alpha/fpu/s_nearbyint.c (__nearbyint): Fix corner cases
similar to BZ#5350.
* sysdeps/alpha/fpu/s_nearbyintf.c (__nearbyintf): Likewise.

* sysdeps/alpha/fpu/s_copysign.c (__copysign): Use builtin.
* sysdeps/alpha/fpu/s_copysignf.c (__copysignf): Use builtin.

* sysdeps/unix/sysv/linux/alpha/bits/resource.h (RLIMIT_RTTIME): New.
(prlimit, prlimit64): New declarations.
* sysdeps/unix/sysv/linux/alpha/bits/shm.h (SHM_EXEC): New.
* sysdeps/unix/sysv/linux/alpha/bits/stat.h: Use only __USE_ATFILE
to protect UTIME_NOW and UTIME_OMIT.

* sysdeps/alpha/fpu/cfloat-compat.h: Remove __GNUC_PREREQ check.
* sysdeps/alpha/fpu/s_fabs.c (__fabs): Likewise.
* sysdeps/alpha/fpu/s_fabsf.c (__fabsf): Likewise.
* sysdeps/unix/sysv/linux/alpha/sysconf.c (implver): Remove.
(amask): Remove.
(__sysconf): Use builtins directly.

* sysdeps/alpha/bits/mathdef.h (float_t): Define as float
regardless of __GNUC__.

2012-06-06 Richard Henderson <rth@twiddle.net>

* sysdeps/alpha/strncmp.S: Bound count to LONG_MAX at startup.
Expand Down
9 changes: 2 additions & 7 deletions sysdeps/alpha/fpu/s_rint.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
Expand Down Expand Up @@ -26,12 +26,7 @@ __rint (double x)
if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
{
double tmp1, new_x;
__asm (
#ifdef _IEEE_FP_INEXACT
"cvttq/svid %2,%1\n\t"
#else
"cvttq/svd %2,%1\n\t"
#endif
__asm ("cvttq/svid %2,%1\n\t"
"cvtqt/d %1,%0\n\t"
: "=f"(new_x), "=&f"(tmp1)
: "f"(x));
Expand Down
6 changes: 1 addition & 5 deletions sysdeps/alpha/fpu/s_rintf.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2000, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
Expand Down Expand Up @@ -32,11 +32,7 @@ __rintf (float x)
float tmp1, tmp2, new_x;

__asm ("cvtst/s %3,%2\n\t"
#ifdef _IEEE_FP_INEXACT
"cvttq/svid %2,%1\n\t"
#else
"cvttq/svd %2,%1\n\t"
#endif
"cvtqt/d %1,%0\n\t"
: "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
: "f"(x));
Expand Down

0 comments on commit 7fd8e5a

Please sign in to comment.