| 2729 | } |
| 2730 | |
| 2731 | VECTORCALL 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 |
no test coverage detected