diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-04-30 22:18:21 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-04-30 22:18:21 +0000 |
commit | 525ad64420bdc9411d921edec65f8904117f6d8b (patch) | |
tree | ade75759f8529eff2ecdd2cfa6a4955814194f22 | |
parent | ad79b2ad44bd243f535c2679ef1e029f283b545d (diff) | |
download | eglibc2-525ad64420bdc9411d921edec65f8904117f6d8b.tar.gz |
* soft-fp/op-common.h (FP_TRUNC): Correct off-by-one error in
condition for truncating to 0. Set sticky bit for such
truncation.
git-svn-id: svn://svn.eglibc.org/trunk@2125 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r-- | libc/ChangeLog.eglibc | 6 | ||||
-rw-r--r-- | libc/soft-fp/op-common.h | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc index 5c3999f37..6fa12aec0 100644 --- a/libc/ChangeLog.eglibc +++ b/libc/ChangeLog.eglibc @@ -1,3 +1,9 @@ +2007-04-30 Joseph Myers <joseph@codesourcery.com> + + * soft-fp/op-common.h (FP_TRUNC): Correct off-by-one error in + condition for truncating to 0. Set sticky bit for such + truncation. + 2007-04-20 Jim Blandy <jimb@codesourcery.com> * EGLIBC.cross-building: doc fix. diff --git a/libc/soft-fp/op-common.h b/libc/soft-fp/op-common.h index 0aa6e3e05..1f58b8947 100644 --- a/libc/soft-fp/op-common.h +++ b/libc/soft-fp/op-common.h @@ -1211,8 +1211,11 @@ do { \ { \ if (D##_e <= 0) \ { \ - if (D##_e <= 1 - _FP_FRACBITS_##dfs) \ - _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \ + if (D##_e < 1 - _FP_FRACBITS_##dfs) \ + { \ + _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \ + _FP_FRAC_LOW_##swc(S) |= 1; \ + } \ else \ { \ _FP_FRAC_HIGH_##sfs(S) |= _FP_IMPLBIT_SH_##sfs; \ |