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>
This commit is contained in:
Maciej W. Rozycki
2015-04-03 23:25:38 +01:00
committed by Ralf Baechle
parent d5afa7e905
commit c9a1084516
5 changed files with 9 additions and 4 deletions

View File

@@ -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