gem5  v20.1.0.0
Functions | Variables
byteswap.hh File Reference
#include "base/logging.hh"
#include "base/types.hh"
#include <machine/endian.h>

Go to the source code of this file.

Functions

uint64_t swap_byte64 (uint64_t x)
 
uint32_t swap_byte32 (uint32_t x)
 
uint16_t swap_byte16 (uint16_t x)
 
template<typename T >
swap_byte (T x)
 
template<typename T , size_t N>
std::array< T, N > swap_byte (std::array< T, N > a)
 
template<typename T >
betole (T value)
 
template<typename T >
letobe (T value)
 
template<typename T >
htole (T value)
 
template<typename T >
letoh (T value)
 
template<typename T >
htobe (T value)
 
template<typename T >
betoh (T value)
 
template<typename T >
htog (T value, ByteOrder guest_byte_order)
 
template<typename T >
gtoh (T value, ByteOrder guest_byte_order)
 

Variables

const ByteOrder HostByteOrder = ByteOrder::big
 

Function Documentation

◆ betoh()

template<typename T >
T betoh ( value)
inline

◆ betole()

template<typename T >
T betole ( value)
inline

Definition at line 133 of file byteswap.hh.

References swap_byte().

Referenced by TEST().

◆ gtoh()

template<typename T >
T gtoh ( value,
ByteOrder  guest_byte_order 
)
inline

◆ htobe()

template<typename T >
T htobe ( value)
inline

◆ htog()

template<typename T >
T htog ( value,
ByteOrder  guest_byte_order 
)
inline

◆ htole()

template<typename T >
T htole ( value)
inline

◆ letobe()

template<typename T >
T letobe ( value)
inline

Definition at line 134 of file byteswap.hh.

References swap_byte().

Referenced by ArmISA::ArmStaticInst::cSwap(), and TEST().

◆ letoh()

template<typename T >
T letoh ( value)
inline

◆ swap_byte() [1/2]

template<typename T , size_t N>
std::array<T, N> swap_byte ( std::array< T, N >  a)
inline

Definition at line 124 of file byteswap.hh.

References ArmISA::a, swap_byte(), and ArmISA::v.

◆ swap_byte() [2/2]

template<typename T >
T swap_byte ( x)
inline

Definition at line 109 of file byteswap.hh.

References panic, swap_byte16(), swap_byte32(), swap_byte64(), and RiscvISA::x.

Referenced by betole(), htole(), letobe(), letoh(), and swap_byte().

◆ swap_byte16()

uint16_t swap_byte16 ( uint16_t  x)
inline

Definition at line 92 of file byteswap.hh.

References RiscvISA::x.

Referenced by swap_byte(), and TEST().

◆ swap_byte32()

uint32_t swap_byte32 ( uint32_t  x)
inline

Definition at line 78 of file byteswap.hh.

References RiscvISA::x.

Referenced by swap_byte(), and TEST().

◆ swap_byte64()

uint64_t swap_byte64 ( uint64_t  x)
inline

Definition at line 59 of file byteswap.hh.

References ULL, and RiscvISA::x.

Referenced by swap_byte(), and TEST().

Variable Documentation

◆ HostByteOrder

const ByteOrder HostByteOrder = ByteOrder::big

Definition at line 139 of file byteswap.hh.


Generated on Wed Sep 30 2020 14:02:19 for gem5 by doxygen 1.8.17