CIRCT 23.0.0git
Loading...
Searching...
No Matches
Namespaces | Functions
BitAccess.h File Reference
#include <cstddef>
#include <cstdint>
#include <type_traits>
Include dependency graph for BitAccess.h:

Go to the source code of this file.

Namespaces

namespace  esi
 
namespace  esi::detail
 

Functions

template<typename Storage , std::size_t BitOffset, std::size_t Width>
constexpr Storage esi::detail::readUnsignedBits (const uint8_t *bytes)
 Read Width bits starting at BitOffset (LSB-first within bytes) and return them zero-extended in Storage.
 
template<typename Signed , std::size_t BitOffset, std::size_t Width>
constexpr Signed esi::detail::readSignedBits (const uint8_t *bytes)
 Read Width bits starting at BitOffset (LSB-first) and sign-extend into the signed integer type Signed.
 
template<typename Storage , std::size_t BitOffset, std::size_t Width>
constexpr void esi::detail::writeUnsignedBits (uint8_t *bytes, Storage value)
 Write the low Width bits of value into bytes starting at BitOffset (LSB-first).
 
template<typename Signed , std::size_t BitOffset, std::size_t Width>
constexpr void esi::detail::writeSignedBits (uint8_t *bytes, Signed value)
 Convenience overload for signed values.
 
template<std::size_t BitOffset, std::size_t Width>
constexpr void esi::detail::copyBitsIn (const uint8_t *src, uint8_t *dst)
 Copy Width bits out of src starting at BitOffset into dst packed LSB-first from bit 0.
 
template<std::size_t BitOffset, std::size_t Width>
constexpr void esi::detail::copyBitsOut (uint8_t *dst, const uint8_t *src)
 Inverse of copyBitsIn: take Width bits packed LSB-first from bit 0 of src and write them into dst starting at BitOffset.
 
template<typename Storage >
Storage esi::detail::readUnsignedBitsDyn (const uint8_t *bytes, std::size_t bitOffset, std::size_t width)
 Runtime-offset form of readUnsignedBits.
 
template<typename Signed >
Signed esi::detail::readSignedBitsDyn (const uint8_t *bytes, std::size_t bitOffset, std::size_t width)
 Runtime-offset form of readSignedBits.
 
template<typename Storage >
void esi::detail::writeUnsignedBitsDyn (uint8_t *bytes, Storage value, std::size_t bitOffset, std::size_t width)
 Runtime-offset form of writeUnsignedBits.
 
template<typename Signed >
void esi::detail::writeSignedBitsDyn (uint8_t *bytes, Signed value, std::size_t bitOffset, std::size_t width)
 Runtime-offset form of writeSignedBits.
 
void esi::detail::copyBitsInDyn (const uint8_t *src, std::size_t srcBitOffset, uint8_t *dst, std::size_t width)
 Runtime-offset form of copyBitsIn.
 
void esi::detail::copyBitsOutDyn (uint8_t *dst, std::size_t dstBitOffset, const uint8_t *src, std::size_t width)
 Runtime-offset form of copyBitsOut.