| OLD | NEW |
| 1 //===- subzero/src/IceUtils.h - Utility functions ---------------*- C++ -*-===// | 1 //===- subzero/src/IceUtils.h - Utility functions ---------------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file declares some utility functions. | 10 // This file declares some utility functions. |
| 11 // | 11 // |
| 12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
| 13 | 13 |
| 14 #ifndef SUBZERO_SRC_ICEUTILS_H | 14 #ifndef SUBZERO_SRC_ICEUTILS_H |
| 15 #define SUBZERO_SRC_ICEUTILS_H | 15 #define SUBZERO_SRC_ICEUTILS_H |
| 16 |
| 16 #include <climits> | 17 #include <climits> |
| 17 | 18 |
| 18 namespace Ice { | 19 namespace Ice { |
| 19 | 20 |
| 20 // Similar to bit_cast, but allows copying from types of unrelated | 21 // Similar to bit_cast, but allows copying from types of unrelated |
| 21 // sizes. This method was introduced to enable the strict aliasing | 22 // sizes. This method was introduced to enable the strict aliasing |
| 22 // optimizations of GCC 4.4. Basically, GCC mindlessly relies on | 23 // optimizations of GCC 4.4. Basically, GCC mindlessly relies on |
| 23 // obscure details in the C++ standard that make reinterpret_cast | 24 // obscure details in the C++ standard that make reinterpret_cast |
| 24 // virtually useless. | 25 // virtually useless. |
| 25 template <class D, class S> inline D bit_copy(const S &source) { | 26 template <class D, class S> inline D bit_copy(const S &source) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 static inline uint32_t rotateRight32(uint32_t value, uint32_t shift) { | 103 static inline uint32_t rotateRight32(uint32_t value, uint32_t shift) { |
| 103 if (shift == 0) | 104 if (shift == 0) |
| 104 return value; | 105 return value; |
| 105 return (value >> shift) | (value << (32 - shift)); | 106 return (value >> shift) | (value << (32 - shift)); |
| 106 } | 107 } |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // end of namespace Ice | 110 } // end of namespace Ice |
| 110 | 111 |
| 111 #endif // SUBZERO_SRC_ICEUTILS_H | 112 #endif // SUBZERO_SRC_ICEUTILS_H |
| OLD | NEW |