summaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/ieee754int.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/math-emu/ieee754int.h')
-rw-r--r--arch/mips/math-emu/ieee754int.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h
index 62d0fdbdb44e..39c40d275825 100644
--- a/arch/mips/math-emu/ieee754int.h
+++ b/arch/mips/math-emu/ieee754int.h
@@ -57,18 +57,28 @@
#define CLPAIR(x, y) ((x)*6+(y))
-#define CLEARCX \
- (ieee754_csr.cx = 0)
+static inline void ieee754_clearcx(void)
+{
+ ieee754_csr.cx = 0;
+}
-#define SETCX(x) \
- (ieee754_csr.cx |= (x), ieee754_csr.sx |= (x))
+static inline void ieee754_setcx(const unsigned int flags)
+{
+ ieee754_csr.cx |= flags;
+ ieee754_csr.sx |= flags;
+}
-#define SETANDTESTCX(x) \
- (SETCX(x), ieee754_csr.mx & (x))
+static inline int ieee754_setandtestcx(const unsigned int x)
+{
+ ieee754_setcx(x);
-#define TSTX() \
- (ieee754_csr.cx & ieee754_csr.mx)
+ return ieee754_csr.mx & x;
+}
+static inline int ieee754_tstx(void)
+{
+ return ieee754_csr.cx & ieee754_csr.mx;
+}
#define COMPXSP \
unsigned xm; int xe; int xs __maybe_unused; int xc
@@ -140,7 +150,7 @@
#define FLUSHDP(v, vc, vs, ve, vm) \
if (vc==IEEE754_CLASS_DNORM) { \
if (ieee754_csr.nod) { \
- SETCX(IEEE754_INEXACT); \
+ ieee754_setcx(IEEE754_INEXACT); \
vc = IEEE754_CLASS_ZERO; \
ve = DP_EMIN-1+DP_EBIAS; \
vm = 0; \
@@ -151,7 +161,7 @@
#define FLUSHSP(v, vc, vs, ve, vm) \
if (vc==IEEE754_CLASS_DNORM) { \
if (ieee754_csr.nod) { \
- SETCX(IEEE754_INEXACT); \
+ ieee754_setcx(IEEE754_INEXACT); \
vc = IEEE754_CLASS_ZERO; \
ve = SP_EMIN-1+SP_EBIAS; \
vm = 0; \
OpenPOWER on IntegriCloud