From 0bb43c316272b3a0e325a4c6eed92fed8f6e3bee Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 6 Sep 2007 15:42:13 +0000 Subject: [PATCH] fixed conversion of NAN's [r15701] --- ir/tv/fltcalc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ir/tv/fltcalc.c b/ir/tv/fltcalc.c index db427a0e7..b38d5b916 100644 --- a/ir/tv/fltcalc.c +++ b/ir/tv/fltcalc.c @@ -1210,6 +1210,13 @@ fp_value *fc_cast(const fp_value *value, char exp_size, char mant_size, fp_value return result; } + if (value->desc.clss == NAN) { + if (sc_get_highest_set_bit(_mant(value)) == value->desc.mantissa_size + 1) + return fc_get_qnan(exp_size, mant_size, result); + else + return fc_get_snan(exp_size, mant_size, result); + } + /* set the descriptor of the new value */ result->desc.exponent_size = exp_size; result->desc.mantissa_size = mant_size; -- 2.20.1