* Copyright: (c) 2004 Universität Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "firmstat_t.h"
#include "tv_t.h"
-static stat_info_t *status;
-
/**
- * calculated the dual logarithmus of |value|
+ * calculated the dual logarithm of |value|
*/
-static unsigned log2(long value) {
+static unsigned log2abs(long value) {
unsigned res = 0;
if (value < 0)
}
}
-/**
- * update info on Consts
- *
- * @param node The Const node
- * @param graph The graph entry containing the call
- */
+/* update info on Consts */
void stat_update_const(stat_info_t *status, ir_node *node, graph_entry_t *graph)
{
ir_mode *mode = get_irn_mode(node);
if (! tarval_is_long(tv))
return;
- bits = log2(get_tarval_long(tv));
+ bits = log2abs(get_tarval_long(tv));
if (bits > ARR_SIZE(status->const_info.int_bits_count))
bits = ARR_SIZE(status->const_info.int_bits_count);