about summary refs log tree commit diff
path: root/soft-fp/op-common.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-05-03 12:15:04 +0000
committerJakub Jelinek <jakub@redhat.com>2007-05-03 12:15:04 +0000
commit002f0b0b5df92cc1c1302c6b95c0c97fd986ed94 (patch)
tree908b1cf953bdc17ad9a01eed2e7fa7d8aafa1bde /soft-fp/op-common.h
parent57433edee3c08b16967487664a28e0ecc99d7f8c (diff)
downloadglibc-002f0b0b5df92cc1c1302c6b95c0c97fd986ed94.tar.gz
glibc-002f0b0b5df92cc1c1302c6b95c0c97fd986ed94.tar.xz
glibc-002f0b0b5df92cc1c1302c6b95c0c97fd986ed94.zip
* math/test-misc.c (main): Add tests for rounding long double
values close to smallest double denormalized value to double.
	* 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-05-03  Jakub Jelinek  <jakub@redhat.com>

	* math/test-misc.c (main): Add tests for rounding long double
	values close to smallest double denormalized value to double.

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.
Diffstat (limited to 'soft-fp/op-common.h')
-rw-r--r--soft-fp/op-common.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h
index 0aa6e3e05d..1f58b89478 100644
--- a/soft-fp/op-common.h
+++ b/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;	     \