14static constexpr HalfFloat HALF_FLT_MAX = 0x7bff;
15static constexpr HalfFloat HALF_FLT_MAX_NEGATIVE = 0xfbff;
16static constexpr HalfFloat HALF_FLT_INF = 0x7c00;
17static constexpr HalfFloat HALF_FLT_INF_NEGATIVE = 0xfc00;
18static constexpr HalfFloat HALF_FLT_NANQ = 0x7e00;
19static constexpr HalfFloat HALF_FLT_NANQ_NEGATIVE = 0xfe00;
24static constexpr int FLOAT_SIGN_POS = 31;
25static constexpr int FLOAT_EXPONENT_POS = 23;
26static constexpr int FLOAT_EXPONENT_BITS = 8;
27static constexpr int FLOAT_EXPONENT_MASK = (1 << FLOAT_EXPONENT_BITS) - 1;
28static constexpr int FLOAT_EXPONENT_BIAS = 127;
29static constexpr int FLOAT_MANTISSA_BITS = 23;
30static constexpr int FLOAT_MANTISSA_MASK = (1 << FLOAT_MANTISSA_BITS) - 1;
31static constexpr int FLOAT_EXPONENT_AND_MANTISSA_MASK = FLOAT_MANTISSA_MASK + (FLOAT_EXPONENT_MASK << FLOAT_EXPONENT_POS);
34static constexpr int HALF_FLT_SIGN_POS = 15;
35static constexpr int HALF_FLT_EXPONENT_POS = 10;
36static constexpr int HALF_FLT_EXPONENT_BITS = 5;
37static constexpr int HALF_FLT_EXPONENT_MASK = (1 << HALF_FLT_EXPONENT_BITS) - 1;
38static constexpr int HALF_FLT_EXPONENT_BIAS = 15;
39static constexpr int HALF_FLT_MANTISSA_BITS = 10;
40static constexpr int HALF_FLT_MANTISSA_MASK = (1 << HALF_FLT_MANTISSA_BITS) - 1;
41static constexpr int HALF_FLT_EXPONENT_AND_MANTISSA_MASK = HALF_FLT_MANTISSA_MASK + (HALF_FLT_EXPONENT_MASK << HALF_FLT_EXPONENT_POS);
52template <
int RoundingMode>
94 mantissa |= 1 << FLOAT_MANTISSA_BITS;
101 shift = FLOAT_MANTISSA_BITS - HALF_FLT_MANTISSA_BITS;
131template <
int RoundingMode>
193#if defined(JPH_USE_F16C)
195#elif defined(JPH_USE_NEON)
unsigned int uint
Definition Core.h:453
#define JPH_NAMESPACE_END
Definition Core.h:379
std::uint32_t uint32
Definition Core.h:456
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
std::uint16_t uint16
Definition Core.h:455
uint16 HalfFloat
Definition HalfFloat.h:11
JPH_INLINE UVec4 LogicalShiftLeft() const
Shift all components by Count bits to the left (filling with zeros from the left)
static JPH_INLINE UVec4 sSelect(UVec4Arg inNotSet, UVec4Arg inSet, UVec4Arg inControl)
Component wise select, returns inNotSet when highest bit of inControl = 0 and inSet when highest bit ...
Definition UVec4.inl:157
JPH_INLINE UVec4 Expand4Uint16Lo() const
Takes the lower 4 16 bits and expands them to X, Y, Z and W.
Definition UVec4.inl:463
static JPH_INLINE UVec4 sReplicate(uint32 inV)
Replicate int inV across all components.
Definition UVec4.inl:56
static JPH_INLINE UVec4 sAnd(UVec4Arg inV1, UVec4Arg inV2)
Logical and (component wise)
Definition UVec4.inl:202
static JPH_INLINE UVec4 sEquals(UVec4Arg inV1, UVec4Arg inV2)
Equals (component wise)
Definition UVec4.inl:143
static JPH_INLINE UVec4 sOr(UVec4Arg inV1, UVec4Arg inV2)
Logical or (component wise)
Definition UVec4.inl:174
static JPH_INLINE UVec4 sZero()
Vector with all zeros.
Definition UVec4.inl:45
JPH_INLINE Vec4 ReinterpretAsFloat() const
Reinterpret UVec4 as a Vec4 (doesn't change the bits)
Definition UVec4.inl:340
Definition HalfFloat.h:21
Vec4 ToFloatFallback(UVec4Arg inValue)
Convert 4 half floats (lower 64 bits) to floats, fallback version when no intrinsics available.
Definition HalfFloat.h:160
JPH_INLINE Vec4 ToFloat(UVec4Arg inValue)
Convert 4 half floats (lower 64 bits) to floats.
Definition HalfFloat.h:191
JPH_INLINE HalfFloat FromFloat(float inV)
Convert a float (32-bits) to a half float (16-bits)
Definition HalfFloat.h:132
ERoundingMode
Define half-float rounding modes.
Definition HalfFloat.h:45
@ ROUND_TO_NEG_INF
Round to negative infinity.
Definition HalfFloat.h:46
@ ROUND_TO_POS_INF
Round to positive infinity.
Definition HalfFloat.h:47
@ ROUND_TO_NEAREST
Round to nearest value.
Definition HalfFloat.h:48
HalfFloat FromFloatFallback(float inV)
Convert a float (32-bits) to a half float (16-bits), fallback version when no intrinsics available.
Definition HalfFloat.h:53