diff options
-rw-r--r-- | include/math-emu/op-common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h index 70fe5e989ace..6bdf8c61d221 100644 --- a/include/math-emu/op-common.h +++ b/include/math-emu/op-common.h | |||
@@ -743,12 +743,17 @@ do { \ | |||
743 | } \ | 743 | } \ |
744 | else \ | 744 | else \ |
745 | { \ | 745 | { \ |
746 | int _lz0, _lz1; \ | ||
746 | if (X##_e <= -_FP_WORKBITS - 1) \ | 747 | if (X##_e <= -_FP_WORKBITS - 1) \ |
747 | _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ | 748 | _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ |
748 | else \ | 749 | else \ |
749 | _FP_FRAC_SRS_##wc(X, _FP_FRACBITS_##fs - 1 - X##_e, \ | 750 | _FP_FRAC_SRS_##wc(X, _FP_FRACBITS_##fs - 1 - X##_e, \ |
750 | _FP_WFRACBITS_##fs); \ | 751 | _FP_WFRACBITS_##fs); \ |
752 | _FP_FRAC_CLZ_##wc(_lz0, X); \ | ||
751 | _FP_ROUND(wc, X); \ | 753 | _FP_ROUND(wc, X); \ |
754 | _FP_FRAC_CLZ_##wc(_lz1, X); \ | ||
755 | if (_lz1 < _lz0) \ | ||
756 | X##_e++; /* For overflow detection. */ \ | ||
752 | _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ | 757 | _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ |
753 | _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ | 758 | _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ |
754 | } \ | 759 | } \ |