aboutsummaryrefslogtreecommitdiff
path: root/soft-fp/soft-fp.h
diff options
context:
space:
mode:
Diffstat (limited to 'soft-fp/soft-fp.h')
-rw-r--r--soft-fp/soft-fp.h82
1 files changed, 45 insertions, 37 deletions
diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h
index 1b7b3a7a5c..b3f4c3014e 100644
--- a/soft-fp/soft-fp.h
+++ b/soft-fp/soft-fp.h
@@ -166,48 +166,56 @@
#endif
-#define _FP_ROUND_NEAREST(wc, X) \
-do { \
- if ((_FP_FRAC_LOW_##wc(X) & 15) != _FP_WORK_ROUND) \
- _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND); \
-} while (0)
+#define _FP_ROUND_NEAREST(wc, X) \
+ do \
+ { \
+ if ((_FP_FRAC_LOW_##wc(X) & 15) != _FP_WORK_ROUND) \
+ _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND); \
+ } \
+ while (0)
#define _FP_ROUND_ZERO(wc, X) (void)0
-#define _FP_ROUND_PINF(wc, X) \
-do { \
- if (!X##_s && (_FP_FRAC_LOW_##wc(X) & 7)) \
- _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB); \
-} while (0)
-
-#define _FP_ROUND_MINF(wc, X) \
-do { \
- if (X##_s && (_FP_FRAC_LOW_##wc(X) & 7)) \
- _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB); \
-} while (0)
+#define _FP_ROUND_PINF(wc, X) \
+ do \
+ { \
+ if (!X##_s && (_FP_FRAC_LOW_##wc(X) & 7)) \
+ _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB); \
+ } \
+ while (0)
+
+#define _FP_ROUND_MINF(wc, X) \
+ do \
+ { \
+ if (X##_s && (_FP_FRAC_LOW_##wc(X) & 7)) \
+ _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB); \
+ } \
+ while (0)
#define _FP_ROUND(wc, X) \
-do { \
- if (_FP_FRAC_LOW_##wc(X) & 7) \
- { \
- FP_SET_EXCEPTION(FP_EX_INEXACT); \
- switch (FP_ROUNDMODE) \
- { \
- case FP_RND_NEAREST: \
- _FP_ROUND_NEAREST(wc,X); \
- break; \
- case FP_RND_ZERO: \
- _FP_ROUND_ZERO(wc,X); \
- break; \
- case FP_RND_PINF: \
- _FP_ROUND_PINF(wc,X); \
- break; \
- case FP_RND_MINF: \
- _FP_ROUND_MINF(wc,X); \
- break; \
- } \
- } \
-} while (0)
+ do \
+ { \
+ if (_FP_FRAC_LOW_##wc(X) & 7) \
+ { \
+ FP_SET_EXCEPTION(FP_EX_INEXACT); \
+ switch (FP_ROUNDMODE) \
+ { \
+ case FP_RND_NEAREST: \
+ _FP_ROUND_NEAREST(wc,X); \
+ break; \
+ case FP_RND_ZERO: \
+ _FP_ROUND_ZERO(wc,X); \
+ break; \
+ case FP_RND_PINF: \
+ _FP_ROUND_PINF(wc,X); \
+ break; \
+ case FP_RND_MINF: \
+ _FP_ROUND_MINF(wc,X); \
+ break; \
+ } \
+ } \
+ } \
+ while (0)
#define FP_CLS_NORMAL 0
#define FP_CLS_ZERO 1