4#ifndef GREM_CORE_FUNDAMENTALS_HPP
5#define GREM_CORE_FUNDAMENTALS_HPP
28 static constexpr T
MIN = std::numeric_limits<T>::lowest();
29 static constexpr T
MAX = std::numeric_limits<T>::max();
32template <
floating_po
int T>
34 static constexpr bool IS_IEC60559 = std::numeric_limits<T>::is_iec559;
35 static constexpr T
MIN = std::numeric_limits<T>::lowest();
36 static constexpr T
MAX = std::numeric_limits<T>::max();
40 static constexpr T
INF = std::numeric_limits<T>::infinity();
41 static constexpr T
QUIET_NAN = std::numeric_limits<T>::quiet_NaN();
51using std::max_align_t;
60using ssize_t = std::make_signed_t<size_t>;
71 alignas(T)
byte bytes[
sizeof(T)];
78static_assert(
sizeof(
bool8_t) == 1);
91 : value(static_cast<uint16_t>(value)) {}
94 return static_cast<bool>(value);
114 : value(static_cast<uint16_t>(value)) {}
117 return static_cast<bool>(value);
137 : value(static_cast<uint16_t>(value)) {}
140 return static_cast<bool>(value);
161 uint16_t _private_value{};
166 : _private_value(getFloat16IntegerRepresentationFromFloat32(value)) {}
168 constexpr operator float() const noexcept {
169 static_assert(std::numeric_limits<float32_t>::is_iec559);
171 constexpr uint32_t F32_EXPONENT_BIAS = 127;
172 constexpr uint32_t F16_EXPONENT_BIAS = 15;
174 const uint16_t integerRepresentation = _private_value;
176 const uint32_t signMask =
static_cast<uint32_t
>(integerRepresentation & 0b1'00000'0000000000) << 16;
177 uint32_t f16BiasedExponent =
static_cast<uint32_t
>(integerRepresentation & 0b0'11111'0000000000) >> 10;
178 uint32_t mantissa =
static_cast<uint32_t
>(integerRepresentation & 0b0'00000'1111111111);
181 if (f16BiasedExponent == 31) {
184 return bit_cast<float32_t>(
static_cast<uint32_t
>(signMask | 0b0'11111111'00000000000000000000000));
187 return bit_cast<float32_t>(
static_cast<uint32_t
>(signMask | 0b0'11111111'00000000000000000000000 | (mantissa << 13)));
190 if (f16BiasedExponent == 0) {
192 return bit_cast<float32_t>(
static_cast<uint32_t
>(signMask));
196 while (!(mantissa & 0b0'00001'0000000000)) {
201 mantissa &= 0b1111111111111111'1'11110'1111111111;
205 const uint32_t f32BiasedExponent = f16BiasedExponent + (F32_EXPONENT_BIAS - F16_EXPONENT_BIAS);
206 return bit_cast<float32_t>(
static_cast<uint32_t
>(signMask | (f32BiasedExponent << 23) | (mantissa << 13)));
210 return static_cast<float>(*this) ==
static_cast<float>(other);
214 return static_cast<float>(*this) == other;
218 return static_cast<float>(*this) <=>
static_cast<float>(other);
222 return static_cast<float>(*this) <=> other;
228 [[nodiscard]]
static constexpr uint16_t getFloat16IntegerRepresentationFromFloat32(
float32_t value)
noexcept {
229 static_assert(std::numeric_limits<float32_t>::is_iec559);
231 constexpr uint32_t F32_EXPONENT_BIAS = 127;
232 constexpr uint32_t F16_EXPONENT_BIAS = 15;
233 constexpr uint32_t F32_BIASED_EXPONENT_MAX = 255;
235 const uint32_t integerRepresentation = bit_cast<uint32_t>(value);
237 const uint16_t signMask =
static_cast<uint16_t
>((integerRepresentation & 0b1'00000000'00000000000000000000000) >> 16);
238 const uint32_t f32BiasedExponent =
static_cast<uint32_t
>((integerRepresentation & 0b0'11111111'00000000000000000000000) >> 23);
239 int32_t mantissa =
static_cast< int32_t
>((integerRepresentation & 0b0'00000000'11111111111111111111111) );
242 if (f32BiasedExponent == F32_BIASED_EXPONENT_MAX) {
245 return static_cast<uint16_t
>(signMask | 0b0'11111'0000000000);
249 return static_cast<uint16_t
>(signMask | 0b0'11111'0000000000 | mantissa | (mantissa == 0));
252 int32_t f16BiasedExponent =
static_cast<int32_t
>(f32BiasedExponent) -
static_cast<int32_t
>(F32_EXPONENT_BIAS - F16_EXPONENT_BIAS);
253 if (f16BiasedExponent <= 0) {
254 if (f16BiasedExponent < -10) {
256 return static_cast<uint16_t
>(signMask);
260 mantissa |= 0b0'00000001'00000000000000000000000;
261 const int32_t shift = 1 - f16BiasedExponent + 13;
262 mantissa = (mantissa + ((1 << (shift - 1)) - 1) + ((mantissa >> shift) & 1)) >> shift;
263 return static_cast<uint16_t
>(signMask | mantissa);
267 mantissa += 0b0'00011'1111111111 + ((mantissa >> 13) & 1);
269 if ((mantissa & 0b0'00000001'00000000000000000000000) != 0) {
275 if (f16BiasedExponent > 30) {
277 return static_cast<uint16_t
>(signMask | 0b0'11111'0000000000);
281 return static_cast<uint16_t
>(signMask | (f16BiasedExponent << 10) | (mantissa >> 13));
285 : _private_value(value) {}
296static_assert(
static_cast<float32_t>(
static_cast<float16_t>(std::numeric_limits<float32_t>::infinity())) == std::numeric_limits<float32_t>::infinity());
297static_assert(
static_cast<float32_t>(
static_cast<float16_t>(-std::numeric_limits<float32_t>::infinity())) == -std::numeric_limits<float32_t>::infinity());
298static_assert(
static_cast<float32_t>(
static_cast<float16_t>(std::numeric_limits<float32_t>::quiet_NaN())) !=
299 static_cast<float32_t>(
static_cast<float16_t>(std::numeric_limits<float32_t>::quiet_NaN())));
320struct NormalizedInteger {
326 : _private_value(encode(value)) {}
328 constexpr operator float() const noexcept {
329 return decode(_private_value);
332 [[nodiscard]]
GREM_ALWAYS_INLINE constexpr bool operator==(
const NormalizedInteger& other)
const noexcept {
333 return _private_value == other._private_value;
336 [[nodiscard]]
GREM_ALWAYS_INLINE constexpr bool operator==(
float other)
const noexcept {
337 return static_cast<float>(*this) == other;
340 [[nodiscard]]
GREM_ALWAYS_INLINE constexpr std::strong_ordering operator<=>(
const NormalizedInteger& other)
const noexcept {
341 return _private_value <=> other._private_value;
344 [[nodiscard]]
GREM_ALWAYS_INLINE constexpr std::partial_ordering operator<=>(
float other)
const noexcept {
345 return static_cast<float>(*this) <=> other;
349 friend Limits<NormalizedInteger<T>>;
351 [[nodiscard]]
static constexpr T encode(
float value)
noexcept {
352 if constexpr (signed_integral<T>) {
353 value = (value < -1.0f) ? -1.0f : (1.0f < value) ? 1.0f : value;
354 return static_cast<T>((value < 0.0f) ? value *
static_cast<float>(
Limits<T>::MAX) - 0.5f : value *
static_cast<float>(
Limits<T>::MAX) + 0.5f);
356 value = (value < 0.0f) ? 0.0f : (1.0f < value) ? 1.0f : value;
357 return static_cast<T>(value *
static_cast<float>(
Limits<T>::MAX) + 0.5f);
361 [[nodiscard]]
static constexpr float decode(T value)
noexcept {
362 if constexpr (signed_integral<T>) {
363 const float result =
static_cast<float>(value) /
static_cast<float>(
Limits<T>::MAX);
364 return (result < -1.0f) ? -1.0f : result;
366 return static_cast<float>(value) /
static_cast<float>(
Limits<T>::MAX);
371 : _private_value(value) {}
376using i8norm = detail::NormalizedInteger<int8_t>;
377using u8norm = detail::NormalizedInteger<uint8_t>;
378using i16norm = detail::NormalizedInteger<int16_t>;
379using u16norm = detail::NormalizedInteger<uint16_t>;
382struct Limits<detail::NormalizedInteger<T>> {
394template <strict_
integral T>
396 static_assert(
sizeof(T) <= 8);
397 if constexpr (
sizeof(T) == 1) {
398 uint8_t x = bit_cast<uint8_t>(value);
399 x =
static_cast<uint8_t
>(((x & 0x55) << 1) | ((x & 0xAA) >> 1));
400 x =
static_cast<uint8_t
>(((x & 0x33) << 2) | ((x & 0xCC) >> 2));
401 x =
static_cast<uint8_t
>(((x & 0x0F) << 4) | ((x & 0xF0) >> 4));
402 return bit_cast<T>(x);
403 }
else if constexpr (
sizeof(T) == 2) {
404 uint16_t x = bit_cast<uint16_t>(value);
405 x =
static_cast<uint16_t
>(((x & 0x5555) << 1) | ((x & 0xAAAA) >> 1));
406 x =
static_cast<uint16_t
>(((x & 0x3333) << 2) | ((x & 0xCCCC) >> 2));
407 x =
static_cast<uint16_t
>(((x & 0x0F0F) << 4) | ((x & 0xF0F0) >> 4));
408 x =
static_cast<uint16_t
>(((x & 0x00FF) << 8) | ((x & 0xFF00) >> 8));
409 return bit_cast<T>(x);
410 }
else if constexpr (
sizeof(T) == 4) {
411 uint32_t x = bit_cast<uint32_t>(value);
412 x = ((x & 0x55555555) << 1) | ((x & 0xAAAAAAAA) >> 1);
413 x = ((x & 0x33333333) << 2) | ((x & 0xCCCCCCCC) >> 2);
414 x = ((x & 0x0F0F0F0F) << 4) | ((x & 0xF0F0F0F0) >> 4);
415 x = ((x & 0x00FF00FF) << 8) | ((x & 0xFF00FF00) >> 8);
416 x = ((x & 0x0000FFFF) << 16) | ((x & 0xFFFF0000) >> 16);
417 return bit_cast<T>(x);
418 }
else if constexpr (
sizeof(T) == 8) {
419 uint64_t x = bit_cast<uint64_t>(value);
420 x = ((x & 0x5555555555555555ull) << 1) | ((x & 0xAAAAAAAAAAAAAAAAull) >> 1);
421 x = ((x & 0x3333333333333333ull) << 2) | ((x & 0xCCCCCCCCCCCCCCCCull) >> 2);
422 x = ((x & 0x0F0F0F0F0F0F0F0Full) << 4) | ((x & 0xF0F0F0F0F0F0F0F0ull) >> 4);
423 x = ((x & 0x00FF00FF00FF00FFull) << 8) | ((x & 0xFF00FF00FF00FF00ull) >> 8);
424 x = ((x & 0x0000FFFF0000FFFFull) << 16) | ((x & 0xFFFF0000FFFF0000ull) >> 16);
425 x = ((x & 0x00000000FFFFFFFFull) << 32) | ((x & 0xFFFFFFFF00000000ull) >> 32);
426 return bit_cast<T>(x);
442 uint16_t x = bit_cast<uint16_t>(value);
443 x =
static_cast<uint16_t
>(((x & 0x00FF) << 8) | ((x & 0xFF00) >> 8));
444 return bit_cast<T>(x);
446 uint32_t x = bit_cast<uint32_t>(value);
447 x = ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24);
448 return bit_cast<T>(x);
450 uint64_t x = bit_cast<uint64_t>(value);
451 x = (x & 0x00000000FFFFFFFFull) << 32 | (x & 0xFFFFFFFF00000000ull) >> 32;
452 x = (x & 0x0000FFFF0000FFFFull) << 16 | (x & 0xFFFF0000FFFF0000ull) >> 16;
453 x = (x & 0x00FF00FF00FF00FFull) << 8 | (x & 0xFF00FF00FF00FF00ull) >> 8;
454 return bit_cast<T>(x);
458 for (
size_t i = 0; i <
sizeof(T); ++i) {
459 reversed.bytes[i] = raw.
bytes[
sizeof(T) - 1 - i];
461 return bit_cast<T>(reversed);
558template <strict_arithmetic T>
561 return (a + b) * T{0.5};
563 using U = std::make_unsigned_t<T>;
565 U minValue =
static_cast<U
>(a);
566 U maxValue =
static_cast<U
>(b);
569 minValue =
static_cast<U
>(b);
570 maxValue =
static_cast<U
>(a);
572 return static_cast<T
>(a +
sign *
static_cast<T
>(
static_cast<U
>(maxValue - minValue) / 2));
584template <
typename A,
typename B>
585[[nodiscard]]
GREM_ALWAYS_INLINE constexpr decltype(
auto)
min(A&& a, B&& b)
requires(
requires(A x, B y) { x < y; }) {
586 return (b < a) ? std::forward<B>(b) : std::forward<A>(a);
597template <
typename A,
typename B>
598[[nodiscard]]
GREM_ALWAYS_INLINE constexpr decltype(
auto)
max(A&& a, B&& b)
requires(
requires(A x, B y) { x < y; }) {
599 return (a < b) ? std::forward<B>(b) : std::forward<A>(a);
611template <
typename A,
typename B>
613 using T = std::common_type_t<A, B>;
614 return (b < a) ?
Pair<T>(std::forward<B>(b), std::forward<A>(a)) :
Pair<T>(std::forward<A>(a), std::forward<B>(b));
629template <
typename T,
typename Low,
typename High>
631 requires(
requires(T v, Low l) { v < l; } &&
requires(T v, High h) { h < v; }) {
633 return (value < minValue) ? std::forward<Low>(minValue) : (maxValue < value) ? std::forward<High>(maxValue) : std::forward<
T>(value);
644template <strict_
unsigned_
integral Un
signedInteger>
646 return std::rotl(value, shift);
657template <strict_
unsigned_
integral Un
signedInteger>
659 return std::rotr(value, shift);
669template <strict_
unsigned_
integral Un
signedInteger>
671 return std::popcount(value);
681template <strict_
unsigned_
integral Un
signedInteger>
695template <strict_
unsigned_
integral Un
signedInteger>
697 return std::countl_zero(value);
709template <strict_
unsigned_
integral Un
signedInteger>
711 return std::countl_one(value);
723template <strict_
unsigned_
integral Un
signedInteger>
725 return std::countr_zero(value);
737template <strict_
unsigned_
integral Un
signedInteger>
739 return std::countr_one(value);
749template <strict_
unsigned_
integral Un
signedInteger>
751 return std::bit_width(value);
764template <strict_
unsigned_
integral Un
signedInteger>
780template <strict_
unsigned_
integral Un
signedInteger>
782 return std::has_single_bit(value);
793template <strict_
unsigned_
integral Un
signedInteger>
795 const int bits =
static_cast<int>(
sizeof(UnsignedInteger) *
BYTE_BITS);
796 const int shift = bits -
countLeadingZeroBits(
static_cast<UnsignedInteger
>(value - UnsignedInteger{1}));
797 return (shift >= bits) ? 0 : UnsignedInteger{1} << shift;
808template <strict_
unsigned_
integral Un
signedInteger>
821template <strict_
unsigned_
integral Un
signedInteger>
823 const UnsignedInteger remainder = value % n;
824 const UnsignedInteger correction = (remainder == 0) ? 0 : n - remainder;
825 return value + correction;
#define GREM_ASSERT(expression)
Definition assertions.hpp:77
#define GREM_ALWAYS_INLINE
Definition attributes.hpp:10
Definition fundamentals.hpp:86
GREM_ALWAYS_INLINE bool16_t() noexcept=default
Definition fundamentals.hpp:109
GREM_ALWAYS_INLINE bool32_t() noexcept=default
Definition fundamentals.hpp:132
GREM_ALWAYS_INLINE bool64_t() noexcept=default
Definition concepts.hpp:85
Definition concepts.hpp:35
@ T
't'
Definition keyboard.hpp:90
GREM_ALWAYS_INLINE constexpr T midpoint(T a, T b)
Get the midpoint between two values.
Definition fundamentals.hpp:559
constexpr bool64_t true64
Definition fundamentals.hpp:147
GREM_ALWAYS_INLINE constexpr T getBitReversed(T value)
Get a copy of an integer with its bit order reversed.
Definition fundamentals.hpp:395
constexpr bool16_t true16
Definition fundamentals.hpp:101
detail::NormalizedInteger< int16_t > i16norm
Definition fundamentals.hpp:378
GREM_ALWAYS_INLINE constexpr int countLeadingOneBits(UnsignedInteger value) noexcept
Get the number of consecutive 1 bits starting at the most significant (leftmost) bit of a given value...
Definition fundamentals.hpp:710
constexpr bool HOST_IS_LITTLE_ENDIAN
Whether the host system's native byte order is little-endian or not.
Definition fundamentals.hpp:468
GREM_ALWAYS_INLINE constexpr int getRequiredBitCount(UnsignedInteger value) noexcept
Get the minimum number of bits required to represent a given value.
Definition fundamentals.hpp:750
GREM_ALWAYS_INLINE constexpr auto minmax(A &&a, B &&b)
Get the smaller and greater of two values.
Definition fundamentals.hpp:612
GREM_ALWAYS_INLINE constexpr T convertHostEndianToLittleEndian(T value)
Convert a value in host-endian byte order to the corresponding value in little-endian byte order.
Definition fundamentals.hpp:505
GREM_ALWAYS_INLINE constexpr T convertHostEndianToBigEndian(T value)
Convert a value in host-endian byte order to the corresponding value in big-endian byte order.
Definition fundamentals.hpp:486
GREM_ALWAYS_INLINE constexpr decltype(auto) clamp(T &&value, Low &&minValue, High &&maxValue)
Clamp a value to a specific interval.
Definition fundamentals.hpp:630
std::make_signed_t< size_t > ssize_t
Definition fundamentals.hpp:60
GREM_ALWAYS_INLINE constexpr UnsignedInteger rotateBitsRight(UnsignedInteger value, int shift) noexcept
Get the result of bitwise right-rotating a value by a number of bits.
Definition fundamentals.hpp:658
float float32_t
Definition fundamentals.hpp:155
constexpr bool64_t false64
Definition fundamentals.hpp:146
GREM_ALWAYS_INLINE constexpr T convertBigEndianToHostEndian(T value)
Convert a value in big-endian byte order to the corresponding value in host-endian byte order.
Definition fundamentals.hpp:523
@ false8
Definition fundamentals.hpp:77
@ true8
Definition fundamentals.hpp:77
GREM_ALWAYS_INLINE constexpr bool isPowerOf2(UnsignedInteger value) noexcept
Check if a given integer is a power of 2, i.e. if the number appears in the infinite sequence 2^0,...
Definition fundamentals.hpp:781
double float64_t
Definition fundamentals.hpp:157
constexpr bool32_t true32
Definition fundamentals.hpp:124
constexpr bool16_t false16
Definition fundamentals.hpp:100
GREM_ALWAYS_INLINE constexpr int countLeadingZeroBits(UnsignedInteger value) noexcept
Get the number of consecutive 0 bits starting at the most significant (leftmost) bit of a given value...
Definition fundamentals.hpp:696
detail::NormalizedInteger< uint8_t > u8norm
Definition fundamentals.hpp:377
detail::NormalizedInteger< uint16_t > u16norm
Definition fundamentals.hpp:379
constexpr bool HOST_IS_BIG_ENDIAN
Whether the host system's native byte order is big-endian or not.
Definition fundamentals.hpp:473
GREM_ALWAYS_INLINE constexpr UnsignedInteger roundUpToMultiple(UnsignedInteger value, UnsignedInteger n)
Get the smallest multiple of n that is not greater than a given value.
Definition fundamentals.hpp:822
detail::NormalizedInteger< int8_t > i8norm
Definition fundamentals.hpp:376
GREM_ALWAYS_INLINE constexpr UnsignedInteger roundDownToPowerOf2(UnsignedInteger value) noexcept
Get the largest integral power of 2 that is not greater than a given value.
Definition fundamentals.hpp:809
GREM_ALWAYS_INLINE constexpr UnsignedInteger getMaxValueForBits(size_t bits) noexcept
Get the maximum value that can be represented in a given unsigned integer type using a given number o...
Definition fundamentals.hpp:765
GREM_ALWAYS_INLINE constexpr UnsignedInteger rotateBitsLeft(UnsignedInteger value, int shift) noexcept
Get the result of bitwise left-rotating a value by a number of bits.
Definition fundamentals.hpp:645
Pair(T1, T2) -> Pair< T1, T2 >
GREM_ALWAYS_INLINE constexpr UnsignedInteger roundUpToPowerOf2(UnsignedInteger value) noexcept
Get the smallest integral power of 2 that is not less than a given value.
Definition fundamentals.hpp:794
GREM_ALWAYS_INLINE constexpr T getByteReversed(T value)
Get a copy of a value with its byte order reversed.
Definition fundamentals.hpp:438
GREM_ALWAYS_INLINE constexpr int countOneBits(UnsignedInteger value) noexcept
Get the number of 1 bits in a given value.
Definition fundamentals.hpp:670
GREM_ALWAYS_INLINE constexpr decltype(auto) max(A &&a, B &&b)
Get the greater of two values, or the first value if they are equivalent.
Definition fundamentals.hpp:598
bool bool8_t
Definition fundamentals.hpp:76
constexpr bool32_t false32
Definition fundamentals.hpp:123
GREM_ALWAYS_INLINE constexpr T convertLittleEndianToHostEndian(T value)
Convert a value in little-endian byte order to the corresponding value in host-endian byte order.
Definition fundamentals.hpp:542
GREM_ALWAYS_INLINE constexpr decltype(auto) min(A &&a, B &&b)
Get the smaller of two values, or the first value if they are equivalent.
Definition fundamentals.hpp:585
GREM_ALWAYS_INLINE constexpr T GREM_VECTORCALL sign(T a)
Get the sign multiplier of a scalar.
Definition math.hpp:1204
GREM_ALWAYS_INLINE constexpr int countZeroBits(UnsignedInteger value) noexcept
Get the number of 0 bits in a given value.
Definition fundamentals.hpp:682
GREM_ALWAYS_INLINE constexpr int countTrailingZeroBits(UnsignedInteger value) noexcept
Get the number of consecutive 0 bits starting at the least significant (rightmost) bit of a given val...
Definition fundamentals.hpp:724
GREM_ALWAYS_INLINE constexpr int countTrailingOneBits(UnsignedInteger value) noexcept
Get the number of consecutive 1 bits starting at the least significant (rightmost) bit of a given val...
Definition fundamentals.hpp:738
constexpr size_t BYTE_BITS
Definition fundamentals.hpp:67
static constexpr T MAX
Definition fundamentals.hpp:36
static constexpr bool IS_IEC60559
Definition fundamentals.hpp:34
static constexpr T SMALLEST_NORMAL
Definition fundamentals.hpp:37
static constexpr T SMALLEST_SUBNORMAL
Definition fundamentals.hpp:38
static constexpr T MACHINE_EPSILON
Definition fundamentals.hpp:39
static constexpr T MIN
Definition fundamentals.hpp:35
static constexpr T QUIET_NAN
Definition fundamentals.hpp:41
static constexpr T INF
Definition fundamentals.hpp:40
static constexpr bool16_t MAX
Definition fundamentals.hpp:106
static constexpr bool16_t MIN
Definition fundamentals.hpp:105
static constexpr bool32_t MAX
Definition fundamentals.hpp:129
static constexpr bool32_t MIN
Definition fundamentals.hpp:128
static constexpr bool64_t MAX
Definition fundamentals.hpp:152
static constexpr bool64_t MIN
Definition fundamentals.hpp:151
static constexpr bool8_t MAX
Definition fundamentals.hpp:83
static constexpr bool8_t MIN
Definition fundamentals.hpp:82
static constexpr float16_t QUIET_NAN
Definition fundamentals.hpp:314
static constexpr float16_t SMALLEST_SUBNORMAL
Definition fundamentals.hpp:311
static constexpr float16_t INF
Definition fundamentals.hpp:313
static constexpr bool IS_IEC60559
Definition fundamentals.hpp:307
static constexpr float16_t MIN
Definition fundamentals.hpp:308
static constexpr float16_t SMALLEST_NORMAL
Definition fundamentals.hpp:310
static constexpr float16_t MACHINE_EPSILON
Definition fundamentals.hpp:312
static constexpr float16_t MAX
Definition fundamentals.hpp:309
Definition fundamentals.hpp:27
static constexpr T MAX
Definition fundamentals.hpp:29
static constexpr T MIN
Definition fundamentals.hpp:28
Definition fundamentals.hpp:70
byte bytes[sizeof(T)]
Definition fundamentals.hpp:71
constexpr bool operator==(const ValueRepresentation &) const noexcept=default
Definition fundamentals.hpp:160
GREM_ALWAYS_INLINE constexpr bool operator==(const float16_t &other) const noexcept
Definition fundamentals.hpp:209
GREM_ALWAYS_INLINE constexpr std::partial_ordering operator<=>(float other) const noexcept
Definition fundamentals.hpp:221
GREM_ALWAYS_INLINE constexpr std::partial_ordering operator<=>(const float16_t &other) const noexcept
Definition fundamentals.hpp:217
GREM_ALWAYS_INLINE constexpr bool operator==(float other) const noexcept
Definition fundamentals.hpp:213
GREM_ALWAYS_INLINE float16_t() noexcept=default