From f3498269f46071dc3fc85b67fad57f106b528d74 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 8 Dec 2008 17:18:11 +0000 Subject: [PATCH] Copy the sign bit when truncating a float tarval. [r24403] --- ir/tv/fltcalc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ir/tv/fltcalc.c b/ir/tv/fltcalc.c index 0f162da3f..eedee4d16 100644 --- a/ir/tv/fltcalc.c +++ b/ir/tv/fltcalc.c @@ -811,7 +811,10 @@ static void _trunc(const fp_value *a, fp_value *result) { /* and the mask and return the result */ sc_and(_mant(a), temp, _mant(result)); - if (a != result) memcpy(_exp(result), _exp(a), value_size); + if (a != result) { + memcpy(_exp(result), _exp(a), value_size); + result->sign = a->sign; + } } /******** -- 2.20.1