diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 22:19:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 22:19:14 -0400 |
| commit | 5579a782ad7ffa162b1060993e4a298dd50e7a33 (patch) | |
| tree | 17a039c29af04579bdbae8323fe322e7dd9b1ec1 /include | |
| parent | 969907a956752f88dde4aa23fa8c033b9a939aee (diff) | |
| parent | 60b8267338aafde5315fc65ff385f3d4d75eccfe (diff) | |
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.h | 19 |
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 { \ | |||
| 139 | if (X##_e <= _FP_WFRACBITS_##fs) \ | 139 | if (X##_e <= _FP_WFRACBITS_##fs) \ |
| 140 | { \ | 140 | { \ |
| 141 | _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \ | 141 | _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \ |
| 142 | _FP_ROUND(wc, X); \ | ||
| 143 | if (_FP_FRAC_HIGH_##fs(X) \ | 142 | if (_FP_FRAC_HIGH_##fs(X) \ |
| 144 | & (_FP_OVERFLOW_##fs >> 1)) \ | 143 | & (_FP_OVERFLOW_##fs >> 1)) \ |
| 145 | { \ | 144 | { \ |
| 146 | X##_e = 1; \ | 145 | X##_e = 1; \ |
| 147 | _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ | 146 | _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ |
| 148 | FP_SET_EXCEPTION(FP_EX_INEXACT); \ | ||
| 149 | } \ | 147 | } \ |
| 150 | else \ | 148 | else \ |
| 151 | { \ | 149 | { \ |
| 152 | X##_e = 0; \ | 150 | _FP_ROUND(wc, X); \ |
| 153 | _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ | 151 | if (_FP_FRAC_HIGH_##fs(X) \ |
| 152 | & (_FP_OVERFLOW_##fs >> 1)) \ | ||
| 153 | { \ | ||
| 154 | X##_e = 1; \ | ||
| 155 | _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ | ||
| 156 | FP_SET_EXCEPTION(FP_EX_INEXACT); \ | ||
| 157 | } \ | ||
| 158 | else \ | ||
| 159 | { \ | ||
| 160 | X##_e = 0; \ | ||
| 161 | _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ | ||
| 162 | } \ | ||
| 154 | } \ | 163 | } \ |
| 155 | if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) || \ | 164 | if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) || \ |
| 156 | (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \ | 165 | (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \ |
| @@ -494,6 +503,8 @@ do { \ | |||
| 494 | R##_c = FP_CLS_NAN; \ | 503 | R##_c = FP_CLS_NAN; \ |
| 495 | _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ | 504 | _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ |
| 496 | FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\ | 505 | FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\ |
| 506 | break; \ | ||
| 507 | \ | ||
| 497 | case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \ | 508 | case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \ |
| 498 | R##_s = _FP_NANSIGN_##fs; \ | 509 | R##_s = _FP_NANSIGN_##fs; \ |
| 499 | R##_c = FP_CLS_NAN; \ | 510 | R##_c = FP_CLS_NAN; \ |
