I noticed that the scalar and simd xexpf versions seem to use slightly different constants to clamp to 0 or inf. In scalar, it is -104 and 104, but simd uses -104 and 100. Is this intentional?
Scalar
|
if (d < -104) u = 0; |
|
if (d > 104) u = SLEEF_INFINITYf; |
SIMD
|
u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(d, vcast_vf_f(-104)), vreinterpret_vm_vf(u))); |
|
u = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(vcast_vf_f(100), d), vcast_vf_f(SLEEF_INFINITYf), u); |
It isn't really making a difference to me as I can guarantee the inputs will be inside that range, so mainly a curiosity question. Thanks for making this project, it is really nice.
I noticed that the scalar and simd
xexpfversions seem to use slightly different constants to clamp to 0 or inf. In scalar, it is -104 and 104, but simd uses -104 and 100. Is this intentional?Scalar
sleef/src/libm/sleefsp.c
Lines 1174 to 1175 in 5533114
SIMD
sleef/src/libm/sleefsimdsp.c
Lines 2047 to 2048 in 5533114
It isn't really making a difference to me as I can guarantee the inputs will be inside that range, so mainly a curiosity question. Thanks for making this project, it is really nice.