ZXFoundation™ 26h2
Loading...
Searching...
No Matches
lib.bit Module Reference

Data Structures

struct  lib::bit_view< T, Conv >
 Non-owning typed view over a single integer's bits. More...

Enumerations

enum class  lib::bit_numbering { lsb0 , msb0 }
 Bit-numbering conventions.

Functions

template<typename T>
requires std::is_integral_v<T>
constexpr auto lib::big_to_native (T val) noexcept -> T
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_clear (T &val, u32 bit) noexcept -> void
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_clear_msb (T &val, u32 bit) noexcept -> void
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_extract (T val, u32 start, u32 end) noexcept -> T
 Extract bitfield [start, end] inclusive (LSB0), shifted to LSB.
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_extract_msb (T val, u32 start, u32 end) noexcept -> T
 Extract bitfield [start, end] inclusive (IBM MSB0), shifted to LSB.
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_insert (T &target, u32 start, u32 end, T val) noexcept -> void
 Insert value into bitfield [start, end] inclusive (LSB0).
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_insert_msb (T &target, u32 start, u32 end, T val) noexcept -> void
 Insert value into bitfield [start, end] inclusive (IBM MSB0).
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_mask (u32 bit) noexcept -> T
 Mask with a single bit set (LSB0 numbering).
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_mask_msb (u32 bit) noexcept -> T
 Mask with a single bit set (MSB0 / IBM numbering).
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_range_mask (u32 start, u32 end) noexcept -> T
 Mask for a range of bits [start, end] inclusive (LSB0).
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_range_mask_msb (u32 start, u32 end) noexcept -> T
 Mask for a range of bits [start, end] inclusive (IBM MSB0).
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_set (T &val, u32 bit) noexcept -> void
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_set_msb (T &val, u32 bit) noexcept -> void
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_test (T val, u32 bit) noexcept -> bool
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_test_msb (T val, u32 bit) noexcept -> bool
template<typename T>
requires std::is_unsigned_v<T>
constexpr auto lib::bit_toggle (T &val, u32 bit) noexcept -> void
constexpr bit_view (T &v) noexcept
constexpr auto clear (u32 bit) noexcept -> bit_view &
constexpr auto extract (u32 start, u32 end) const noexcept -> T
constexpr auto insert (u32 start, u32 end, T val) noexcept -> bit_view &
template<typename T>
requires std::is_integral_v<T>
constexpr auto lib::little_to_native (T val) noexcept -> T
template<typename T>
requires std::is_integral_v<T>
constexpr auto lib::native_to_big (T val) noexcept -> T
template<typename T>
requires std::is_integral_v<T>
constexpr auto lib::native_to_little (T val) noexcept -> T
constexpr auto set (u32 bit) noexcept -> bit_view &
constexpr auto test (u32 bit) const noexcept -> bool

Variables

T & value

Files

file  lib/bit.cxxm
 Kernel-specific bit helpers layered on top of <bit>.