OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_MISC_INTRINSICS_H_ | 5 #ifndef V8_MISC_INTRINSICS_H_ |
6 #define V8_MISC_INTRINSICS_H_ | 6 #define V8_MISC_INTRINSICS_H_ |
7 | 7 |
8 #include "../include/v8.h" | 8 #include "include/v8.h" |
9 #include "globals.h" | 9 #include "src/globals.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 // Returns the index of the leading 1 bit, counting the least significant bit at | 14 // Returns the index of the leading 1 bit, counting the least significant bit at |
15 // index 0. (1 << IntegerLog2(x)) is a mask for the most significant bit of x. | 15 // index 0. (1 << IntegerLog2(x)) is a mask for the most significant bit of x. |
16 // Result is undefined if input is zero. | 16 // Result is undefined if input is zero. |
17 int IntegerLog2(uint32_t value); | 17 int IntegerLog2(uint32_t value); |
18 | 18 |
19 #if defined(__GNUC__) | 19 #if defined(__GNUC__) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 result |= (value >> 1); | 58 result |= (value >> 1); |
59 | 59 |
60 return result; | 60 return result; |
61 } | 61 } |
62 #endif | 62 #endif |
63 | 63 |
64 } } // namespace v8::internal | 64 } } // namespace v8::internal |
65 | 65 |
66 #endif // V8_MISC_INTRINSICS_H_ | 66 #endif // V8_MISC_INTRINSICS_H_ |
OLD | NEW |