OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/utils-arm64.h" | 7 #include "src/arm64/utils-arm64.h" |
8 | 8 |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 value = ((value >> 2) & 0x3333333333333333) + (value & 0x3333333333333333); | 71 value = ((value >> 2) & 0x3333333333333333) + (value & 0x3333333333333333); |
72 value = ((value >> 4) & 0x0f0f0f0f0f0f0f0f) + (value & 0x0f0f0f0f0f0f0f0f); | 72 value = ((value >> 4) & 0x0f0f0f0f0f0f0f0f) + (value & 0x0f0f0f0f0f0f0f0f); |
73 value = ((value >> 8) & 0x00ff00ff00ff00ff) + (value & 0x00ff00ff00ff00ff); | 73 value = ((value >> 8) & 0x00ff00ff00ff00ff) + (value & 0x00ff00ff00ff00ff); |
74 value = ((value >> 16) & 0x0000ffff0000ffff) + (value & 0x0000ffff0000ffff); | 74 value = ((value >> 16) & 0x0000ffff0000ffff) + (value & 0x0000ffff0000ffff); |
75 value = ((value >> 32) & 0x00000000ffffffff) + (value & 0x00000000ffffffff); | 75 value = ((value >> 32) & 0x00000000ffffffff) + (value & 0x00000000ffffffff); |
76 | 76 |
77 return value; | 77 return value; |
78 } | 78 } |
79 | 79 |
80 | 80 |
| 81 uint64_t LargestPowerOf2Divisor(uint64_t value) { |
| 82 return value & -value; |
| 83 } |
| 84 |
| 85 |
81 int MaskToBit(uint64_t mask) { | 86 int MaskToBit(uint64_t mask) { |
82 ASSERT(CountSetBits(mask, 64) == 1); | 87 ASSERT(CountSetBits(mask, 64) == 1); |
83 return CountTrailingZeros(mask, 64); | 88 return CountTrailingZeros(mask, 64); |
84 } | 89 } |
85 | 90 |
86 | 91 |
87 } } // namespace v8::internal | 92 } } // namespace v8::internal |
88 | 93 |
89 #endif // V8_TARGET_ARCH_ARM64 | 94 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |