aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/math-emu/op-common.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index cc1ec396f8d6..bc50aa0d6d73 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)) \