| Index: runtime/platform/utils.cc
|
| diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc
|
| index 77783909495bac054683b8c50375059db699856b..0dde3c702713eee0fb8c6f92dadd07c425146878 100644
|
| --- a/runtime/platform/utils.cc
|
| +++ b/runtime/platform/utils.cc
|
| @@ -39,11 +39,26 @@ int Utils::HighestBit(int64_t v) {
|
| uint64_t x = static_cast<uint64_t>((v > 0) ? v : -v);
|
| uint64_t t;
|
| int r = 0;
|
| - if ((t = x >> 32) != 0) { x = t; r += 32; }
|
| - if ((t = x >> 16) != 0) { x = t; r += 16; }
|
| - if ((t = x >> 8) != 0) { x = t; r += 8; }
|
| - if ((t = x >> 4) != 0) { x = t; r += 4; }
|
| - if ((t = x >> 2) != 0) { x = t; r += 2; }
|
| + if ((t = x >> 32) != 0) {
|
| + x = t;
|
| + r += 32;
|
| + }
|
| + if ((t = x >> 16) != 0) {
|
| + x = t;
|
| + r += 16;
|
| + }
|
| + if ((t = x >> 8) != 0) {
|
| + x = t;
|
| + r += 8;
|
| + }
|
| + if ((t = x >> 4) != 0) {
|
| + x = t;
|
| + r += 4;
|
| + }
|
| + if ((t = x >> 2) != 0) {
|
| + x = t;
|
| + r += 2;
|
| + }
|
| if (x > 1) r += 1;
|
| return r;
|
| }
|
|
|