From 4189b5986ced8326f146b3e2fa6451699e26762a Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Mon, 4 Mar 2024 09:03:02 +0100 Subject: [PATCH] Replaced INFINITY by maximum positive float. --- Include/arm_vec_math.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Include/arm_vec_math.h b/Include/arm_vec_math.h index d9134c541..9cc4c4e60 100755 --- a/Include/arm_vec_math.h +++ b/Include/arm_vec_math.h @@ -66,7 +66,7 @@ __STATIC_INLINE f32x4_t vrecip_medprec_f32( b = 2.0f - xinv.f * ax; xinv.f = xinv.f * b; - xinv.f = vdupq_m(xinv.f, INFINITY, vcmpeqq(x, 0.0f)); + xinv.f = vdupq_m(xinv.f, F32_MAX, vcmpeqq(x, 0.0f)); /* * restore sign */ @@ -103,7 +103,7 @@ __STATIC_INLINE f32x4_t vrecip_hiprec_f32( b = 2.0f - xinv.f * ax; xinv.f = xinv.f * b; - xinv.f = vdupq_m(xinv.f, INFINITY, vcmpeqq(x, 0.0f)); + xinv.f = vdupq_m(xinv.f, F32_MAX, vcmpeqq(x, 0.0f)); /* * restore sign */ @@ -213,7 +213,7 @@ __STATIC_INLINE f32x4_t vlogq_f32(f32x4_t vecIn) */ vecAcc0 = vfmaq(vecAcc0, vecExpUnBiasedFlt, __logf_rng_f32); // set log0 down to -inf - vecAcc0 = vdupq_m(vecAcc0, -INFINITY, vcmpeqq(vecIn, 0.0f)); + vecAcc0 = vdupq_m(vecAcc0, -F32_MAX, vcmpeqq(vecIn, 0.0f)); return vecAcc0; } @@ -267,7 +267,7 @@ __STATIC_INLINE f32x4_t vrecip_f32(f32x4_t vecIn) vecTmp = vfmasq(vecW, vecTmp, 8.0f); v.f = vmulq(v.f, vecTmp); - v.f = vdupq_m(v.f, INFINITY, vcmpeqq(vecIn, 0.0f)); + v.f = vdupq_m(v.f, F32_MAX, vcmpeqq(vecIn, 0.0f)); /* * restore sign */