summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-03-12 15:11:09 -0800
committerNathan Binkert <nate@binkert.org>2010-03-12 15:11:09 -0800
commitfce7c820f4f1b7e81039acef0af73eba66a7d0d8 (patch)
tree95737eb2fafcc9a7f4b91ed55daec846fb969b4f
parent140785d24c27f3afddbe95c9e504e27bf8274290 (diff)
downloadgem5-fce7c820f4f1b7e81039acef0af73eba66a7d0d8.tar.xz
bugfix: since pow() causes a bug don't use it
It's a power of two anyway, so why use it in the first place.
-rw-r--r--src/mem/ruby/system/PseudoLRUPolicy.hh4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mem/ruby/system/PseudoLRUPolicy.hh b/src/mem/ruby/system/PseudoLRUPolicy.hh
index fbbe5191a..0cdf8a118 100644
--- a/src/mem/ruby/system/PseudoLRUPolicy.hh
+++ b/src/mem/ruby/system/PseudoLRUPolicy.hh
@@ -2,8 +2,6 @@
#ifndef PSEUDOLRUPOLICY_H
#define PSEUDOLRUPOLICY_H
-#include <cmath>
-
#include "mem/ruby/system/AbstractReplacementPolicy.hh"
/**
@@ -57,7 +55,7 @@ PseudoLRUPolicy::PseudoLRUPolicy(Index num_sets, Index assoc)
m_num_levels++;
}
assert(m_num_levels < sizeof(unsigned int)*4);
- num_tree_nodes = ((int)pow(2, m_num_levels))-1;
+ num_tree_nodes = (1 << m_num_levels) - 1;
m_trees = new uint64[m_num_sets];
for(unsigned int i=0; i< m_num_sets; i++){
m_trees[i] = 0;