projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more debug info
[libfirm]
/
ir
/
stat
/
const_stat.c
diff --git
a/ir/stat/const_stat.c
b/ir/stat/const_stat.c
index
4fd5b20
..
ffa88a3
100644
(file)
--- a/
ir/stat/const_stat.c
+++ b/
ir/stat/const_stat.c
@@
-69,16
+69,18
@@
static float_classify_t classify_float_value(tarval *tv) {
ir_mode *mode = get_tarval_mode(tv);
if (tv == get_mode_null(mode))
ir_mode *mode = get_tarval_mode(tv);
if (tv == get_mode_null(mode))
- return STAT_FC_
1
;
+ return STAT_FC_
0
;
else if (tv == get_mode_one(mode))
return STAT_FC_1;
else if (tv == get_mode_one(mode))
return STAT_FC_1;
- else if (tarval_ieee754_zero_mantissa(tv)) {
+ else if (tarval_i
s_finite(tv) && tarval_i
eee754_zero_mantissa(tv)) {
int exp = tarval_ieee754_get_exponent(tv);
int exp = tarval_ieee754_get_exponent(tv);
- if (exp == 1)
- return STAT_FC_2;
- else if (exp == -1)
- return STAT_FC_0_5;
+ if (! tarval_is_negative(tv)) {
+ if (exp == 1)
+ return STAT_FC_2;
+ else if (exp == -1)
+ return STAT_FC_0_5;
+ }
return STAT_FC_POWER_OF_TWO;
}
return STAT_FC_OTHER;
return STAT_FC_POWER_OF_TWO;
}
return STAT_FC_OTHER;