From: Ali Saidi Date: Fri, 16 Mar 2007 03:21:01 +0000 (-0400) Subject: fix a bug gabe found X-Git-Tag: m5_2.0_beta3~93^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a18baae02638f1abc627edc63570878659082108;p=gem5.git fix a bug gabe found --HG-- extra : convert_revision : 12e8f09f6c59a16b2d2eb78bdd1345fc38c4de40 --- 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; }