mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-30 12:31:53 +08:00
PowerPC: Fix nearbyint/nearbyintf result for FE_DOWNWARD
This patch fixes the powerpc32 optimized nearbyint/nearbyintf bogus results for FE_DOWNWARD rounding mode. This is due wrong instructions sequence used in the rounding calculation (two subtractions instead of adition and a subtraction). Fixes BZ#16815.
This commit is contained in:
parent
d42f3448a7
commit
8bd70862e1
@ -1,3 +1,12 @@
|
||||
2014-04-06 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||
|
||||
[BZ #16815]
|
||||
* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S (__nearbyint): Fix
|
||||
result for FE_DOWNWARD rounding mode.
|
||||
* sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S (__nearbyintf):
|
||||
Likewise.
|
||||
* sysdeps/powerpc/fpu/libm-test-ulps: Update.
|
||||
|
||||
2014-04-04 Chris Metcalf <cmetcalf@tilera.com>
|
||||
|
||||
* sysdeps/tile/dl-runtime.c (_dl_unmap): Fix cut-and-paste bug
|
||||
|
2
NEWS
2
NEWS
@ -14,7 +14,7 @@ Version 2.20
|
||||
16611, 16613, 16623, 16632, 16634, 16639, 16642, 16648, 16649, 16670,
|
||||
16674, 16677, 16680, 16683, 16689, 16695, 16701, 16706, 16707, 16712,
|
||||
16713, 16714, 16731, 16739, 16743, 16758, 16759, 16760, 16770, 16786,
|
||||
16789, 16799, 16800.
|
||||
16789, 16799, 16800, 16815.
|
||||
|
||||
* Running the testsuite no longer terminates as soon as a test fails.
|
||||
Instead, a file tests.sum (xtests.sum from "make xcheck") is generated,
|
||||
|
@ -452,6 +452,54 @@ ifloat: 1
|
||||
ildouble: 1
|
||||
ldouble: 1
|
||||
|
||||
Function: Real part of "catan_downward":
|
||||
double: 1
|
||||
float: 1
|
||||
idouble: 1
|
||||
ifloat: 1
|
||||
ildouble: 5
|
||||
ldouble: 5
|
||||
|
||||
Function: Imaginary part of "catan_downward":
|
||||
double: 2
|
||||
float: 2
|
||||
idouble: 2
|
||||
ifloat: 2
|
||||
ildouble: 6
|
||||
ldouble: 6
|
||||
|
||||
Function: Real part of "catan_towardzero":
|
||||
double: 1
|
||||
float: 1
|
||||
idouble: 1
|
||||
ifloat: 1
|
||||
ildouble: 6
|
||||
ldouble: 6
|
||||
|
||||
Function: Imaginary part of "catan_towardzero":
|
||||
double: 2
|
||||
float: 1
|
||||
idouble: 2
|
||||
ifloat: 1
|
||||
ildouble: 2
|
||||
ldouble: 2
|
||||
|
||||
Function: Real part of "catan_upward":
|
||||
double: 1
|
||||
float: 1
|
||||
idouble: 1
|
||||
ifloat: 1
|
||||
ildouble: 3
|
||||
ldouble: 3
|
||||
|
||||
Function: Imaginary part of "catan_upward":
|
||||
double: 3
|
||||
float: 3
|
||||
idouble: 3
|
||||
ifloat: 3
|
||||
ildouble: 5
|
||||
ldouble: 5
|
||||
|
||||
Function: Real part of "catanh":
|
||||
double: 4
|
||||
float: 1
|
||||
@ -466,6 +514,54 @@ ifloat: 1
|
||||
ildouble: 1
|
||||
ldouble: 1
|
||||
|
||||
Function: Real part of "catanh_downward":
|
||||
double: 2
|
||||
float: 2
|
||||
idouble: 2
|
||||
ifloat: 2
|
||||
ildouble: 3
|
||||
ldouble: 3
|
||||
|
||||
Function: Imaginary part of "catanh_downward":
|
||||
double: 1
|
||||
float: 2
|
||||
idouble: 1
|
||||
ifloat: 2
|
||||
ildouble: 5
|
||||
ldouble: 5
|
||||
|
||||
Function: Real part of "catanh_towardzero":
|
||||
double: 2
|
||||
float: 1
|
||||
idouble: 2
|
||||
ifloat: 1
|
||||
ildouble: 2
|
||||
ldouble: 2
|
||||
|
||||
Function: Imaginary part of "catanh_towardzero":
|
||||
double: 1
|
||||
float: 2
|
||||
idouble: 1
|
||||
ifloat: 2
|
||||
ildouble: 6
|
||||
ldouble: 6
|
||||
|
||||
Function: Real part of "catanh_upward":
|
||||
double: 4
|
||||
float: 3
|
||||
idouble: 4
|
||||
ifloat: 3
|
||||
ildouble: 8
|
||||
ldouble: 8
|
||||
|
||||
Function: Imaginary part of "catanh_upward":
|
||||
double: 1
|
||||
float: 1
|
||||
idouble: 1
|
||||
ifloat: 1
|
||||
ildouble: 3
|
||||
ldouble: 3
|
||||
|
||||
Function: "cbrt":
|
||||
double: 1
|
||||
float: 1
|
||||
@ -672,6 +768,102 @@ ifloat: 1
|
||||
ildouble: 2
|
||||
ldouble: 2
|
||||
|
||||
Function: Real part of "clog10_downward":
|
||||
double: 3
|
||||
float: 3
|
||||
idouble: 3
|
||||
ifloat: 3
|
||||
ildouble: 7
|
||||
ldouble: 7
|
||||
|
||||
Function: Imaginary part of "clog10_downward":
|
||||
double: 3
|
||||
float: 2
|
||||
idouble: 3
|
||||
ifloat: 2
|
||||
ildouble: 7
|
||||
ldouble: 7
|
||||
|
||||
Function: Real part of "clog10_towardzero":
|
||||
double: 3
|
||||
float: 2
|
||||
idouble: 3
|
||||
ifloat: 2
|
||||
ildouble: 8
|
||||
ldouble: 8
|
||||
|
||||
Function: Imaginary part of "clog10_towardzero":
|
||||
double: 3
|
||||
float: 2
|
||||
idouble: 3
|
||||
ifloat: 2
|
||||
ildouble: 7
|
||||
ldouble: 7
|
||||
|
||||
Function: Real part of "clog10_upward":
|
||||
double: 4
|
||||
float: 3
|
||||
idouble: 4
|
||||
ifloat: 3
|
||||
ildouble: 8
|
||||
ldouble: 8
|
||||
|
||||
Function: Imaginary part of "clog10_upward":
|
||||
double: 2
|
||||
float: 2
|
||||
idouble: 2
|
||||
ifloat: 2
|
||||
ildouble: 6
|
||||
ldouble: 6
|
||||
|
||||
Function: Real part of "clog_downward":
|
||||
double: 2
|
||||
float: 2
|
||||
idouble: 2
|
||||
ifloat: 2
|
||||
ildouble: 3
|
||||
ldouble: 3
|
||||
|
||||
Function: Imaginary part of "clog_downward":
|
||||
double: 1
|
||||
float: 2
|
||||
idouble: 1
|
||||
ifloat: 2
|
||||
ildouble: 3
|
||||
ldouble: 3
|
||||
|
||||
Function: Real part of "clog_towardzero":
|
||||
double: 2
|
||||
float: 2
|
||||
idouble: 2
|
||||
ifloat: 2
|
||||
ildouble: 3
|
||||
ldouble: 3
|
||||
|
||||
Function: Imaginary part of "clog_towardzero":
|
||||
double: 1
|
||||
float: 2
|
||||
idouble: 1
|
||||
ifloat: 2
|
||||
ildouble: 4
|
||||
ldouble: 4
|
||||
|
||||
Function: Real part of "clog_upward":
|
||||
double: 2
|
||||
float: 1
|
||||
idouble: 2
|
||||
ifloat: 1
|
||||
ildouble: 6
|
||||
ldouble: 6
|
||||
|
||||
Function: Imaginary part of "clog_upward":
|
||||
double: 2
|
||||
float: 1
|
||||
idouble: 2
|
||||
ifloat: 1
|
||||
ildouble: 3
|
||||
ldouble: 3
|
||||
|
||||
Function: "cos":
|
||||
double: 2
|
||||
float: 1
|
||||
|
@ -53,17 +53,17 @@ ENTRY (__nearbyint)
|
||||
fcmpu cr7,fp1,fp12 /* if (x > 0.0 */
|
||||
ble cr7,L(lessthanzero)
|
||||
mtfsb0 4*cr7+lt /* Disable FE_INEXACT exception */
|
||||
fadd fp0,fp1,fp13 /* x += TWO52 */
|
||||
fsub fp1,fp0,fp13 /* x -= TWO52 */
|
||||
fadd fp1,fp1,fp13 /* x += TWO52 */
|
||||
fsub fp1,fp1,fp13 /* x -= TWO52 */
|
||||
fabs fp1,fp1 /* if (x == 0.0 */
|
||||
mtfsb0 4*cr1+eq /* Clear any FE_INEXACT exception */
|
||||
blr
|
||||
L(lessthanzero):
|
||||
bgelr cr7
|
||||
mtfsb0 4*cr7+lt /* Disable FE_INEXACT exception */
|
||||
fsub fp0,fp13,fp1 /* x -= TWO52 */
|
||||
fsub fp0,fp0,fp13 /* x += TWO52 */
|
||||
fneg fp1,fp0 /* if (x == 0.0) */
|
||||
fsub fp1,fp1,fp13 /* x -= TWO52 */
|
||||
fadd fp1,fp1,fp13 /* x += TWO52 */
|
||||
fnabs fp1,fp1 /* if (x == 0.0) */
|
||||
mtfsb0 4*cr1+eq /* Clear any FE_INEXACT exception */
|
||||
blr
|
||||
END (__nearbyint)
|
||||
|
@ -52,16 +52,17 @@ ENTRY (__nearbyintf)
|
||||
fcmpu cr7,fp1,fp12 /* if (x > 0.0 */
|
||||
ble cr7,L(lessthanzero)
|
||||
mtfsb0 4*cr7+lt /* Disable FE_INEXACT exception */
|
||||
fadds fp0,fp1,fp13 /* x += TWO23 */
|
||||
fsubs fp1,fp0,fp13 /* x -= TWO23 */
|
||||
fadds fp1,fp1,fp13 /* x += TWO23 */
|
||||
fsubs fp1,fp1,fp13 /* x -= TWO23 */
|
||||
fabs fp1,fp1 /* if (x == 0.0) */
|
||||
mtfsb0 4*cr1+eq /* Clear any FE_INEXACT exception */
|
||||
blr
|
||||
L(lessthanzero):
|
||||
bgelr cr7
|
||||
mtfsb0 4*cr7+lt /* Disable FE_INEXACT exception */
|
||||
fsubs fp0,fp13,fp1 /* x -= TWO23 */
|
||||
fsubs fp0,fp0,fp13 /* x += TWO23 */
|
||||
fneg fp1,fp0 /* if (x == 0.0) */
|
||||
fsubs fp1,fp1,fp13 /* x -= TWO23 */
|
||||
fadds fp1,fp1,fp13 /* x += TWO23 */
|
||||
fnabs fp1,fp1 /* if (x == 0.0) */
|
||||
mtfsb0 4*cr1+eq /* Clear any FE_INEXACT exception */
|
||||
blr
|
||||
END (__nearbyintf)
|
||||
|
Loading…
Reference in New Issue
Block a user