summaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/dp_simple.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-01-05 01:17:33 +0100
committerTejun Heo <tj@kernel.org>2010-01-05 01:17:33 +0100
commit32032df6c2f6c9c6b2ada2ce42322231824f70c2 (patch)
treeb1ce838a37044bb38dfc128e2116ca35630e629a /arch/mips/math-emu/dp_simple.c
parentpercpu: refactor the code in pcpu_[de]populate_chunk() (diff)
parentMerge branch 'limits_cleanup' of git://decibel.fi.muni.cz/~xslaby/linux (diff)
downloadlinux-32032df6c2f6c9c6b2ada2ce42322231824f70c2.tar.xz
linux-32032df6c2f6c9c6b2ada2ce42322231824f70c2.zip
Merge branch 'master' into percpu
Conflicts: arch/powerpc/platforms/pseries/hvCall.S include/linux/percpu.h
Diffstat (limited to 'arch/mips/math-emu/dp_simple.c')
-rw-r--r--arch/mips/math-emu/dp_simple.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/mips/math-emu/dp_simple.c b/arch/mips/math-emu/dp_simple.c
index 1c555e6c6a9f..d9ae1dbabda7 100644
--- a/arch/mips/math-emu/dp_simple.c
+++ b/arch/mips/math-emu/dp_simple.c
@@ -62,8 +62,6 @@ ieee754dp ieee754dp_neg(ieee754dp x)
return ieee754dp_nanxcpt(y, "neg");
}
- if (ieee754dp_isnan(x)) /* but not infinity */
- return ieee754dp_nanxcpt(x, "neg", x);
return x;
}
@@ -76,15 +74,12 @@ ieee754dp ieee754dp_abs(ieee754dp x)
CLEARCX;
FLUSHXDP;
+ /* Clear sign ALWAYS, irrespective of NaN */
+ DPSIGN(x) = 0;
+
if (xc == IEEE754_CLASS_SNAN) {
- SETCX(IEEE754_INVALID_OPERATION);
- return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
+ return ieee754dp_nanxcpt(ieee754dp_indef(), "abs");
}
- if (ieee754dp_isnan(x)) /* but not infinity */
- return ieee754dp_nanxcpt(x, "abs", x);
-
- /* quick fix up */
- DPSIGN(x) = 0;
return x;
}