changeset 00ca5af1b954 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=00ca5af1b954
description:
        Ruby: Eliminate modulo op for computing set size.

diffstat:

 src/mem/ruby/common/Set.cc |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff -r 1f95c9a0bb2f -r 00ca5af1b954 src/mem/ruby/common/Set.cc
--- a/src/mem/ruby/common/Set.cc        Fri Aug 19 15:08:09 2011 -0500
+++ b/src/mem/ruby/common/Set.cc        Fri Aug 26 12:27:58 2011 -0500
@@ -300,8 +300,7 @@
 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) {
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to