| 53 | } |
| 54 | |
| 55 | inline uint64 DecodeFixed64(const char* ptr) { |
| 56 | if (port::kLittleEndian) { |
| 57 | // Load the raw bytes |
| 58 | uint64 result; |
| 59 | memcpy(&result, ptr, sizeof(result)); // gcc optimizes this to a plain load |
| 60 | return result; |
| 61 | } else { |
| 62 | uint64 lo = DecodeFixed32(ptr); |
| 63 | uint64 hi = DecodeFixed32(ptr + 4); |
| 64 | return (hi << 32) | lo; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | } // namespace core |
| 69 | } // namespace tensorflow |