OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_BASE_BITS_H_ |
| 6 #define V8_BASE_BITS_H_ |
| 7 |
| 8 #include "include/v8stdint.h" |
| 9 |
| 10 namespace v8 { |
| 11 namespace base { |
| 12 namespace bits { |
| 13 |
| 14 inline uint32_t RotateRight32(uint32_t value, uint32_t shift) { |
| 15 if (shift == 0) return value; |
| 16 return (value >> shift) | (value << (32 - shift)); |
| 17 } |
| 18 |
| 19 |
| 20 inline uint64_t RotateRight64(uint64_t value, uint64_t shift) { |
| 21 if (shift == 0) return value; |
| 22 return (value >> shift) | (value << (64 - shift)); |
| 23 } |
| 24 |
| 25 } // namespace bits |
| 26 } // namespace base |
| 27 } // namespace v8 |
| 28 |
| 29 #endif // V8_BASE_BITS_H_ |
OLD | NEW |