summaryrefslogtreecommitdiff
path: root/soft-fp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 14:42:19 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 14:42:19 +0000
commitcd4d561ca59d8534701158060193d6725ccb1e55 (patch)
tree45f60c03ce79999ccc2731518130367020ca670a /soft-fp
parent2dec9fc4598adef67befdc79c1ed64abd67629d6 (diff)
2007-01-15 Jakub Jelinek <jakub@redhat.com>
* soft-fp/op-common.h (FP_TRUNC): When truncating a NaN, clear workbits in semi-raw fraction. * math/test-misc.c: Add new tests. 2007-01-14 Steven Munroe <sjmunroe@us.ibm.com> * math/basic-test.c: Include test-skeleton.c. (TEST_TRUNC): Define. (truncdfsf_test, trunctfsf_test, trunctfdf_test): New. (main): Rename to ... (do_test): ...this. Run new tests. (TEST_FUNCTION): Define. 2006-10-05 Steven Munroe <sjmunroe@us.ibm.com> Joe Kerian <jkerian@us.us.ibm.com> [BZ #2749] * soft-fp/op-4.h (__FP_FRAC_SUB_3, __FP_FRAC_SUB_4): Correct borrow handling for high words. * soft-fp/op-common.h (_FP_OVERFLOW_SEMIRAW): Always set inexact and overflow for infinity.
Diffstat (limited to 'soft-fp')
-rw-r--r--soft-fp/op-4.h6
-rw-r--r--soft-fp/op-common.h7
2 files changed, 8 insertions, 5 deletions
diff --git a/soft-fp/op-4.h b/soft-fp/op-4.h
index 34f5098e8c..1b90535c56 100644
--- a/soft-fp/op-4.h
+++ b/soft-fp/op-4.h
@@ -564,7 +564,7 @@
r1 = x1 - y1; \
_c2 = r1 > x1; \
r1 -= _c1; \
- _c2 |= r1 > _c1; \
+ _c2 |= _c1 && (y1 == x1); \
r2 = x2 - y2 - _c2; \
} while (0)
#endif
@@ -578,11 +578,11 @@
r1 = x1 - y1; \
_c2 = r1 > x1; \
r1 -= _c1; \
- _c2 |= r1 > _c1; \
+ _c2 |= _c1 && (y1 == x1); \
r2 = x2 - y2; \
_c3 = r2 > x2; \
r2 -= _c2; \
- _c3 |= r2 > _c2; \
+ _c3 |= _c2 && (y2 == x2); \
r3 = x3 - y3 - _c3; \
} while (0)
#endif
diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h
index 4ec7fade48..ea18801459 100644
--- a/soft-fp/op-common.h
+++ b/soft-fp/op-common.h
@@ -99,10 +99,10 @@ do { \
else \
{ \
X##_e = _FP_EXPMAX_##fs - 1; \
- FP_SET_EXCEPTION(FP_EX_OVERFLOW); \
- FP_SET_EXCEPTION(FP_EX_INEXACT); \
_FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc); \
} \
+ FP_SET_EXCEPTION(FP_EX_INEXACT); \
+ FP_SET_EXCEPTION(FP_EX_OVERFLOW); \
} while (0)
/* Check for a semi-raw value being a signaling NaN and raise the
@@ -1252,6 +1252,9 @@ do { \
_FP_FRAC_SRL_##swc(S, (_FP_WFRACBITS_##sfs \
- _FP_WFRACBITS_##dfs)); \
_FP_FRAC_COPY_##dwc##_##swc(D, S); \
+ /* Semi-raw NaN must have all workbits cleared. */ \
+ _FP_FRAC_LOW_##dwc(D) \
+ &= ~(_FP_W_TYPE) ((1 << _FP_WORKBITS) - 1); \
_FP_FRAC_HIGH_##dfs(D) |= _FP_QNANBIT_SH_##dfs; \
} \
} \