* sim-fpu.c (pack_fpu): If SIM_QUIET_NAN_NEGATED is defined, use a

different fraction for a quiet NaN.
	(unpack_fpu): Likewise.
This commit is contained in:
Ian Lance Taylor 2005-07-08 18:41:54 +00:00
parent 3403418e49
commit 09b96ea041
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2005-07-08 Ian Lance Taylor <ian@airs.com>
* sim-fpu.c (pack_fpu): If SIM_QUIET_NAN_NEGATED is defined, use a
different fraction for a quiet NaN.
(unpack_fpu): Likewise.
2005-07-08 Ben Elliston <bje@au.ibm.com>
* callback.c: Remove ANSI_PROTOTYPES conditional code.

View file

@ -201,7 +201,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 - 1;
#else
fraction |= QUIET_NAN;
#endif
break;
case sim_fpu_class_snan:
sign = src->sign;
@ -362,10 +366,17 @@ unpack_fpu (sim_fpu *dst, unsigned64 packed, int is_double)
}
else
{
int qnan;
/* Non zero fraction, means NaN */
dst->sign = sign;
dst->fraction = (fraction << NR_GUARDS);
if (fraction >= QUIET_NAN)
#ifdef SIM_QUIET_NAN_NEGATED
qnan = (fraction & QUIET_NAN) == 0;
#else
qnan = fraction >= QUIET_NAN;
#endif
if (qnan)
dst->class = sim_fpu_class_qnan;
else
dst->class = sim_fpu_class_snan;