MCPcopy Create free account
hub / github.com/alecazam/kram / float16_to_float

Function float16_to_float

libkram/astc-encoder/astcenc_mathlib.cpp:92–105  ·  view source on GitHub ↗

* @brief Return a float value for a float16 vector. */

Source from the content-addressed store, hash-verified

90 * @brief Return a float value for a float16 vector.
91 */
92vfloat4 float16_to_float(vint4 a)
93{
94//#if ASTCENC_F16C >= 1
95 __m128i packed = _mm_packs_epi32(a.m, a.m);
96 __m128 f32 = _mm_cvtph_ps(packed);
97 return vfloat4(f32);
98//#else
99// return vfloat4(
100// sf16_to_float(a.lane<0>()),
101// sf16_to_float(a.lane<1>()),
102// sf16_to_float(a.lane<2>()),
103// sf16_to_float(a.lane<3>()));
104//#endif
105}
106
107/**
108 * @brief Return a float value for a float16 scalar.

Callers 6

decode_texelFunction · 0.70
load_texel_f16Function · 0.70
fetch_image_blockFunction · 0.70
astcenc_get_block_infoFunction · 0.70

Calls 4

vfloat4Class · 0.70
_mm_packs_epi32Function · 0.50
_mm_set1_epi16Function · 0.50
_mm_cvtss_f32Function · 0.50

Tested by

no test coverage detected