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

Concepts

concept  lib::bit_storage
concept  lib::detail::record_value_type
 Duck-typed detection of a bitfield record value type.
concept  lib::detail::unsigned_word

Data Structures

struct  lib::addr< Offset >
 Byte-offset anchor for hierarchical register addressing. More...
struct  lib::attr::aligned< A >
 address = raw << log2(A) More...
struct  lib::aligned_address< Alignment >
 Value transformer contract (carries caller bit width). More...
struct  lib::detail::as_transform< H, bool >
struct  lib::detail::as_transform< H, true >
struct  lib::auto_layout
 Automatic-layout locator (structure domain). More...
struct  lib::bank< Count, Stride >
 Strided-array locator (structure domain). More...
struct  lib::endian::big
class  lib::bit_field< T, Numbering >
class  lib::bit_ref< T >
struct  lib::bit_slice< Start, End >
 Compile-time bit slice descriptor (record domain). More...
class  lib::bitfield_ref< T, Numbering >
class  lib::byte_bit_ref< Numbering, TotalBits >
struct  lib::byte_span< Start, End >
 Byte-range locator (structure domain, whole bytes). More...
struct  lib::attr::endian_big
struct  lib::attr::endian_little
struct  lib::exact_uint< Bits >
 Exact-width unsigned integer type (compile-time bit width 1..128). More...
struct  lib::extensions< Mixins >
struct  lib::field< Name, Locator, Type, Attr >
 Unified field descriptor. More...
struct  lib::detail::filter_extensions< Ts >
struct  lib::detail::filter_extensions_dispatch< HasExt, Ts >
struct  lib::detail::filter_extensions_dispatch< true, Ts... >
struct  lib::detail::filter_fields< Ts >
struct  lib::detail::filter_fields_dispatch< AllFields, Ts >
struct  lib::detail::filter_fields_dispatch< false, Ts... >
struct  lib::detail::filter_fields_impl< FilteredTuple, Rest >
struct  lib::detail::filter_fields_impl< Acc, Head, Tail... >
struct  lib::detail::filter_fields_impl< std::tuple< Collected... > >
struct  lib::detail::filter_fields_step< IsExt, Acc, Head, Tail >
struct  lib::detail::filter_fields_step< false, std::tuple< Collected... >, Head, Tail... >
struct  lib::detail::filter_fields_step< true, std::tuple< Collected... >, Head, Tail... >
struct  lib::detail::find_extensions< Ts >
struct  lib::detail::find_extensions< Head, Tail... >
struct  lib::detail::first_of< Pred, Ts >
struct  lib::detail::first_of< Pred, H, T... >
struct  lib::attr::fixed< V >
 architectural constant (always V) More...
struct  lib::detail::fold_max_bit< Tuple >
struct  lib::detail::fold_max_bit< std::tuple< Ss... > >
struct  lib::detail::fold_min_bit< Tuple >
struct  lib::detail::fold_min_bit< std::tuple< Ss... > >
struct  lib::detail::fold_total_width< Tuple >
struct  lib::detail::fold_total_width< std::tuple< Ss... > >
struct  lib::attr::init< V >
 default/reset value More...
struct  lib::attr::inverted
 active-low More...
struct  lib::is_byte_array< T >
struct  lib::is_byte_array< std::array< u8, N > >
struct  lib::is_exact_uint< T >
struct  lib::is_exact_uint< exact_uint< Bits > >
struct  lib::detail::is_extensions_pack< T >
struct  lib::detail::is_extensions_pack< extensions< Ms... > >
struct  lib::detail::is_fixed_tag< T >
struct  lib::detail::is_fixed_tag< attr::fixed< V > >
struct  lib::detail::is_init_tag< T >
struct  lib::detail::is_init_tag< attr::init< V > >
struct  lib::detail::is_transform_tag< T >
struct  lib::detail::is_transform_tag< attr::aligned< A > >
struct  lib::detail::is_transform_tag< attr::inverted >
struct  lib::detail::is_transform_tag< attr::shifted_by< S > >
struct  lib::detail::is_word_tag< T >
struct  lib::detail::is_word_tag< attr::word< W > >
struct  lib::endian::little
struct  lib::lsb0_t
 LSB0 bit numbering policy (Bit 0 = Least Significant Bit). More...
struct  lib::detail::map_record_fields< Tuple >
struct  lib::detail::map_record_fields< std::tuple< Fs... > >
struct  lib::detail::mixin_invoker< ExtensionsHolder, Derived >
struct  lib::detail::mixin_invoker< extensions< Ms... >, Derived >
struct  lib::detail::mixin_invoker< std::tuple<>, Derived >
class  lib::mmio_record_ref< T, Numbering, FieldOrExts >
struct  lib::msb0_t
 MSB0 bit numbering policy (Bit 0 = Most Significant Bit). More...
struct  lib::endian::native
struct  lib::detail::none_token
struct  lib::attr::overlay
 intentional alias More...
struct  lib::detail::path_split< FullPath >
struct  lib::attr::rao
 Read-As-One. More...
struct  lib::detail::raw_tag_bits< Tag >
struct  lib::detail::raw_tag_bits< attr::fixed< V > >
struct  lib::detail::raw_tag_bits< attr::init< V > >
struct  lib::attr::raz
 Read-As-Zero. More...
struct  lib::attr::rc
 Read-to-Clear. More...
class  lib::record< T, Numbering, FieldOrExts >
struct  lib::detail::record_field_view< Field >
struct  lib::detail::record_layout_info< Tuple >
struct  lib::detail::record_layout_info< std::tuple< Fs... > >
class  lib::record_ref< T, Numbering, FieldOrExts >
struct  lib::detail::record_slices< L >
struct  lib::detail::record_slices< bit_slice< A, B > >
struct  lib::detail::record_slices< std::tuple< Ss... > >
struct  lib::record_traits< RecordT >
struct  lib::record_traits< mmio_record_ref< T, Numbering, Fs... > >
struct  lib::record_traits< record< T, Numbering, Fs... > >
struct  lib::record_traits< record_ref< T, Numbering, Fs... > >
struct  lib::detail::resolve_field_type_impl< Field, Storage >
struct  lib::attr::ro
 Read-Only. More...
struct  lib::attr::rw
 Read-Write. More...
struct  lib::attr::rz
 Reserved-Zero. More...
struct  lib::detail::select_access< Attrs >
struct  lib::detail::select_access< H, T... >
struct  lib::detail::select_endian< Attrs >
struct  lib::detail::select_endian< H, T... >
struct  lib::detail::select_fixed_tag< Attrs >
struct  lib::detail::select_fixed_tag< H, T... >
struct  lib::detail::select_init_tag< Attrs >
struct  lib::detail::select_init_tag< H, T... >
struct  lib::detail::select_transform<... >
struct  lib::detail::select_transform< H, T... >
struct  lib::detail::select_word< Attrs >
struct  lib::detail::select_word< H, T... >
struct  lib::shifted< Shift >
struct  lib::attr::shifted_by< S >
 value = raw << S More...
struct  lib::slice< ByteOffset, StartBit, EndBit, Numbering >
 Bit-window locator within a byte-addressed unit (structure domain). More...
struct  lib::storage_traits< T >
struct  lib::storage_traits< exact_uint< Bits > >
struct  lib::storage_traits< std::array< u8, N > >
struct  lib::storage_traits< T >
struct  lib::detail::transform_of< T >
struct  lib::detail::transform_of< attr::aligned< A > >
struct  lib::detail::transform_of< attr::inverted >
struct  lib::detail::transform_of< attr::shifted_by< S > >
struct  std::tuple_element< I, lib::record< T, Numbering, FieldOrExts... > >
struct  std::tuple_size< lib::record< T, Numbering, FieldOrExts... > >
struct  lib::attr::unaligned
struct  lib::attr::w0c
 Write-0-to-Clear. More...
struct  lib::attr::w1c
 Write-1-to-Clear. More...
struct  lib::attr::w1s
 Write-1-to-Set. More...
struct  lib::attr::w1t
 Write-1-to-Toggle. More...
struct  lib::attr::wac
 Write-Any-to-Clear. More...
struct  lib::attr::wo
 Write-Only. More...
struct  lib::attr::woo
 Write-Once-Only. More...
struct  lib::attr::word< W >
 bus granularity (u8/u16/u32/u64) More...
struct  lib::detail::word_type_of< T >
struct  lib::detail::word_type_of< attr::word< W > >

Typedefs

using access = typename detail::select_access<Attr...>::type
template<usize B, class Numbering = msb0_t>
using at_bit = slice<Offset, B, B, Numbering>
template<usize A, usize B, class Numbering = msb0_t>
using at_bits = slice<Offset, A, B, Numbering>
template<usize K>
using at_byte = addr<Offset + K>
template<usize K>
using at_dword = addr<Offset + K * 8>
template<usize K>
using at_halfword = addr<Offset + K * 2>
template<usize K>
using at_qword = addr<Offset + K * 16>
template<usize K>
using at_word = addr<Offset + K * 4>
using lib::bf128 = bit_field<std::array<u8, 16>, msb0_t>
using lib::bf128_ref = bitfield_ref<std::array<u8, 16>, msb0_t>
using lib::bf16 = bit_field<u16, msb0_t>
using lib::bf16_ref = bitfield_ref<u16, msb0_t>
using lib::bf32 = bit_field<u32, msb0_t>
using lib::bf32_ref = bitfield_ref<u32, msb0_t>
using lib::bf64 = bit_field<u64, msb0_t>
using lib::bf64_ref = bitfield_ref<u64, msb0_t>
using lib::bf8 = bit_field<u8, msb0_t>
using lib::bf8_ref = bitfield_ref<u8, msb0_t>
template<usize Start, usize End>
using lib::bit_span = bit_slice<Start, End>
using endian_mode = typename detail::select_endian<Attr...>::type
using fixed_tag = typename detail::select_fixed_tag<Attr...>::type
using granularity = typename detail::select_word<Attr...>::type
using init_tag = typename detail::select_init_tag<Attr...>::type
using lib::lf128 = bit_field<std::array<u8, 16>, msb0_t>
using lib::lf128_ref = bitfield_ref<std::array<u8, 16>, lsb0_t>
using lib::lf16 = bit_field<u16, lsb0_t>
using lib::lf16_ref = bitfield_ref<u16, lsb0_t>
using lib::lf32 = bit_field<u32, lsb0_t>
using lib::lf32_ref = bitfield_ref<u32, lsb0_t>
using lib::lf64 = bit_field<u64, lsb0_t>
using lib::lf64_ref = bitfield_ref<u64, lsb0_t>
using lib::lf8 = bit_field<u8, lsb0_t>
using lib::lf8_ref = bitfield_ref<u8, lsb0_t>
using locator = Locator
using mmio_ref_type = mmio_record_ref<T, Numbering, FieldOrExts...>
using mmio_ref_type = mmio_record_ref<T, Numbering, Fs...>
using mmio_ref_type = mmio_record_ref<T, Numbering, Fs...>
using mmio_ref_type = mmio_record_ref<T, Numbering, Fs...>
using numbering = Numbering
using numbering = Numbering
using numbering = Numbering
using numbering = Numbering
using numbering = Numbering
using numbering = Numbering
using numbering = Numbering
using numbering = Numbering
using numbering = Numbering
template<usize Count>
using lib::detail::optimal_uint_t = decltype(smallest_uint_for_bits<Count>())
using lib::access::rao = attr::rao
using raw_optimal = optimal_uint_t<Field::total_width>
using lib::access::raz = attr::raz
using lib::access::rc = attr::rc
template<class RecordT>
using lib::record_as_mmio_ref_t = typename record_traits<RecordT>::mmio_ref_type
template<class RecordT>
using lib::record_as_ref_t = typename record_traits<RecordT>::ref_type
using ref_type = record_ref<T, Numbering, FieldOrExts...>
using ref_type = record_ref<T, Numbering, Fs...>
using ref_type = record_ref<T, Numbering, Fs...>
using ref_type = record_ref<T, Numbering, Fs...>
template<class Field, class Storage>
using lib::detail::resolve_field_type = typename resolve_field_type_impl<Field, Storage>::type
using lib::access::ro = attr::ro
using lib::access::rw = attr::rw
using lib::access::rz = attr::rz
using slices = typename record_slices<typename Field::locator>::type
using storage_type = T
using storage_type = T
using storage_type = T
using storage_type = T
using storage_type = T
using storage_type = T
using storage_type = T
using storage_type = T
using traits = storage_traits<T>
using traits = storage_traits<T>
using transformer = typename detail::select_transform<Attr...>::type
using type = void
using type = typename transform_of<H>::type
using type = typename filter_extensions_dispatch<(is_extensions_pack<Ts>::value || ...), Ts...>::type
using type = std::tuple<>
using type = typename find_extensions<Ts...>::type
using type = typename filter_fields_dispatch<(!is_extensions_pack<Ts>::value && ...), Ts...>::type
using type = std::tuple<Ts...>
using type = typename filter_fields_impl<std::tuple<>, Ts...>::type
using type = typename filter_fields_step<is_extensions_pack<Head>::value, Acc, Head, Tail...>::type
using type = std::tuple<Collected...>
using type = typename filter_fields_impl<std::tuple<Collected..., Head>, Tail...>::type
using type = typename filter_fields_impl<std::tuple<Collected...>, Tail...>::type
using type = std::tuple<>
using type
using type = none_token
using type = std::conditional_t<Pred<H>::value, H, typename first_of<Pred, T...>::type>
using type = std::tuple<record_field_view<Fs>...>
using type = std::tuple<>
using type = std::tuple<bit_slice<A, B> >
using type = std::tuple<Ss...>
using type
using type = attr::rw
using type = std::conditional_t<is_access_v<H>, H, typename select_access<T...>::type>
using type = endian::native
using type
using type = none_token
using type = std::conditional_t<is_fixed_v<H>, H, typename select_fixed_tag<T...>::type>
using type = none_token
using type = std::conditional_t<is_init_v<H>, H, typename select_init_tag<T...>::type>
using type = void
using type
using type = void
using type
using type = void
using type = aligned_address<A>
using type = inverted
using type = shifted<S>
using type = void
using type = W
using type = Type
using type = lib::detail::resolve_field_type<Field, T>
template<usize Bits>
using lib::uint_c = exact_uint<Bits>
using value_record = record<T, Numbering, FieldOrExts...>
using value_type = detail::optimal_uint_t<Bits>
using value_type = record<T, Numbering, Fs...>
using value_type = record<T, Numbering, Fs...>
using value_type = record<T, Numbering, Fs...>
using value_type = typename exact_uint<Bits>::value_type
using lib::access::w0c = attr::w0c
using lib::access::w1c = attr::w1c
using lib::access::w1s = attr::w1s
using lib::access::w1t = attr::w1t
using lib::access::wac = attr::wac
using lib::access::wo = attr::wo
using lib::access::woo = attr::woo
Absolute byte anchors.
template<usize N>
using lib::at_byte = addr<N>
template<usize N>
using lib::at_halfword = addr<N * 2>
template<usize N>
using lib::at_word = addr<N * 4>
template<usize N>
using lib::at_dword = addr<N * 8>
template<usize N>
using lib::at_qword = addr<N * 16>
Prefab field aliases (generic over locator; variadic extra attrs).
template<fixed_string N, class L, class T = void, class... Extra>
using lib::rw = field<N, L, T, attr::rw, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::ro = field<N, L, T, attr::ro, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::wo = field<N, L, T, attr::wo, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w1c = field<N, L, T, attr::w1c, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w1s = field<N, L, T, attr::w1s, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w1t = field<N, L, T, attr::w1t, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w0c = field<N, L, T, attr::w0c, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::rc = field<N, L, T, attr::rc, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::rz = field<N, L, T, attr::rz, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::raz = field<N, L, T, attr::raz, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::rao = field<N, L, T, attr::rao, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::wac = field<N, L, T, attr::wac, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::woo = field<N, L, T, attr::woo, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::overlay_rw = field<N, L, T, attr::rw, attr::overlay, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::overlay_ro = field<N, L, T, attr::ro, attr::overlay, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::overlay_wo = field<N, L, T, attr::wo, attr::overlay, Extra...>
template<fixed_string N, class L, usize Aln, class... Extra>
using lib::aligned_rw = field<N, L, u64, attr::rw, attr::aligned<Aln>, Extra...>
template<fixed_string N, class L, usize Aln, class... Extra>
using lib::aligned_ro = field<N, L, u64, attr::ro, attr::aligned<Aln>, Extra...>
template<fixed_string N, class L, usize Aln, class... Extra>
using lib::aligned_wo = field<N, L, u64, attr::wo, attr::aligned<Aln>, Extra...>
Locator shorthands.
template<usize A, usize B = A>
using lib::bits = bit_slice<A, B>
template<usize S, usize E>
using lib::bytes = byte_span<S, E>

Functions

template<class Field, class Numbering, class BitFieldT>
constexpr auto lib::detail::apply_default (BitFieldT &bits) noexcept -> void
template<fixed_string Path>
auto atomic_bit_clear (std::memory_order order=std::memory_order_seq_cst) const noexcept -> void
template<fixed_string Path>
auto atomic_bit_set (std::memory_order order=std::memory_order_seq_cst) const noexcept -> void
template<fixed_string Path>
auto atomic_bit_toggle (std::memory_order order=std::memory_order_seq_cst) const noexcept -> void
auto atomic_compare_exchange (value_record &expected, value_record desired, std::memory_order success=std::memory_order_seq_cst, std::memory_order failure=std::memory_order_seq_cst) const noexcept -> bool
auto atomic_load (std::memory_order order=std::memory_order_seq_cst) const noexcept -> value_record
template<fixed_string Path, class ValT>
auto atomic_set (ValT &&val, std::memory_order order=std::memory_order_seq_cst) const noexcept -> void
auto atomic_store (value_record val, std::memory_order order=std::memory_order_seq_cst) const noexcept -> void
constexpr bit_field (T v) noexcept
constexpr bit_ref (T &storage, usize shift) noexcept
static constexpr auto bit_shift (usize, usize n) noexcept -> usize
static constexpr auto bit_shift (usize total_bits, usize n) noexcept -> usize
constexpr bitfield_ref (const void *ptr) noexcept
constexpr bitfield_ref (T &storage) noexcept
constexpr bitfield_ref (void *ptr) noexcept
static constexpr auto bitmask (usize count) noexcept -> value_type
static constexpr auto bitmask (usize count) noexcept -> u64
static constexpr auto bitmask (usize count) noexcept -> T
constexpr auto bits () const noexcept -> const bit_field< T, Numbering > &
constexpr auto bits () noexcept -> bit_field< T, Numbering > &
constexpr auto bits () const noexcept -> const bitfield_ref< T, Numbering > &
constexpr auto bits () noexcept -> bitfield_ref< T, Numbering > &
constexpr byte_bit_ref (u8 *data, usize bit_idx) noexcept
constexpr auto clear (usize bit) noexcept -> bit_field &
constexpr auto clear (usize bit) noexcept -> bitfield_ref &
template<class Field, class Numbering, class BitFieldT, class RawT>
constexpr auto lib::detail::commit_raw (BitFieldT &bits, RawT raw_val) noexcept -> void
 Commit a raw value into a record field's slices (no access policy).
constexpr exact_uint (value_type v) noexcept
template<usize A, usize B, class Transformer = void>
constexpr auto extract () const noexcept
template<usize A, usize B, class Transformer = void>
constexpr auto extract () const noexcept
template<usize A, usize B, usize Alignment>
constexpr auto extract_aligned () const noexcept -> u64
template<usize A, usize B, usize Alignment>
constexpr auto extract_aligned () const noexcept -> u64
template<unsigned_word OutT, class Numbering, usize TotalBits>
constexpr auto lib::detail::extract_slice_from_bytes (const u8 *data, usize a, usize b) noexcept -> OutT
template<class T>
consteval auto lib::detail::field_type_fits (usize width) noexcept -> bool
constexpr auto flip (usize bit) noexcept -> bit_field &
constexpr auto flip () noexcept -> bit_ref &
constexpr auto flip () noexcept -> byte_bit_ref &
template<usize = 0>
static constexpr auto from_bits (u64 raw_bits) noexcept -> u64
template<usize Width = 0>
static constexpr auto from_bits (auto raw_bits) noexcept
template<usize = 0>
static constexpr auto from_bits (auto raw_bits) noexcept
template<fixed_string Path>
constexpr auto get () const noexcept
template<usize I>
constexpr auto get () const noexcept
template<fixed_string Path>
constexpr auto get () const noexcept
template<usize I>
constexpr auto get () noexcept
template<fixed_string Path>
constexpr auto get () noexcept
template<usize I>
constexpr auto get () const noexcept
template<fixed_string Path>
constexpr auto get () const noexcept
template<usize I>
constexpr auto get () noexcept
template<fixed_string Path>
constexpr auto get () noexcept
template<class Numbering, usize TotalBits>
constexpr auto lib::detail::get_bit_from_bytes (const u8 *data, usize bit_idx) noexcept -> bool
template<fixed_string Name>
static consteval auto index_of () noexcept -> usize
template<usize A, usize B, class Transformer = void, class ValT>
constexpr auto insert (ValT &&v) noexcept -> bit_field &
template<usize A, usize B, class Transformer = void, class ValT>
constexpr auto insert (ValT &&v) noexcept -> bitfield_ref &
template<usize A, usize B, usize Alignment>
constexpr auto insert_aligned (u64 address) noexcept -> bit_field &
template<usize A, usize B, usize Alignment>
constexpr auto insert_aligned (u64 address) noexcept -> bitfield_ref &
template<unsigned_word InT, class Numbering, usize TotalBits>
constexpr auto lib::detail::insert_slice_to_bytes (u8 *data, usize a, usize b, InT val) noexcept -> void
constexpr auto load () const noexcept -> value_record
template<fixed_string... FieldNames, class... Values>
static constexpr auto make (Values &&... vals) noexcept -> record
constexpr mmio_record_ref (T &storage) noexcept
constexpr mmio_record_ref (volatile void *ptr) noexcept
constexpr auto mmio_ref () noexcept -> mmio_ref_type
constexpr operator bool () const noexcept
constexpr operator bool () const noexcept
constexpr operator T () const noexcept
constexpr operator T () const noexcept
constexpr operator T () const noexcept
constexpr operator T () const noexcept
constexpr operator value_record () const noexcept
constexpr operator value_type () const noexcept
constexpr auto operator&= (bool v) noexcept -> bit_ref &
constexpr auto operator&= (bool v) noexcept -> byte_bit_ref &
constexpr auto operator= (bool v) noexcept -> bit_ref &
constexpr auto operator= (const bit_ref &other) noexcept -> bit_ref &
constexpr auto operator= (bool v) noexcept -> byte_bit_ref &
constexpr auto operator= (const byte_bit_ref &other) noexcept -> byte_bit_ref &
constexpr auto operator[] (this auto &&self, usize bit) noexcept
constexpr auto operator[] (this auto &&self, usize bit) noexcept
template<fixed_string Path>
constexpr auto operator[] (field_tag< Path >) const noexcept
template<fixed_string Path>
constexpr auto operator[] (field_tag< Path >) const noexcept
template<fixed_string Path>
constexpr auto operator[] (field_tag< Path >) noexcept
template<fixed_string Path>
constexpr auto operator[] (field_tag< Path >) const noexcept
template<fixed_string Path>
constexpr auto operator[] (field_tag< Path >) noexcept
constexpr auto operator^= (bool v) noexcept -> bit_ref &
constexpr auto operator^= (bool v) noexcept -> byte_bit_ref &
constexpr auto operator|= (bool v) noexcept -> bit_ref &
constexpr auto operator|= (bool v) noexcept -> byte_bit_ref &
constexpr auto operator~ () const noexcept -> bool
constexpr auto operator~ () const noexcept -> bool
static constexpr auto range_shift_width (usize total_bits, usize a, usize b) noexcept -> std::pair< usize, usize >
static constexpr auto range_shift_width (usize total_bits, usize a, usize b) noexcept -> std::pair< usize, usize >
constexpr auto raw () const noexcept -> const T &
constexpr auto raw () noexcept -> T &
constexpr auto raw () const noexcept -> const T &
constexpr auto raw () noexcept -> T &
template<class Field, class Numbering, class BitFieldT>
constexpr auto lib::detail::read_field (BitFieldT &bits) noexcept
template<class... Bindings>
requires ((requires { Bindings::name; }) && ...)
constexpr record (Bindings &&... bindings) noexcept
constexpr record (T v) noexcept
constexpr record_ref (const void *ptr) noexcept
constexpr record_ref (T &storage) noexcept
constexpr record_ref (void *ptr) noexcept
constexpr auto ref () noexcept -> ref_type
template<unsigned_word T>
constexpr auto lib::detail::safe_bitmask (usize count, usize total_bits) noexcept -> T
constexpr auto set (usize bit, bool v=true) noexcept -> bit_field &
constexpr auto set (usize bit, bool v=true) noexcept -> bitfield_ref &
template<fixed_string Path, class ValueType>
constexpr auto set (ValueType &&v) const noexcept -> void
template<usize I, class ValueType>
constexpr decltype(auto) set (this auto &&self, ValueType &&v) noexcept
template<fixed_string Path, class ValueType>
constexpr decltype(auto) set (this auto &&self, ValueType &&v) noexcept
template<usize I, class ValueType>
constexpr decltype(auto) set (this auto &&self, ValueType &&v) noexcept
template<fixed_string Path, class ValueType>
constexpr decltype(auto) set (this auto &&self, ValueType &&v) noexcept
template<class Numbering, usize TotalBits>
constexpr auto lib::detail::set_bit_in_bytes (u8 *data, usize bit_idx, bool val) noexcept -> void
template<std::signed_integral TargetType, usize Width, unsigned_word InT>
constexpr auto lib::detail::sign_extend (InT val) noexcept -> TargetType
template<usize Count>
consteval auto lib::detail::smallest_uint_for_bits ()
constexpr auto store (T val) const noexcept -> void
constexpr auto store (value_record val) const noexcept -> void
constexpr auto test (usize bit) const noexcept -> bool
constexpr auto test (usize bit) const noexcept -> bool
template<usize = 0>
static constexpr auto to_bits (u64 address) noexcept -> u64
template<usize Width = 0>
static constexpr auto to_bits (auto val) noexcept
template<usize = 0>
static constexpr auto to_bits (auto val) noexcept
template<auto V>
consteval auto lib::detail::to_raw_bits () noexcept -> u64
constexpr auto try_clear (usize bit) noexcept -> std::expected< void, kernel_error >
constexpr auto try_clear (usize bit) noexcept -> std::expected< void, kernel_error >
constexpr auto try_flip (usize bit) noexcept -> std::expected< void, kernel_error >
constexpr auto try_set (usize bit, bool v=true) noexcept -> std::expected< void, kernel_error >
constexpr auto try_set (usize bit, bool v=true) noexcept -> std::expected< void, kernel_error >
constexpr auto try_test (usize bit) const noexcept -> std::expected< bool, kernel_error >
constexpr auto try_test (usize bit) const noexcept -> std::expected< bool, kernel_error >
constexpr auto underlying () const noexcept -> T
constexpr auto underlying () const noexcept -> T
constexpr auto value () const noexcept -> T
constexpr auto value () const noexcept -> T
template<class... Fs>
consteval auto lib::detail::verify_field_overlaps () -> bool
template<class Field, class Numbering, class BitFieldT, class ValT>
constexpr auto lib::detail::write_field (BitFieldT &bits, ValT &&val) noexcept -> void

Variables

static constexpr usize byte_offset = Offset
static constexpr usize byte_offset = ByteOffset
static constexpr usize byte_size = sizeof(value_type)
static constexpr usize byte_size = N
static constexpr usize byte_size = sizeof(T)
static constexpr usize count = Count
static constexpr usize count = sizeof...(Fs)
static constexpr usize end = End
static constexpr usize end = End
static constexpr usize end = EndBit
static constexpr usize end_byte = ByteOffset + (max_bit >> 3) + 1
 Exclusive end byte offset physically touched by this window.
static constexpr usize extent = traits::total_bits
static constexpr usize extent = traits::total_bits
static constexpr usize extent = storage_traits<T>::total_bits
static constexpr usize extent = storage_traits<T>::total_bits
static constexpr usize extent = storage_traits<T>::total_bits
static constexpr usize field_count = std::tuple_size_v<FieldTuple>
static constexpr usize field_count = std::tuple_size_v<FieldTuple>
static constexpr u64 fixed_value = detail::raw_tag_bits<fixed_tag>::value
static constexpr bool has_fixed = !std::is_same_v<fixed_tag, detail::none_token>
static constexpr bool has_init = !std::is_same_v<init_tag, detail::none_token>
static constexpr bool has_tail = (split_pos != static_cast<usize>(-1))
static constexpr auto head
static constexpr u64 init_value = detail::raw_tag_bits<init_tag>::value
template<class T>
constexpr bool lib::detail::is_access_v
template<class T>
constexpr bool lib::detail::is_endian_v = is_one_of_v<T, attr::endian_big, attr::endian_little>
template<class T>
constexpr bool lib::is_exact_uint_v = is_exact_uint<std::remove_cvref_t<T> >::value
template<class T>
constexpr bool lib::detail::is_fixed_v = is_fixed_tag<T>::value
template<class T>
constexpr bool lib::detail::is_init_v = is_init_tag<T>::value
template<class T, class... Ts>
constexpr bool lib::detail::is_one_of_v = (std::is_same_v<T, Ts> || ...)
static constexpr bool is_overlay = (detail::is_overlay_v<Attr> || ...)
template<class T>
constexpr bool lib::detail::is_overlay_v = std::is_same_v<T, attr::overlay>
static constexpr bool is_scalar = true
static constexpr bool is_scalar = false
static constexpr bool is_scalar = true
template<class T>
constexpr bool lib::detail::is_transform_v = is_transform_tag<T>::value
static constexpr bool is_unaligned = (detail::is_unaligned_v<Attr> || ...)
template<class T>
constexpr bool lib::detail::is_unaligned_v = std::is_same_v<T, attr::unaligned>
template<class T>
constexpr bool lib::detail::is_word_v = is_word_tag<T>::value
constexpr lsb0_t lib::lsb0 {}
static constexpr usize max_bit = (Start <= End) ? End : Start
static constexpr usize max_bit = fold_max_bit<slices>::value
static constexpr usize max_bit = (StartBit <= EndBit) ? EndBit : StartBit
static constexpr usize max_byte = (Start <= End) ? End : Start
static constexpr usize min_bit = (Start <= End) ? Start : End
static constexpr usize min_bit = fold_min_bit<slices>::value
static constexpr usize min_bit = (StartBit <= EndBit) ? StartBit : EndBit
static constexpr usize min_byte = (Start <= End) ? Start : End
constexpr msb0_t lib::msb0 {}
static constexpr auto name = Name
static constexpr std::array< std::string_view, count > names
static constexpr usize shift = std::countr_zero(Alignment)
static constexpr usize size = max_byte - min_byte + 1
static constexpr usize split_pos
static constexpr usize start = Start
static constexpr usize start = Start
static constexpr usize start = StartBit
static constexpr usize stride = Stride
static constexpr auto tail
static constexpr usize total_bits = storage_traits<T>::total_bits
static constexpr usize total_bits = storage_traits<T>::total_bits
static constexpr usize total_bits = storage_traits<T>::total_bits
static constexpr usize total_bits = Bits
static constexpr usize total_bits = N * 8
static constexpr usize total_bits = sizeof(T) * 8
static constexpr usize total_width = fold_total_width<slices>::value
static constexpr bool valid = detail::verify_field_overlaps<Fs...>()
static constexpr auto value = V
static constexpr auto value = V
static constexpr usize value = 0
static constexpr usize value = std::max({Ss::max_bit...})
static constexpr usize value = 0
static constexpr usize value = std::min({Ss::min_bit...})
static constexpr usize value = 0
static constexpr usize value = (Ss::width + ...)
static constexpr u64 value = 0
static constexpr u64 value = to_raw_bits<V>()
static constexpr u64 value = to_raw_bits<V>()
value_type value {}
static constexpr usize width = max_bit - min_bit + 1
static constexpr usize width = Bits
static constexpr usize width = max_bit - min_bit + 1

Absolute byte anchors.

template<usize N>
using lib::at_byte = addr<N>
template<usize N>
using lib::at_halfword = addr<N * 2>
template<usize N>
using lib::at_word = addr<N * 4>
template<usize N>
using lib::at_dword = addr<N * 8>
template<usize N>
using lib::at_qword = addr<N * 16>

Prefab field aliases (generic over locator; variadic extra attrs).

template<fixed_string N, class L, class T = void, class... Extra>
using lib::rw = field<N, L, T, attr::rw, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::ro = field<N, L, T, attr::ro, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::wo = field<N, L, T, attr::wo, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w1c = field<N, L, T, attr::w1c, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w1s = field<N, L, T, attr::w1s, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w1t = field<N, L, T, attr::w1t, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::w0c = field<N, L, T, attr::w0c, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::rc = field<N, L, T, attr::rc, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::rz = field<N, L, T, attr::rz, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::raz = field<N, L, T, attr::raz, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::rao = field<N, L, T, attr::rao, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::wac = field<N, L, T, attr::wac, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::woo = field<N, L, T, attr::woo, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::overlay_rw = field<N, L, T, attr::rw, attr::overlay, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::overlay_ro = field<N, L, T, attr::ro, attr::overlay, Extra...>
template<fixed_string N, class L, class T = void, class... Extra>
using lib::overlay_wo = field<N, L, T, attr::wo, attr::overlay, Extra...>
template<fixed_string N, class L, usize Aln, class... Extra>
using lib::aligned_rw = field<N, L, u64, attr::rw, attr::aligned<Aln>, Extra...>
template<fixed_string N, class L, usize Aln, class... Extra>
using lib::aligned_ro = field<N, L, u64, attr::ro, attr::aligned<Aln>, Extra...>
template<fixed_string N, class L, usize Aln, class... Extra>
using lib::aligned_wo = field<N, L, u64, attr::wo, attr::aligned<Aln>, Extra...>

Locator shorthands.

template<usize A, usize B = A>
using lib::bits = bit_slice<A, B>
template<usize S, usize E>
using lib::bytes = byte_span<S, E>

Files

file  lib/bitfield.cxxm
 C++26 unified field descriptor.