ZXFoundation™ 26h2
Loading...
Searching...
No Matches
bit.cxxm File Reference
module lib.bit

Kernel-specific bit helpers layered on top of <bit>. More...

import std;
import zxfoundation.base.types;
Include dependency graph for bit.cxxm:

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
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

Detailed Description

Kernel-specific bit helpers layered on top of <bit>.

SPDX-License-Identifier: Apache 2.0