On Tue, June 14, 2011 8:28 pm, Korey Sewell wrote: > Thanks for this fix Nilay. > > We agree that the longterm fix for this is stl bitsets right? > > > On Tue, Jun 14, 2011 at 8:52 PM, Nilay Vaish <[email protected]> wrote: > >> changeset f897d0483b06 in /z/repo/gem5 >> details: http://repo.gem5.org/gem5?cmd=changeset;node=f897d0483b06 >> description: >> Ruby: Correct set LONG_BITS and INDEX_SHIFT in class Set. >> The code for Set class was written under the assumption that >> std::numeric_limits<long>::digits returns the number of bits used >> for >> data type long, which was presumed to be either 32 or 64. But >> return >> value >> is actually one less, that is, it is either 31 or 63. The value >> is >> now >> being incremented by 1 so as to correctly set it. >> >> diffstat: >> >> src/mem/ruby/common/Set.hh | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diffs (12 lines): >> >> diff -r 9fb150de362e -r f897d0483b06 src/mem/ruby/common/Set.hh >> --- a/src/mem/ruby/common/Set.hh Sun Jun 12 23:52:21 2011 -0700 >> +++ b/src/mem/ruby/common/Set.hh Tue Jun 14 19:51:44 2011 -0500 >> @@ -54,7 +54,7 @@ >> long *m_p_nArray; // an word array to hold the bits in the set >> long m_p_nArray_Static[NUMBER_WORDS_PER_SET]; >> >> - static const int LONG_BITS = std::numeric_limits<long>::digits; >> + static const int LONG_BITS = std::numeric_limits<long>::digits + 1; >> static const int INDEX_SHIFT = LONG_BITS == 64 ? 6 : 5; >> static const int INDEX_MASK = (1 << INDEX_SHIFT) - 1; >> >> _______________________________________________ >> gem5-dev mailing list >> [email protected] >> http://m5sim.org/mailman/listinfo/gem5-dev >> > > > > -- > - Korey > _______________________________________________ > gem5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/gem5-dev >
IIRC, that's what the consensus was last time we had a discussion on this issue. In general, scaling for larger number of cores may need more detailed discussion. -- Nilay _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
