MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / v_exp2

Function v_exp2

include/vecmath/dag_vecMath_common.h:2731–2742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2729}
2730
2731VECTORCALL VECMATH_INLINE vec4f v_exp2(vec4f x)
2732{
2733 vec4i ipart;
2734 vec4f fpart, expipart, expfpart;
2735 x = v_min(x, v_splats( 129.00000f));
2736 x = v_max(x, v_splats(-126.99999f));
2737 ipart = v_cvt_roundi(v_sub(x, V_C_HALF_MINUS_EPS));
2738 fpart = v_sub(x, v_cvt_vec4f(ipart));
2739 expipart = v_cast_vec4f(v_slli(v_addi(ipart, v_splatsi(127)), 23));
2740 expfpart = POLY5(fpart, 9.9999994e-1f, 6.9315308e-1f, 2.4015361e-1f, 5.5826318e-2f, 8.9893397e-3f, 1.8775767e-3f);
2741 return v_sel(v_mul(expipart, expfpart), expipart, v_cmp_eq(fpart, v_zero()));//ensure that exp2(int) = 2^int
2742}
2743
2744#undef EXP_DEF_PART
2745

Callers 4

Exp2Method · 0.85
Exp2Method · 0.85
v_expFunction · 0.85
v_powFunction · 0.85

Calls 14

v_cvt_roundiFunction · 0.85
v_cvt_vec4fFunction · 0.85
v_minFunction · 0.70
v_splatsFunction · 0.70
v_maxFunction · 0.70
v_subFunction · 0.70
v_cast_vec4fFunction · 0.70
v_slliFunction · 0.70
v_addiFunction · 0.70
v_splatsiFunction · 0.70
v_selFunction · 0.70
v_mulFunction · 0.70

Tested by

no test coverage detected