diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2015-04-04 00:25:23 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-08 01:09:26 +0200 |
commit | d19cf86e2e295b0406b5fa3a35609fb0a99f1bde (patch) | |
tree | 9c400e82a1c65d82edd0325b24747d3342af1768 /arch/mips/math-emu/dp_fsp.c | |
parent | MIPS: math-emu: Update sNaN quieting handlers (diff) | |
download | linux-d19cf86e2e295b0406b5fa3a35609fb0a99f1bde.tar.xz linux-d19cf86e2e295b0406b5fa3a35609fb0a99f1bde.zip |
MIPS: math-emu: Factor out NaN FP format conversions
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9686/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu/dp_fsp.c')
-rw-r--r-- | arch/mips/math-emu/dp_fsp.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/mips/math-emu/dp_fsp.c b/arch/mips/math-emu/dp_fsp.c index ffb69c5830b0..88581f7e28dd 100644 --- a/arch/mips/math-emu/dp_fsp.c +++ b/arch/mips/math-emu/dp_fsp.c @@ -22,6 +22,12 @@ #include "ieee754sp.h" #include "ieee754dp.h" +static inline union ieee754dp ieee754dp_nan_fsp(int xs, u64 xm) +{ + return builddp(xs, DP_EMAX + 1 + DP_EBIAS, + xm << (DP_FBITS - SP_FBITS)); +} + union ieee754dp ieee754dp_fsp(union ieee754sp x) { COMPXSP; @@ -38,11 +44,8 @@ union ieee754dp ieee754dp_fsp(union ieee754sp x) return ieee754dp_nanxcpt(ieee754dp_indef()); case IEEE754_CLASS_QNAN: - return ieee754dp_nanxcpt(builddp(xs, - DP_EMAX + 1 + DP_EBIAS, - ((u64) xm - << (DP_FBITS - - SP_FBITS)))); + return ieee754dp_nanxcpt(ieee754dp_nan_fsp(xs, xm)); + case IEEE754_CLASS_INF: return ieee754dp_inf(xs); |