2010-10-21 22:28:21 +02:00
|
|
|
//===- Endian.h - Utilities for IO with endian specific data ----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares generic functions to read and write endian specific data.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_SUPPORT_ENDIAN_H
|
|
|
|
#define LLVM_SUPPORT_ENDIAN_H
|
|
|
|
|
2010-11-29 19:16:10 +01:00
|
|
|
#include "llvm/Support/Host.h"
|
|
|
|
#include "llvm/Support/SwapByteOrder.h"
|
2010-10-21 22:28:21 +02:00
|
|
|
|
2017-04-06 23:28:29 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2010-10-21 22:28:21 +02:00
|
|
|
namespace llvm {
|
|
|
|
namespace support {
|
2013-01-02 21:14:11 +01:00
|
|
|
enum endianness {big, little, native};
|
2010-10-21 22:28:21 +02:00
|
|
|
|
2013-01-02 21:14:11 +01:00
|
|
|
// These are named values for common alignments.
|
|
|
|
enum {aligned = 0, unaligned = 1};
|
2010-10-21 22:28:21 +02:00
|
|
|
|
|
|
|
namespace detail {
|
2013-01-02 21:14:11 +01:00
|
|
|
/// \brief ::value is either alignment, or alignof(T) if alignment is 0.
|
|
|
|
template<class T, int alignment>
|
|
|
|
struct PickAlignment {
|
2016-10-20 17:02:18 +02:00
|
|
|
enum { value = alignment == 0 ? alignof(T) : alignment };
|
2013-01-02 21:14:11 +01:00
|
|
|
};
|
2010-10-21 22:28:21 +02:00
|
|
|
} // end namespace detail
|
|
|
|
|
2010-10-22 21:14:39 +02:00
|
|
|
namespace endian {
|
2017-02-06 19:31:21 +01:00
|
|
|
constexpr endianness system_endianness() {
|
|
|
|
return sys::IsBigEndianHost ? big : little;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename value_type>
|
|
|
|
inline value_type byte_swap(value_type value, endianness endian) {
|
|
|
|
if ((endian != native) && (endian != system_endianness()))
|
|
|
|
sys::swapByteOrder(value);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2014-03-24 22:30:55 +01:00
|
|
|
/// Swap the bytes of value to match the given endianness.
|
2013-01-02 21:14:11 +01:00
|
|
|
template<typename value_type, endianness endian>
|
|
|
|
inline value_type byte_swap(value_type value) {
|
2017-02-06 19:31:21 +01:00
|
|
|
return byte_swap(value, endian);
|
2013-01-02 21:14:11 +01:00
|
|
|
}
|
2010-10-22 21:14:39 +02:00
|
|
|
|
2014-03-24 22:30:55 +01:00
|
|
|
/// Read a value of a particular endianness from memory.
|
2017-02-06 19:31:21 +01:00
|
|
|
template <typename value_type, std::size_t alignment>
|
|
|
|
inline value_type read(const void *memory, endianness endian) {
|
2013-01-02 21:14:11 +01:00
|
|
|
value_type ret;
|
|
|
|
|
|
|
|
memcpy(&ret,
|
2017-02-06 19:31:21 +01:00
|
|
|
LLVM_ASSUME_ALIGNED(
|
|
|
|
memory, (detail::PickAlignment<value_type, alignment>::value)),
|
2013-01-02 21:14:11 +01:00
|
|
|
sizeof(value_type));
|
2017-02-06 19:31:21 +01:00
|
|
|
return byte_swap<value_type>(ret, endian);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename value_type,
|
|
|
|
endianness endian,
|
|
|
|
std::size_t alignment>
|
|
|
|
inline value_type read(const void *memory) {
|
|
|
|
return read<value_type, alignment>(memory, endian);
|
2013-01-02 21:14:11 +01:00
|
|
|
}
|
2010-10-22 21:14:39 +02:00
|
|
|
|
2014-03-25 02:04:44 +01:00
|
|
|
/// Read a value of a particular endianness from a buffer, and increment the
|
|
|
|
/// buffer past that value.
|
2017-02-06 19:31:21 +01:00
|
|
|
template <typename value_type, std::size_t alignment, typename CharT>
|
|
|
|
inline value_type readNext(const CharT *&memory, endianness endian) {
|
|
|
|
value_type ret = read<value_type, alignment>(memory, endian);
|
|
|
|
memory += sizeof(value_type);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-03-16 07:55:45 +01:00
|
|
|
template<typename value_type, endianness endian, std::size_t alignment,
|
|
|
|
typename CharT>
|
|
|
|
inline value_type readNext(const CharT *&memory) {
|
2017-02-06 19:31:21 +01:00
|
|
|
return readNext<value_type, alignment, CharT>(memory, endian);
|
2014-03-25 02:04:44 +01:00
|
|
|
}
|
|
|
|
|
2014-03-24 22:30:55 +01:00
|
|
|
/// Write a value to memory with a particular endianness.
|
2017-02-06 19:31:21 +01:00
|
|
|
template <typename value_type, std::size_t alignment>
|
|
|
|
inline void write(void *memory, value_type value, endianness endian) {
|
|
|
|
value = byte_swap<value_type>(value, endian);
|
|
|
|
memcpy(LLVM_ASSUME_ALIGNED(
|
|
|
|
memory, (detail::PickAlignment<value_type, alignment>::value)),
|
|
|
|
&value, sizeof(value_type));
|
|
|
|
}
|
|
|
|
|
2013-01-02 21:14:11 +01:00
|
|
|
template<typename value_type,
|
|
|
|
endianness endian,
|
|
|
|
std::size_t alignment>
|
|
|
|
inline void write(void *memory, value_type value) {
|
2017-02-06 19:31:21 +01:00
|
|
|
write<value_type, alignment>(memory, value, endian);
|
2010-10-22 21:14:39 +02:00
|
|
|
}
|
2015-09-30 15:20:37 +02:00
|
|
|
|
2015-10-08 22:52:23 +02:00
|
|
|
template <typename value_type>
|
|
|
|
using make_unsigned_t = typename std::make_unsigned<value_type>::type;
|
|
|
|
|
2015-09-30 15:20:37 +02:00
|
|
|
/// Read a value of a particular endianness from memory, for a location
|
|
|
|
/// that starts at the given bit offset within the first byte.
|
|
|
|
template <typename value_type, endianness endian, std::size_t alignment>
|
|
|
|
inline value_type readAtBitAlignment(const void *memory, uint64_t startBit) {
|
|
|
|
assert(startBit < 8);
|
|
|
|
if (startBit == 0)
|
|
|
|
return read<value_type, endian, alignment>(memory);
|
|
|
|
else {
|
|
|
|
// Read two values and compose the result from them.
|
|
|
|
value_type val[2];
|
|
|
|
memcpy(&val[0],
|
|
|
|
LLVM_ASSUME_ALIGNED(
|
|
|
|
memory, (detail::PickAlignment<value_type, alignment>::value)),
|
|
|
|
sizeof(value_type) * 2);
|
|
|
|
val[0] = byte_swap<value_type, endian>(val[0]);
|
|
|
|
val[1] = byte_swap<value_type, endian>(val[1]);
|
|
|
|
|
|
|
|
// Shift bits from the lower value into place.
|
2015-10-08 22:52:23 +02:00
|
|
|
make_unsigned_t<value_type> lowerVal = val[0] >> startBit;
|
2015-09-30 15:20:37 +02:00
|
|
|
// Mask off upper bits after right shift in case of signed type.
|
2015-10-08 22:52:23 +02:00
|
|
|
make_unsigned_t<value_type> numBitsFirstVal =
|
|
|
|
(sizeof(value_type) * 8) - startBit;
|
|
|
|
lowerVal &= ((make_unsigned_t<value_type>)1 << numBitsFirstVal) - 1;
|
2015-09-30 15:20:37 +02:00
|
|
|
|
|
|
|
// Get the bits from the upper value.
|
2015-10-08 22:52:23 +02:00
|
|
|
make_unsigned_t<value_type> upperVal =
|
|
|
|
val[1] & (((make_unsigned_t<value_type>)1 << startBit) - 1);
|
2015-09-30 15:20:37 +02:00
|
|
|
// Shift them in to place.
|
|
|
|
upperVal <<= numBitsFirstVal;
|
|
|
|
|
|
|
|
return lowerVal | upperVal;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Write a value to memory with a particular endianness, for a location
|
|
|
|
/// that starts at the given bit offset within the first byte.
|
|
|
|
template <typename value_type, endianness endian, std::size_t alignment>
|
|
|
|
inline void writeAtBitAlignment(void *memory, value_type value,
|
|
|
|
uint64_t startBit) {
|
|
|
|
assert(startBit < 8);
|
|
|
|
if (startBit == 0)
|
|
|
|
write<value_type, endian, alignment>(memory, value);
|
|
|
|
else {
|
|
|
|
// Read two values and shift the result into them.
|
|
|
|
value_type val[2];
|
|
|
|
memcpy(&val[0],
|
|
|
|
LLVM_ASSUME_ALIGNED(
|
|
|
|
memory, (detail::PickAlignment<value_type, alignment>::value)),
|
|
|
|
sizeof(value_type) * 2);
|
|
|
|
val[0] = byte_swap<value_type, endian>(val[0]);
|
|
|
|
val[1] = byte_swap<value_type, endian>(val[1]);
|
|
|
|
|
|
|
|
// Mask off any existing bits in the upper part of the lower value that
|
|
|
|
// we want to replace.
|
2015-10-08 22:52:23 +02:00
|
|
|
val[0] &= ((make_unsigned_t<value_type>)1 << startBit) - 1;
|
|
|
|
make_unsigned_t<value_type> numBitsFirstVal =
|
|
|
|
(sizeof(value_type) * 8) - startBit;
|
|
|
|
make_unsigned_t<value_type> lowerVal = value;
|
2015-10-08 15:14:59 +02:00
|
|
|
if (startBit > 0) {
|
|
|
|
// Mask off the upper bits in the new value that are not going to go into
|
|
|
|
// the lower value. This avoids a left shift of a negative value, which
|
|
|
|
// is undefined behavior.
|
2015-10-08 22:52:23 +02:00
|
|
|
lowerVal &= (((make_unsigned_t<value_type>)1 << numBitsFirstVal) - 1);
|
2015-10-08 15:14:59 +02:00
|
|
|
// Now shift the new bits into place
|
|
|
|
lowerVal <<= startBit;
|
|
|
|
}
|
|
|
|
val[0] |= lowerVal;
|
2015-09-30 15:20:37 +02:00
|
|
|
|
|
|
|
// Mask off any existing bits in the lower part of the upper value that
|
|
|
|
// we want to replace.
|
2015-10-08 22:52:23 +02:00
|
|
|
val[1] &= ~(((make_unsigned_t<value_type>)1 << startBit) - 1);
|
2015-09-30 15:20:37 +02:00
|
|
|
// Next shift the bits that go into the upper value into position.
|
2015-10-08 22:52:23 +02:00
|
|
|
make_unsigned_t<value_type> upperVal = value >> numBitsFirstVal;
|
2015-09-30 15:20:37 +02:00
|
|
|
// Mask off upper bits after right shift in case of signed type.
|
2015-10-08 22:52:23 +02:00
|
|
|
upperVal &= ((make_unsigned_t<value_type>)1 << startBit) - 1;
|
2015-09-30 15:20:37 +02:00
|
|
|
val[1] |= upperVal;
|
|
|
|
|
|
|
|
// Finally, rewrite values.
|
|
|
|
val[0] = byte_swap<value_type, endian>(val[0]);
|
|
|
|
val[1] = byte_swap<value_type, endian>(val[1]);
|
|
|
|
memcpy(LLVM_ASSUME_ALIGNED(
|
|
|
|
memory, (detail::PickAlignment<value_type, alignment>::value)),
|
|
|
|
&val[0], sizeof(value_type) * 2);
|
|
|
|
}
|
|
|
|
}
|
2013-01-02 21:14:11 +01:00
|
|
|
} // end namespace endian
|
2010-10-21 22:28:21 +02:00
|
|
|
|
|
|
|
namespace detail {
|
|
|
|
template<typename value_type,
|
2010-10-22 20:45:12 +02:00
|
|
|
endianness endian,
|
2013-01-02 21:14:11 +01:00
|
|
|
std::size_t alignment>
|
|
|
|
struct packed_endian_specific_integral {
|
2016-01-13 20:32:35 +01:00
|
|
|
packed_endian_specific_integral() = default;
|
|
|
|
|
|
|
|
explicit packed_endian_specific_integral(value_type val) { *this = val; }
|
|
|
|
|
2010-10-21 22:28:21 +02:00
|
|
|
operator value_type() const {
|
2013-01-02 21:14:11 +01:00
|
|
|
return endian::read<value_type, endian, alignment>(
|
|
|
|
(const void*)Value.buffer);
|
2010-10-21 22:28:21 +02:00
|
|
|
}
|
|
|
|
|
2012-01-22 10:01:03 +01:00
|
|
|
void operator=(value_type newValue) {
|
2013-01-02 21:14:11 +01:00
|
|
|
endian::write<value_type, endian, alignment>(
|
|
|
|
(void*)Value.buffer, newValue);
|
2012-01-22 10:01:03 +01:00
|
|
|
}
|
2010-10-21 22:28:21 +02:00
|
|
|
|
2014-09-12 00:55:25 +02:00
|
|
|
packed_endian_specific_integral &operator+=(value_type newValue) {
|
|
|
|
*this = *this + newValue;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
packed_endian_specific_integral &operator-=(value_type newValue) {
|
|
|
|
*this = *this - newValue;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2015-06-15 05:00:15 +02:00
|
|
|
packed_endian_specific_integral &operator|=(value_type newValue) {
|
|
|
|
*this = *this | newValue;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
packed_endian_specific_integral &operator&=(value_type newValue) {
|
|
|
|
*this = *this & newValue;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2010-10-21 22:28:21 +02:00
|
|
|
private:
|
2013-01-02 21:14:11 +01:00
|
|
|
AlignedCharArray<PickAlignment<value_type, alignment>::value,
|
|
|
|
sizeof(value_type)> Value;
|
2014-08-28 01:06:08 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
struct ref {
|
|
|
|
explicit ref(void *Ptr) : Ptr(Ptr) {}
|
|
|
|
|
|
|
|
operator value_type() const {
|
|
|
|
return endian::read<value_type, endian, alignment>(Ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void operator=(value_type NewValue) {
|
|
|
|
endian::write<value_type, endian, alignment>(Ptr, NewValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void *Ptr;
|
|
|
|
};
|
2010-10-21 22:28:21 +02:00
|
|
|
};
|
2014-08-28 01:06:08 +02:00
|
|
|
|
2010-10-21 22:28:21 +02:00
|
|
|
} // end namespace detail
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint16_t, little, unaligned> ulittle16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint32_t, little, unaligned> ulittle32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint64_t, little, unaligned> ulittle64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int16_t, little, unaligned> little16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int32_t, little, unaligned> little32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int64_t, little, unaligned> little64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint16_t, little, aligned> aligned_ulittle16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint32_t, little, aligned> aligned_ulittle32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint64_t, little, aligned> aligned_ulittle64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int16_t, little, aligned> aligned_little16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int32_t, little, aligned> aligned_little32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int64_t, little, aligned> aligned_little64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint16_t, big, unaligned> ubig16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint32_t, big, unaligned> ubig32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint64_t, big, unaligned> ubig64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int16_t, big, unaligned> big16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int32_t, big, unaligned> big32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int64_t, big, unaligned> big64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint16_t, big, aligned> aligned_ubig16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint32_t, big, aligned> aligned_ubig32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint64_t, big, aligned> aligned_ubig64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int16_t, big, aligned> aligned_big16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int32_t, big, aligned> aligned_big32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int64_t, big, aligned> aligned_big64_t;
|
|
|
|
|
2013-01-02 21:14:11 +01:00
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint16_t, native, unaligned> unaligned_uint16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint32_t, native, unaligned> unaligned_uint32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<uint64_t, native, unaligned> unaligned_uint64_t;
|
|
|
|
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int16_t, native, unaligned> unaligned_int16_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int32_t, native, unaligned> unaligned_int32_t;
|
|
|
|
typedef detail::packed_endian_specific_integral
|
|
|
|
<int64_t, native, unaligned> unaligned_int64_t;
|
2015-03-02 21:00:15 +01:00
|
|
|
|
|
|
|
namespace endian {
|
2017-02-06 19:31:21 +01:00
|
|
|
template <typename T> inline T read(const void *P, endianness E) {
|
|
|
|
return read<T, unaligned>(P, E);
|
|
|
|
}
|
|
|
|
|
2015-11-09 22:34:45 +01:00
|
|
|
template <typename T, endianness E> inline T read(const void *P) {
|
|
|
|
return *(const detail::packed_endian_specific_integral<T, E, unaligned> *)P;
|
|
|
|
}
|
|
|
|
|
2017-02-06 19:31:21 +01:00
|
|
|
inline uint16_t read16(const void *P, endianness E) {
|
|
|
|
return read<uint16_t>(P, E);
|
|
|
|
}
|
|
|
|
inline uint32_t read32(const void *P, endianness E) {
|
|
|
|
return read<uint32_t>(P, E);
|
|
|
|
}
|
|
|
|
inline uint64_t read64(const void *P, endianness E) {
|
|
|
|
return read<uint64_t>(P, E);
|
|
|
|
}
|
|
|
|
|
2015-11-09 22:34:45 +01:00
|
|
|
template <endianness E> inline uint16_t read16(const void *P) {
|
|
|
|
return read<uint16_t, E>(P);
|
|
|
|
}
|
|
|
|
template <endianness E> inline uint32_t read32(const void *P) {
|
|
|
|
return read<uint32_t, E>(P);
|
|
|
|
}
|
|
|
|
template <endianness E> inline uint64_t read64(const void *P) {
|
|
|
|
return read<uint64_t, E>(P);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline uint16_t read16le(const void *P) { return read16<little>(P); }
|
|
|
|
inline uint32_t read32le(const void *P) { return read32<little>(P); }
|
|
|
|
inline uint64_t read64le(const void *P) { return read64<little>(P); }
|
|
|
|
inline uint16_t read16be(const void *P) { return read16<big>(P); }
|
|
|
|
inline uint32_t read32be(const void *P) { return read32<big>(P); }
|
|
|
|
inline uint64_t read64be(const void *P) { return read64<big>(P); }
|
|
|
|
|
2017-02-06 19:31:21 +01:00
|
|
|
template <typename T> inline void write(void *P, T V, endianness E) {
|
|
|
|
write<T, unaligned>(P, V, E);
|
|
|
|
}
|
|
|
|
|
2015-11-09 22:34:45 +01:00
|
|
|
template <typename T, endianness E> inline void write(void *P, T V) {
|
|
|
|
*(detail::packed_endian_specific_integral<T, E, unaligned> *)P = V;
|
|
|
|
}
|
|
|
|
|
2017-02-06 19:31:21 +01:00
|
|
|
inline void write16(void *P, uint16_t V, endianness E) {
|
|
|
|
write<uint16_t>(P, V, E);
|
|
|
|
}
|
|
|
|
inline void write32(void *P, uint32_t V, endianness E) {
|
|
|
|
write<uint32_t>(P, V, E);
|
|
|
|
}
|
|
|
|
inline void write64(void *P, uint64_t V, endianness E) {
|
|
|
|
write<uint64_t>(P, V, E);
|
|
|
|
}
|
|
|
|
|
2015-11-09 22:34:45 +01:00
|
|
|
template <endianness E> inline void write16(void *P, uint16_t V) {
|
|
|
|
write<uint16_t, E>(P, V);
|
|
|
|
}
|
|
|
|
template <endianness E> inline void write32(void *P, uint32_t V) {
|
|
|
|
write<uint32_t, E>(P, V);
|
|
|
|
}
|
|
|
|
template <endianness E> inline void write64(void *P, uint64_t V) {
|
|
|
|
write<uint64_t, E>(P, V);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void write16le(void *P, uint16_t V) { write16<little>(P, V); }
|
|
|
|
inline void write32le(void *P, uint32_t V) { write32<little>(P, V); }
|
|
|
|
inline void write64le(void *P, uint64_t V) { write64<little>(P, V); }
|
|
|
|
inline void write16be(void *P, uint16_t V) { write16<big>(P, V); }
|
|
|
|
inline void write32be(void *P, uint32_t V) { write32<big>(P, V); }
|
|
|
|
inline void write64be(void *P, uint64_t V) { write64<big>(P, V); }
|
2015-03-02 21:00:15 +01:00
|
|
|
} // end namespace endian
|
2010-10-21 22:28:21 +02:00
|
|
|
} // end namespace support
|
2015-03-02 21:00:15 +01:00
|
|
|
} // end namespace llvm
|
2010-10-21 22:28:21 +02:00
|
|
|
|
|
|
|
#endif
|