未验证 提交 27113c05 编写于 作者: N nihui 提交者: GitHub

fix tanh_ps return wrong value when input < -45 (#601)

* fix tanh_ps return wrong value when input < -45

* Update mish_math_func.h
上级 2ed03474
......@@ -185,7 +185,7 @@ static inline float32x4_t tanh_ps(float32x4_t x)
// abs(x) > HALFMAXLOGF
// return 1.0 or -1.0
uint32x4_t mask_pos = vcgtq_f32(x2, vdupq_n_f32(0.f));
uint32x4_t mask_pos = vcgtq_f32(x, vdupq_n_f32(0.f));
float32x4_t y1 = vreinterpretq_f32_u32(vbslq_u32(mask_pos, vreinterpretq_u32_f32(vdupq_n_f32(1.f)), vreinterpretq_u32_f32(vdupq_n_f32(-1.f))));
y = vreinterpretq_f32_u32(vbslq_u32(mask_l, vreinterpretq_u32_f32(y0), vreinterpretq_u32_f32(y)));
......
......@@ -379,7 +379,7 @@ static inline float32x4_t tanh_ps(float32x4_t x)
// abs(x) > HALFMAXLOGF
// return 1.0 or -1.0
uint32x4_t mask_pos = vcgtq_f32(x2, vdupq_n_f32(0.f));
uint32x4_t mask_pos = vcgtq_f32(x, vdupq_n_f32(0.f));
float32x4_t y1 = vreinterpretq_f32_u32(
vbslq_u32(mask_pos, vreinterpretq_u32_f32(vdupq_n_f32(1.f)), vreinterpretq_u32_f32(vdupq_n_f32(-1.f))));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册