diff --git a/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h b/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h index bd9431dfbe43..f4e57623ce1c 100644 --- a/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h +++ b/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h @@ -300,6 +300,10 @@ inline void calculate_asin() { vFloat v = dst_reg[0]; v = sfpu_asine_maclaurin_series(v); + v_if(dst_reg[0] < -1.0f || dst_reg[0] > 1.0f ) + { + v = std::numeric_limits::quiet_NaN(); + }v_endif; dst_reg[0] = v; dst_reg++; } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h index 4da3114f7636..442a663736a3 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_trigonometry.h @@ -307,7 +307,10 @@ inline void calculate_asin() for (int d = 0; d < ITERATIONS; d++) { vFloat v = dst_reg[0]; - v = sfpu_asine_maclaurin_series(v); + v_if(dst_reg[0] < -1.0f || dst_reg[0] > 1.0f ) + { + v = std::numeric_limits::quiet_NaN(); + }v_endif dst_reg[0] = v; dst_reg++; }