projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba265ab
)
Ruby: Eliminate modulo op for computing set size.
author
Nilay Vaish
<nilay@cs.wisc.edu>
Fri, 26 Aug 2011 17:27:58 +0000
(12:27 -0500)
committer
Nilay Vaish
<nilay@cs.wisc.edu>
Fri, 26 Aug 2011 17:27:58 +0000
(12:27 -0500)
src/mem/ruby/common/Set.cc
patch
|
blob
|
history
diff --git
a/src/mem/ruby/common/Set.cc
b/src/mem/ruby/common/Set.cc
index ffc0a3f0771fa41aefbe9f6d3586369726f7287c..12d0b2a2106eeb1b5d06e712c18b4591c4cf3b85 100644
(file)
--- a/
src/mem/ruby/common/Set.cc
+++ b/
src/mem/ruby/common/Set.cc
@@
-300,8
+300,7
@@
void
Set::setSize(int size)
{
m_nSize = size;
-
- m_nArrayLen = m_nSize / LONG_BITS + ((m_nSize % LONG_BITS == 0) ? 0 : 1 );
+ m_nArrayLen = (m_nSize + LONG_BITS - 1) / LONG_BITS;
// decide whether to use dynamic or static alloction
if (m_nArrayLen <= NUMBER_WORDS_PER_SET) {