linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix absd emulation
@ 2009-07-10  8:50 Raghu Gandham
  2009-10-12 16:15 ` Ralf Baechle
  0 siblings, 1 reply; 11+ messages in thread
From: Raghu Gandham @ 2009-07-10  8:50 UTC (permalink / raw)
  To: linux-mips; +Cc: raghu, chris

From: Robin Randhawa <robin@mips.com>

Signed-off-by: Chris Dearman <chris@mips.com>
---

 arch/mips/math-emu/dp_simple.c |   11 ++++-------
 arch/mips/math-emu/sp_simple.c |    3 ---
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/arch/mips/math-emu/dp_simple.c b/arch/mips/math-emu/dp_simple.c
index 1c555e6..6ff4655 100644
--- a/arch/mips/math-emu/dp_simple.c
+++ b/arch/mips/math-emu/dp_simple.c
@@ -76,15 +76,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;
 }
diff --git a/arch/mips/math-emu/sp_simple.c b/arch/mips/math-emu/sp_simple.c
index 770f0f4..cdec1a2 100644
--- a/arch/mips/math-emu/sp_simple.c
+++ b/arch/mips/math-emu/sp_simple.c
@@ -61,9 +61,6 @@ ieee754sp ieee754sp_neg(ieee754sp x)
 		SPSIGN(y) = SPSIGN(x);
 		return ieee754sp_nanxcpt(y, "neg");
 	}
-
-	if (ieee754sp_isnan(x))	/* but not infinity */
-		return ieee754sp_nanxcpt(x, "neg", x);
 	return x;
 }
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-05-22  7:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-10  8:50 [PATCH] Fix absd emulation Raghu Gandham
2009-10-12 16:15 ` Ralf Baechle
2009-10-12 21:57   ` Chris Dearman
2009-10-12 21:57     ` [PATCH] Fix abs.[sd] and neg.[sd] emulation for NaN operands Chris Dearman
2010-05-10 14:49       ` Atsushi Nemoto
2010-05-10 18:37         ` Chris Dearman
2010-05-11 15:45           ` Atsushi Nemoto
2010-05-12  1:30             ` Chris Dearman
2010-05-12  1:30             ` [PATCH] Restore signalling NaN behaviour for abs.[sd] Chris Dearman
2010-05-14  4:48               ` Atsushi Nemoto
2010-05-22  7:15               ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).