summaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/sp_cmp.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki2015-04-04 00:25:38 +0200
committerRalf Baechle2015-04-08 01:09:35 +0200
commitc9a1084516e35ff4f1d5b83e77530ed019ca364b (patch)
treede1cfa5b17d0e2db63616994f42fb12de8b207c6 /arch/mips/math-emu/sp_cmp.c
parentMIPS: math-emu: Reinstate sNaN quieting handlers (diff)
downloadkernel-qcow2-linux-c9a1084516e35ff4f1d5b83e77530ed019ca364b.tar.gz
kernel-qcow2-linux-c9a1084516e35ff4f1d5b83e77530ed019ca364b.tar.xz
kernel-qcow2-linux-c9a1084516e35ff4f1d5b83e77530ed019ca364b.zip
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/sp_cmp.c')
-rw-r--r--arch/mips/math-emu/sp_cmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/math-emu/sp_cmp.c b/arch/mips/math-emu/sp_cmp.c
index 5caf088af0d7..d765ba1c7b82 100644
--- a/arch/mips/math-emu/sp_cmp.c
+++ b/arch/mips/math-emu/sp_cmp.c
@@ -35,7 +35,7 @@ int ieee754sp_cmp(union ieee754sp x, union ieee754sp y, int cmp, int sig)
FLUSHYSP;
ieee754_clearcx(); /* Even clear inexact flag here */
- if (ieee754sp_isnan(x) || ieee754sp_isnan(y)) {
+ if (ieee754_class_nan(xc) || ieee754_class_nan(yc)) {
if (sig ||
xc == IEEE754_CLASS_SNAN || yc == IEEE754_CLASS_SNAN)
ieee754_setcx(IEEE754_INVALID_OPERATION);