Skip to main content

ClikaRT::dtype::int4_t

struct

Header: ClikaRT/compute/scalar_types.h

Signed 4-bit integer, range [-8, 7]. Low nibble of a byte.

Static member functions

from_bits()

static constexpr int4_t from_bits(std::uint8_t b) noexcept

Reinterpret the low 4 bits of b without conversion.

Declared in ClikaRT/compute/scalar_types.h, line 407

Member functions

int4_t()

constexpr constexpr int4_t() noexcept=default

Declared in ClikaRT/compute/scalar_types.h, line 404

int4_t(int8_t)

constexpr explicit constexpr int4_t(std::int8_t v) noexcept

Wrap an 8-bit value: keeps the low 4 bits (wraps; no saturation or range check).

Declared in ClikaRT/compute/scalar_types.h, line 405

operator std::int8_t()

constexpr constexpr operator std::int8_t() const noexcept

Declared in ClikaRT/compute/scalar_types.h, line 406

Data members

bits

std::uint8_t bits = 0

Raw encoding in the low 4 bits (the storage/ABI form).

Declared in ClikaRT/compute/scalar_types.h, line 403

Friends

operator==

friend bool operator==(int4_t a, int4_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 408

operator!=

friend bool operator!=(int4_t a, int4_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 409

operator<

friend bool operator<(int4_t a, int4_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 410

operator<=

friend bool operator<=(int4_t a, int4_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 411

operator>

friend bool operator>(int4_t a, int4_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 412

operator>=

friend bool operator>=(int4_t a, int4_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 413