Copy the sign bit when truncating a float tarval.
authorChristoph Mallon <christoph.mallon@gmx.de>
Mon, 8 Dec 2008 17:18:11 +0000 (17:18 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Mon, 8 Dec 2008 17:18:11 +0000 (17:18 +0000)
[r24403]

ir/tv/fltcalc.c

index 0f162da..eedee4d 100644 (file)
@@ -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;
+       }
 }
 
 /********