native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
native::bf16 Struct Referenceexport

Public Types

using underlying_type = __bf16
 Native half storage when supported by the target; otherwise sixteen raw bits.

Public Member Functions

constexpr bf16 () noexcept=default
 Default-initialize storage without setting its bits; value-initialization zeroes it.
constexpr bf16 (float f) noexcept
 Round a binary32 value to this format, ties to even.
constexpr bf16 (__bf16 f) noexcept
 Copy native storage without a numerical conversion.
constexpr bf16 (bf16 const &) noexcept=default
 Copy the native sixteen-bit representation.
constexpr bf16 (bf16 &&) noexcept=default
 Copy the native representation; the source retains its bits.
constexpr operator __bf16 (this bf16 self) noexcept
 Return native storage without rounding or normalizing NaN payloads.
constexpr operator float (this bf16 self) noexcept
 Decode to binary32; finite values are exact and signaling NaNs are quieted.
constexpr bf16 & operator= (bf16 const &) noexcept=default
 Copy the native representation, replacing all previous bits.
constexpr bf16 & operator= (bf16 &&) noexcept=default
 Copy the native representation, leaving the source unchanged.
constexpr uint16_t to_bits (this bf16 self) noexcept
 Return the exact sixteen representation bits.

Static Public Member Functions

static constexpr bf16 from_bits (uint16_t data) noexcept
 Adopt the exact sixteen representation bits without normalization.

Public Attributes

underlying_type content
 Target-dependent storage. Use to_bits()/from_bits() for portable representation access.

Friends

constexpr bool operator== (bf16 x, bf16 y) noexcept
 Compare decoded values for equality; signed zeros compare equal and NaNs do not.
constexpr std::partial_ordering operator<=> (bf16 x, bf16 y) noexcept
 Compare decoded values; NaNs are unordered and signed zeros equivalent.
constexpr bool operator!= (bf16 x, bf16 y) noexcept
 Compare decoded values for inequality; a NaN operand makes the result true.
constexpr bool operator< (bf16 x, bf16 y) noexcept
 Return whether the decoded left value is less; false for NaN operands.
constexpr bool operator> (bf16 x, bf16 y) noexcept
 Return whether the decoded left value is greater; false for NaN operands.
constexpr bool operator<= (bf16 x, bf16 y) noexcept
 Return whether the decoded left value is at most the right; false for NaN operands.
constexpr bool operator>= (bf16 x, bf16 y) noexcept
 Return whether the decoded left value is at least the right; false for NaN operands.
constexpr void swap (bf16 &x, bf16 &y) noexcept
 Exchange native representations, including signed zeros and NaN payloads.

Detailed Description

Two-byte bfloat16 storage with environment-independent binary32 ties-to-even conversion. Native-bfloat interoperability is available only where the target supports it. Native import and bit factories preserve representation. No arithmetic or FTZ policy is attached to the storage type.

Definition at line 300 of file native.numerics.ccm.


The documentation for this struct was generated from the following file: