diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2015-04-03 23:25:38 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-08 01:09:35 +0200 |
commit | c9a1084516e35ff4f1d5b83e77530ed019ca364b (patch) | |
tree | de1cfa5b17d0e2db63616994f42fb12de8b207c6 /arch/mips/math-emu/ieee754int.h | |
parent | d5afa7e905544a3d9e2bb29d9cafebc8e544c978 (diff) | |
download | op-kernel-dev-c9a1084516e35ff4f1d5b83e77530ed019ca364b.zip op-kernel-dev-c9a1084516e35ff4f1d5b83e77530ed019ca364b.tar.gz |
MIPS: math-emu: Optimise NaN handling in comparisons
We have the input operands already classified in `ieee754sp_cmp' and
`ieee754dp_cmp' comparison operations, so use the class obtained to tell
NaNs and numbers apart rather than classifying inputs again for this
purpose, reducing the size of code by 24 and 40 instructions or 96 and
160 bytes respectively.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9689/
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 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h index f0365bb..05389d5 100644 --- a/arch/mips/math-emu/ieee754int.h +++ b/arch/mips/math-emu/ieee754int.h @@ -44,6 +44,11 @@ static inline int ieee754_setandtestcx(const unsigned int x) return ieee754_csr.mx & x; } +static inline int ieee754_class_nan(int xc) +{ + return xc >= IEEE754_CLASS_SNAN; +} + #define COMPXSP \ unsigned xm; int xe; int xs __maybe_unused; int xc |