diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2015-04-03 18:25:34 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-07 19:09:31 -0400 |
commit | d5afa7e905544a3d9e2bb29d9cafebc8e544c978 (patch) | |
tree | 7a3c2f068bff4f628db3a1c9d6f31bf86ebe9011 /arch/mips/math-emu/sp_div.c | |
parent | 539bfb579babbe5a14b405370ecc99b4ed53bc4e (diff) |
MIPS: math-emu: Reinstate sNaN quieting handlers
Revert the changes made by commit fdffbafb [Lots of FPU bug fixes from
Kjeld Borch Egevang.] to `ieee754sp_nanxcpt' and `ieee754dp_nanxcpt'
sNaN quieting handlers and their callers so that sNaN processing is done
within the handlers againg. Pass the sNaN causing an IEEE 754 invalid
operation exception down to the relevant handler. Pass the sNaN in `fs'
where two sNaNs are supplied to a binary operation.
Set the Invalid Operation FCSR exception bits in the quieting handlers
rather than at their call sites throughout. Make the handlers exclusive
for sNaN processing.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9688/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu/sp_div.c')
-rw-r--r-- | arch/mips/math-emu/sp_div.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c index 721f317aa877..27f6db3a0a4c 100644 --- a/arch/mips/math-emu/sp_div.c +++ b/arch/mips/math-emu/sp_div.c | |||
@@ -39,19 +39,20 @@ union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y) | |||
39 | FLUSHYSP; | 39 | FLUSHYSP; |
40 | 40 | ||
41 | switch (CLPAIR(xc, yc)) { | 41 | switch (CLPAIR(xc, yc)) { |
42 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_QNAN): | ||
43 | case CLPAIR(IEEE754_CLASS_QNAN, IEEE754_CLASS_SNAN): | 42 | case CLPAIR(IEEE754_CLASS_QNAN, IEEE754_CLASS_SNAN): |
44 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_SNAN): | ||
45 | case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_SNAN): | 43 | case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_SNAN): |
46 | case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_SNAN): | 44 | case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_SNAN): |
47 | case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_SNAN): | 45 | case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_SNAN): |
48 | case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_SNAN): | 46 | case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_SNAN): |
47 | return ieee754sp_nanxcpt(y); | ||
48 | |||
49 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_SNAN): | ||
50 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_QNAN): | ||
49 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_ZERO): | 51 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_ZERO): |
50 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_NORM): | 52 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_NORM): |
51 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): | 53 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): |
52 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): | 54 | case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): |
53 | ieee754_setcx(IEEE754_INVALID_OPERATION); | 55 | return ieee754sp_nanxcpt(x); |
54 | return ieee754sp_nanxcpt(ieee754sp_indef()); | ||
55 | 56 | ||
56 | case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): | 57 | case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): |
57 | case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): | 58 | case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): |