mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 22:30:07 +00:00
Fix missing truncation UNDERFLOW.
This commit is contained in:
parent
640ac3f1bf
commit
47594329a9
@ -1,3 +1,10 @@
|
||||
2012-11-13 Marcus Shawcroft <marcus.shawcroft@linaro.org>
|
||||
|
||||
* soft-fp/op-common.h (_FP_PACK_SEMIRAW): Move underflow
|
||||
detection to immediately after _FP_ROUND().
|
||||
* soft-fp/soft-fp.h (_FP_ROUND): Don't round if working
|
||||
bits are 0.
|
||||
|
||||
2012-11-11 David S. Miller <davem@davemloft.net>
|
||||
|
||||
* sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c: Include
|
||||
|
@ -134,6 +134,12 @@ do { \
|
||||
#define _FP_PACK_SEMIRAW(fs, wc, X) \
|
||||
do { \
|
||||
_FP_ROUND(wc, X); \
|
||||
if (X##_e == 0 && !_FP_FRAC_ZEROP_##wc(X)) \
|
||||
{ \
|
||||
if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) \
|
||||
|| (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \
|
||||
FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \
|
||||
} \
|
||||
if (_FP_FRAC_HIGH_##fs(X) \
|
||||
& (_FP_OVERFLOW_##fs >> 1)) \
|
||||
{ \
|
||||
@ -143,15 +149,7 @@ do { \
|
||||
_FP_OVERFLOW_SEMIRAW(fs, wc, X); \
|
||||
} \
|
||||
_FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
|
||||
if (!_FP_EXP_NORMAL(fs, wc, X) && !_FP_FRAC_ZEROP_##wc(X)) \
|
||||
{ \
|
||||
if (X##_e == 0) \
|
||||
{ \
|
||||
if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) \
|
||||
|| (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \
|
||||
FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \
|
||||
} \
|
||||
else \
|
||||
if (X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \
|
||||
{ \
|
||||
if (!_FP_KEEPNANFRACP) \
|
||||
{ \
|
||||
@ -161,7 +159,6 @@ do { \
|
||||
else \
|
||||
_FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
|
@ -158,6 +158,7 @@ do { \
|
||||
#define _FP_ROUND(wc, X) \
|
||||
do { \
|
||||
if (_FP_FRAC_LOW_##wc(X) & 7) \
|
||||
{ \
|
||||
FP_SET_EXCEPTION(FP_EX_INEXACT); \
|
||||
switch (FP_ROUNDMODE) \
|
||||
{ \
|
||||
@ -174,6 +175,7 @@ do { \
|
||||
_FP_ROUND_MINF(wc,X); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define FP_CLS_NORMAL 0
|
||||
|
Loading…
Reference in New Issue
Block a user