summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-24 06:19:14 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-24 06:19:14 +0400
commit5579a782ad7ffa162b1060993e4a298dd50e7a33 (patch)
tree17a039c29af04579bdbae8323fe322e7dd9b1ec1 /include
parent969907a956752f88dde4aa23fa8c033b9a939aee (diff)
parent60b8267338aafde5315fc65ff385f3d4d75eccfe (diff)
downloadlinux-5579a782ad7ffa162b1060993e4a298dd50e7a33.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: math-emu: Fix thinko in _FP_DIV math-emu: Fix signalling of underflow and inexact while packing result. sparc: Add checkstack support sparc: correct section of current_pc() sparc: correct section of apc_no_idle sparc64: Fix race in arch/sparc64/kernel/trampoline.S
Diffstat (limited to 'include')
-rw-r--r--include/math-emu/op-common.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index cc1ec396f8d6..f456534dcaf9 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -139,18 +139,27 @@ do { \
if (X##_e <= _FP_WFRACBITS_##fs) \
{ \
_FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \
- _FP_ROUND(wc, X); \
if (_FP_FRAC_HIGH_##fs(X) \
& (_FP_OVERFLOW_##fs >> 1)) \
{ \
X##_e = 1; \
_FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
- FP_SET_EXCEPTION(FP_EX_INEXACT); \
} \
else \
{ \
- X##_e = 0; \
- _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
+ _FP_ROUND(wc, X); \
+ if (_FP_FRAC_HIGH_##fs(X) \
+ & (_FP_OVERFLOW_##fs >> 1)) \
+ { \
+ X##_e = 1; \
+ _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
+ FP_SET_EXCEPTION(FP_EX_INEXACT); \
+ } \
+ else \
+ { \
+ X##_e = 0; \
+ _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
+ } \
} \
if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) || \
(FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \
@@ -494,6 +503,8 @@ do { \
R##_c = FP_CLS_NAN; \
_FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\
+ break; \
+ \
case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \
R##_s = _FP_NANSIGN_##fs; \
R##_c = FP_CLS_NAN; \