summaryrefslogtreecommitdiffhomepage
path: root/ir/tv
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-02-14 07:32:44 +0100
committerMatthias Braun <matze@braunis.de>2016-02-14 07:32:44 +0100
commit69b619f90ab2232f63b8607d49bf6053e0f3c798 (patch)
treea30d1f0bae9703289a665cc29ac7773f07f71cd0 /ir/tv
parente293c97104423d422a994daaccb1a5c292d55d70 (diff)
fltcalc: Report negative overflow intead of bad when converting negative number to unsigned int
Diffstat (limited to 'ir/tv')
-rw-r--r--ir/tv/fltcalc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ir/tv/fltcalc.c b/ir/tv/fltcalc.c
index c190fa5..2ffe477 100644
--- a/ir/tv/fltcalc.c
+++ b/ir/tv/fltcalc.c
@@ -1128,10 +1128,8 @@ flt2int_result_t fc_flt2int(const fp_value *a, sc_word *result,
: FLT2INT_POSITIVE_OVERFLOW;
case FC_SUBNORMAL:
case FC_NORMAL:
- if (a->sign && !result_signed) {
- /* FIXME: for now we cannot convert this */
- return FLT2INT_BAD;
- }
+ if (a->sign && !result_signed)
+ return FLT2INT_NEGATIVE_OVERFLOW;
unsigned tgt_bits = result_bits - result_signed;