mirror of git://sourceware.org/git/glibc.git
PowerPC: Fix for POWER7 sinf/cosf
This patch fixes some sinf/cosf calculations that generated unexpected underflows exceptions.
This commit is contained in:
parent
ebc64a18c0
commit
73a68f94d6
|
@ -1,3 +1,8 @@
|
||||||
|
2012-06-01 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
* sysdeps/powerpc/fpu/k_cosf.c: Fix underflow generation.
|
||||||
|
* sysdeps/powerpc/fpu/k_sinf.c: Likewise.
|
||||||
|
|
||||||
2012-05-31 H.J. Lu <hongjiu.lu@intel.com>
|
2012-05-31 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
[BZ #14117]
|
[BZ #14117]
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
not, see <http://www.gnu.org/licenses/>. */
|
not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <fenv.h>
|
||||||
#include <math_private.h>
|
#include <math_private.h>
|
||||||
|
|
||||||
static const float twom27 = 7.4505806e-09;
|
static const float twom27 = 7.4505806e-09;
|
||||||
|
@ -40,7 +41,7 @@ __kernel_cosf (float x, float y)
|
||||||
ix = __builtin_fabsf (x);
|
ix = __builtin_fabsf (x);
|
||||||
if (ix < twom27)
|
if (ix < twom27)
|
||||||
{ /* |x| < 2**-27 */
|
{ /* |x| < 2**-27 */
|
||||||
if (x == 0.0)
|
__feraiseexcept (FE_INEXACT);
|
||||||
return one;
|
return one;
|
||||||
}
|
}
|
||||||
z = x * x;
|
z = x * x;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
not, see <http://www.gnu.org/licenses/>. */
|
not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <fenv.h>
|
||||||
#include <math_private.h>
|
#include <math_private.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ __kernel_sinf (float x, float y, int iy)
|
||||||
ix = __builtin_fabsf (x);
|
ix = __builtin_fabsf (x);
|
||||||
if (ix < twom27)
|
if (ix < twom27)
|
||||||
{ /* |x| < 2**-27 */
|
{ /* |x| < 2**-27 */
|
||||||
if (x == 0.0)
|
__feraiseexcept (FE_INEXACT);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
z = x * x;
|
z = x * x;
|
||||||
|
|
Loading…
Reference in New Issue