MCPcopy Create free account
hub / github.com/RenderKit/embree / float_to_half_full

Function float_to_half_full

tutorials/common/image/tinyexr.h:1026–1034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024 return o;
1025}
1026static inline FP16 float_to_half_full(FP32 f) {
1027 FP16 o;
1028#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) && defined(__AVX2__)
1029 o.f = static_cast<TINYEXR_FP16_COMPILER_TYPE> (_mm_cvtsi128_si32(_mm_cvtps_ph(_mm_set_ss(f.f), _MM_FROUND_CUR_DIRECTION)));
1030#else
1031 o.f = static_cast<TINYEXR_FP16_COMPILER_TYPE> (f.f);
1032#endif
1033 return o;
1034}
1035#else
1036static FP32 half_to_float(FP16 h) {
1037 static const FP32 magic = {113 << 23};

Callers 1

EncodePixelDataFunction · 0.85

Calls 2

_mm_cvtsi128_si32Function · 0.85
_mm_set_ssFunction · 0.85

Tested by

no test coverage detected