diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2014-04-19 00:36:32 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-05-21 11:12:57 +0200 |
commit | 9e8bad1f9c0370b2635175b34d6151b90a53da5c (patch) | |
tree | 0971254e7d21761a5dec3f946e2f65c9fd43e844 /arch/mips/math-emu/ieee754int.h | |
parent | bee1653593b39ac85b45a057bb8c22dc1489cf6a (diff) | |
download | blackbird-op-linux-9e8bad1f9c0370b2635175b34d6151b90a53da5c.tar.gz blackbird-op-linux-9e8bad1f9c0370b2635175b34d6151b90a53da5c.zip |
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.h | 30 |
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; \ |