This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] MIPS sim: Fix handling of quiet NANs
- From: Thiemo Seufer <ths at networkno dot de>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 8 Aug 2006 12:33:10 +0100
- Subject: [PATCH] MIPS sim: Fix handling of quiet NANs
Hello All,
the appended patch fixes handling of quiet NANs for the
SIM_QUIET_NAN_NEGATED, which is what MIPS uses.
Thiemo
2006-08-08 Thiemo Seufer <ths@mips.com>
Nigel Stephens <nigel@mips.com>
* sim-fpu.c (pack_fpu): Handle QUIET_NAN correctly for
SIM_QUIET_NAN_NEGATED.
Index: sim/common/sim-fpu.c
===================================================================
RCS file: /cvs/src/src/sim/common/sim-fpu.c,v
retrieving revision 1.10
diff -u -p -r1.10 sim-fpu.c
--- sim/common/sim-fpu.c 8 Jul 2005 18:46:23 -0000 1.10
+++ sim/common/sim-fpu.c 1 Aug 2006 17:51:06 -0000
@@ -213,7 +213,11 @@ pack_fpu (const sim_fpu *src,
/* force fraction to correct class */
fraction = src->fraction;
fraction >>= NR_GUARDS;
+#ifdef SIM_QUIET_NAN_NEGATED
+ fraction |= QUIET_NAN;
+#else
fraction &= ~QUIET_NAN;
+#endif
break;
case sim_fpu_class_infinity:
sign = src->sign;