This is the documentation for Enlighten.

module Half Precision Scalars

Classes

Name Description
Geo::GeoHalf

Convenience value type for a half float.

Variables

Name Description
const float g_MaxNegHalfFloat = -65504.0f

Largest representable negative half-float (=-(2 - 2^-10) * 2^15)

const float g_MaxPosHalfFloat = 65504.0f

Largest representable positive half-float (=(2 - 2^-10) * 2^15)

Functions

Name Description
ConvertFloatToHalf(float)

Convert a float to a half.

ConvertFloatToHalfArray(Geo::u16 *, const float *, Geo::u32)

Convert an array of floats to an array of halves.

ConvertHalfToFloat(Geo::u16)

Convert a half to a float.

ConvertHalfToFloatArray(const Geo::u16 *, float *, Geo::u32)

Convert an array of halves to an array of floats.

ConvertV128ToHalfVectorArray(Geo::u64 *, const Geo::v128 *, Geo::u32)

Convert an array of v128s to an array of half vectors.

HalfVectorToV128(const Geo::u16 *)

Convert a 4-element array of half floats to a v128.

HalfVectorToV128_Portable(const Geo::u16 *)

Convert a 4-element array of half floats to a v128.

V128ToHalfVector(Geo::v128, Geo::u16 *)

Convert a v128 to a 4-element array of half floats.

V128ToHalfVector_Portable(Geo::v128, Geo::u16 *)

Convert a v128 to a 4-element array of half floats.


Geo::u16 GEO_CALL Geo::ConvertFloatToHalf


public: Geo::u16GEO_CALL ConvertFloatToHalf
(
    float value
)


Convert a float to a half.

Currently using the portable implementation on all platforms.


void GEO_CALL Geo::ConvertFloatToHalfArray


public: void GEO_CALL ConvertFloatToHalfArray
(
    Geo::u16 * halves,
    const float * floats,
    Geo::u32 count
)


Convert an array of floats to an array of halves.

On SSE platforms a faster implementation is used if:

  • halves is 8-byte aligned.

  • floats is 16-byte aligned.

  • count is a multiple of 4.


float GEO_CALL Geo::ConvertHalfToFloat


public: float GEO_CALL ConvertHalfToFloat
(
    Geo::u16 value
)


Convert a half to a float.

Currently using the portable implementation on all platforms.


void GEO_CALL Geo::ConvertHalfToFloatArray


public: void GEO_CALL ConvertHalfToFloatArray
(
    const Geo::u16 * halves,
    float * floats,
    Geo::u32 count
)


Convert an array of halves to an array of floats.

Currently using the portable implementation on all platforms.


void GEO_CALL Geo::ConvertV128ToHalfVectorArray


public: void GEO_CALL ConvertV128ToHalfVectorArray
(
    Geo::u64 * vHalves,
    const Geo::v128 * v,
    Geo::u32 count
)


Convert an array of v128s to an array of half vectors.


GEO_FORCE_INLINE Geo::v128 GEO_CALL Geo::HalfVectorToV128


public: GEO_FORCE_INLINEGeo::v128GEO_CALL HalfVectorToV128
(
    const Geo::u16 * vHalf
)


Convert a 4-element array of half floats to a v128.

This version acts as a switch board to the optimized versions (where available)


Geo::v128 GEO_CALL Geo::HalfVectorToV128_Portable


public: Geo::v128GEO_CALL HalfVectorToV128_Portable
(
    const Geo::u16 * vHalf
)


Convert a 4-element array of half floats to a v128.

Currently using the portable implementation on all platforms.


GEO_FORCE_INLINE void GEO_CALL Geo::V128ToHalfVector


public: GEO_FORCE_INLINE void GEO_CALL V128ToHalfVector
(
    Geo::v128 fp32,
    Geo::u16 * vOutHalf
)


Convert a v128 to a 4-element array of half floats.

This version acts as a switch board to the optimized versions (where available)


void GEO_CALL Geo::V128ToHalfVector_Portable


public: void GEO_CALL V128ToHalfVector_Portable
(
    Geo::v128 fp32,
    Geo::u16 * vOutHalf
)


Convert a v128 to a 4-element array of half floats.

Currently using the portable implementation on all platforms.