Commit bb573986 authored by David S. Miller's avatar David S. Miller

In math-emu/op-common.h:FP_FROM_INT, correct handling of

normalizing too-big fraction parts.
parent 925aba56
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define __MATH_EMU_OP_COMMON_H__ #define __MATH_EMU_OP_COMMON_H__
#define _FP_DECL(wc, X) \ #define _FP_DECL(wc, X) \
_FP_I_TYPE X##_c, X##_s, X##_e; \ _FP_I_TYPE X##_c=0, X##_s=0, X##_e=0; \
_FP_FRAC_DECL_##wc(X) _FP_FRAC_DECL_##wc(X)
/* /*
...@@ -780,11 +780,12 @@ do { \ ...@@ -780,11 +780,12 @@ do { \
X##_e -= (_FP_W_TYPE_SIZE - rsize); \ X##_e -= (_FP_W_TYPE_SIZE - rsize); \
X##_e = rsize - X##_e - 1; \ X##_e = rsize - X##_e - 1; \
\ \
if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \
__FP_FRAC_SRS_1(r, (X##_e - _FP_WFRACBITS_##fs), rsize); \
r &= ~((rtype)1 << X##_e); \ r &= ~((rtype)1 << X##_e); \
if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \
__FP_FRAC_SRS_1(r, (X##_e - _FP_WFRACBITS_##fs + 1), rsize); \
_FP_FRAC_DISASSEMBLE_##wc(X, ((unsigned rtype)r), rsize); \ _FP_FRAC_DISASSEMBLE_##wc(X, ((unsigned rtype)r), rsize); \
_FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1)); \ if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0) \
_FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1)); \
} \ } \
else \ else \
{ \ { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment