diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2007-03-15 23:21:52 -0400 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2007-03-15 23:21:52 -0400 |
commit | 50475e0e2a5634374f95dfb9e076888bb4367bb7 (patch) | |
tree | 0507d8acb76983dba30c60cee3d211904c71fc85 | |
parent | 9ad3f1e479d8c57253cf057c14f5cfb40f141db3 (diff) | |
parent | a18baae02638f1abc627edc63570878659082108 (diff) | |
download | gem5-50475e0e2a5634374f95dfb9e076888bb4367bb7.tar.xz |
Merge zizzer:/bk/newmem
into pb15.local:/Users/ali/work/m5.newmem
--HG--
extra : convert_revision : 0aa2fadf8978ae30ebe4fde03c525e6b9115117a
-rw-r--r-- | src/base/bitfield.hh | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/base/bitfield.hh b/src/base/bitfield.hh index 83b9138b4..79dbcc86c 100644 --- a/src/base/bitfield.hh +++ b/src/base/bitfield.hh @@ -121,17 +121,12 @@ findMsbSet(uint64_t val) { int msb = 0; if (!val) return 0; - if (bits(val, 63,32)) msb += 32; - val >>= 32; - if (bits(val, 31,16)) msb += 16; - val >>= 16; - if (bits(val, 15,8)) msb += 8; - val >>= 8; - if (bits(val, 7,4)) msb += 4; - val >>= 4; - if (bits(val, 3,2)) msb += 2; - val >>= 2; - if (bits(val, 1,1)) msb += 1; + if (bits(val, 63,32)) { msb += 32; val >>= 32; } + if (bits(val, 31,16)) { msb += 16; val >>= 16; } + if (bits(val, 15,8)) { msb += 8; val >>= 8; } + if (bits(val, 7,4)) { msb += 4; val >>= 4; } + if (bits(val, 3,2)) { msb += 2; val >>= 2; } + if (bits(val, 1,1)) { msb += 1; } return msb; } |