[patch][4/5] powerpc: Add the action of rounding for packing denormalized numbers
ebony.zhu at freescale.com
ebony.zhu at freescale.com
Fri Jan 12 16:29:18 EST 2007
Add the action of rounding for packing denormalized
numbers, in order to fully comply with IEEE-754.
Signed-off-by:Ebony Zhu <ebony.zhu at freescale.com>
---
arch/powerpc/math-emu/op-common.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/math-emu/op-common.h b/arch/powerpc/math-emu/op-common.h
index afb82b6..434e3dd 100644
--- a/arch/powerpc/math-emu/op-common.h
+++ b/arch/powerpc/math-emu/op-common.h
@@ -82,6 +82,7 @@ ({int __ret = 0; \
if (X##_e <= _FP_WFRACBITS_##fs) \
{ \
_FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \
+ __ret |= _FP_ROUND(wc, X); \
_FP_FRAC_SLL_##wc(X, 1); \
if (_FP_FRAC_OVERP_##wc(fs, X)) \
{ \
@@ -100,6 +101,7 @@ ({int __ret = 0; \
/* underflow to zero */ \
X##_e = 0; \
_FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
+ __ret |= _FP_ROUND(wc, X); \
__ret |= EFLAG_UNDERFLOW; \
} \
} \
--
1.4.0
More information about the Linuxppc-dev
mailing list