aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/ieee754int.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-04-18 18:36:32 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-05-21 05:12:57 -0400
commit9e8bad1f9c0370b2635175b34d6151b90a53da5c (patch)
tree0971254e7d21761a5dec3f946e2f65c9fd43e844 /arch/mips/math-emu/ieee754int.h
parentbee1653593b39ac85b45a057bb8c22dc1489cf6a (diff)
MIPS: math-emu: Turn macros into functions where possible.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
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 @@
57 57
58#define CLPAIR(x, y) ((x)*6+(y)) 58#define CLPAIR(x, y) ((x)*6+(y))
59 59
60#define CLEARCX \ 60static inline void ieee754_clearcx(void)
61 (ieee754_csr.cx = 0) 61{
62 ieee754_csr.cx = 0;
63}
62 64
63#define SETCX(x) \ 65static inline void ieee754_setcx(const unsigned int flags)
64 (ieee754_csr.cx |= (x), ieee754_csr.sx |= (x)) 66{
67 ieee754_csr.cx |= flags;
68 ieee754_csr.sx |= flags;
69}
65 70
66#define SETANDTESTCX(x) \ 71static inline int ieee754_setandtestcx(const unsigned int x)
67 (SETCX(x), ieee754_csr.mx & (x)) 72{
73 ieee754_setcx(x);
68 74
69#define TSTX() \ 75 return ieee754_csr.mx & x;
70 (ieee754_csr.cx & ieee754_csr.mx) 76}
71 77
78static inline int ieee754_tstx(void)
79{
80 return ieee754_csr.cx & ieee754_csr.mx;
81}
72 82
73#define COMPXSP \ 83#define COMPXSP \
74 unsigned xm; int xe; int xs __maybe_unused; int xc 84 unsigned xm; int xe; int xs __maybe_unused; int xc
@@ -140,7 +150,7 @@
140#define FLUSHDP(v, vc, vs, ve, vm) \ 150#define FLUSHDP(v, vc, vs, ve, vm) \
141 if (vc==IEEE754_CLASS_DNORM) { \ 151 if (vc==IEEE754_CLASS_DNORM) { \
142 if (ieee754_csr.nod) { \ 152 if (ieee754_csr.nod) { \
143 SETCX(IEEE754_INEXACT); \ 153 ieee754_setcx(IEEE754_INEXACT); \
144 vc = IEEE754_CLASS_ZERO; \ 154 vc = IEEE754_CLASS_ZERO; \
145 ve = DP_EMIN-1+DP_EBIAS; \ 155 ve = DP_EMIN-1+DP_EBIAS; \
146 vm = 0; \ 156 vm = 0; \
@@ -151,7 +161,7 @@
151#define FLUSHSP(v, vc, vs, ve, vm) \ 161#define FLUSHSP(v, vc, vs, ve, vm) \
152 if (vc==IEEE754_CLASS_DNORM) { \ 162 if (vc==IEEE754_CLASS_DNORM) { \
153 if (ieee754_csr.nod) { \ 163 if (ieee754_csr.nod) { \
154 SETCX(IEEE754_INEXACT); \ 164 ieee754_setcx(IEEE754_INEXACT); \
155 vc = IEEE754_CLASS_ZERO; \ 165 vc = IEEE754_CLASS_ZERO; \
156 ve = SP_EMIN-1+SP_EBIAS; \ 166 ve = SP_EMIN-1+SP_EBIAS; \
157 vm = 0; \ 167 vm = 0; \