diff --git a/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h b/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h index 11f5b87e364..d2dec31e6ce 100644 --- a/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h +++ b/tt_metal/hw/ckernels/grayskull/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h @@ -55,7 +55,7 @@ inline void calculate_erfc() { // SFPU microcode: for (int d = 0; d < ITERATIONS; d++) { vFloat x = dst_reg[0]; - v_if(x < 0.0f) { x = 1.0 + (calculate_erf_body(x)); } + v_if(x < 0.0f) { x = -x; x = 1.0 + (calculate_erf_body(x)); } v_else { x = 1.0 - (calculate_erf_body(x)); } v_endif; dst_reg[0] = x; diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h index c2e38508b4a..b404c0773d7 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/ckernel_sfpu_erf_erfc.h @@ -53,7 +53,7 @@ inline void calculate_erfc() { // SFPU microcode: for (int d = 0; d < 8; d++) { vFloat x = dst_reg[0]; - v_if(x < 0.0f) { x = 1.0 + (calculate_erf_body(x)); } + v_if(x < 0.0f) { x = -x; x = 1.0 + (calculate_erf_body(x)); } v_else { x = 1.0 - (calculate_erf_body(x)); } v_endif; dst_reg[0] = x;