summaryrefslogtreecommitdiffhomepage
path: root/ir/tv
diff options
context:
space:
mode:
authorAndreas Zwinkau <zwinkau@kit.edu>2015-05-18 11:02:15 +0200
committerAndreas Zwinkau <zwinkau@kit.edu>2015-05-18 11:02:15 +0200
commite0629c8128006573bba94517256b9d5707a5a7f5 (patch)
treed6473cd7a25d9b6056408f89812edaf02b412e58 /ir/tv
parent8bef9c3df8c1033bb679c2198585b90fc434a4de (diff)
add asserts
Diffstat (limited to 'ir/tv')
-rw-r--r--ir/tv/fltcalc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ir/tv/fltcalc.c b/ir/tv/fltcalc.c
index b6e21bb..2959d7d 100644
--- a/ir/tv/fltcalc.c
+++ b/ir/tv/fltcalc.c
@@ -921,12 +921,22 @@ bool fc_is_negative(const fp_value *a)
bool fc_is_inf(const fp_value *a)
{
- return a->clss == FC_INF;
+ if (a->clss == FC_INF) {
+ assert(fc_zero_mantissa(a));
+ return true;
+ } else {
+ return false;
+ }
}
bool fc_is_nan(const fp_value *a)
{
- return a->clss == FC_NAN;
+ if (a->clss == FC_NAN) {
+ assert(!fc_zero_mantissa(a));
+ return true;
+ } else {
+ return false;
+ }
}
bool fc_is_subnormal(const fp_value *a)