From 51e7dba75df0fd9d669aef6e6eb0293f66e0f2b4 Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Mon, 4 Nov 2024 14:58:27 +0100 Subject: [PATCH] Correct issue #217 --- Source/StatisticsFunctions/arm_absmin_no_idx_q15.c | 8 ++++---- Source/StatisticsFunctions/arm_absmin_no_idx_q31.c | 8 ++++---- Source/StatisticsFunctions/arm_absmin_no_idx_q7.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/StatisticsFunctions/arm_absmin_no_idx_q15.c b/Source/StatisticsFunctions/arm_absmin_no_idx_q15.c index 5a3b0ba3..9d428088 100755 --- a/Source/StatisticsFunctions/arm_absmin_no_idx_q15.c +++ b/Source/StatisticsFunctions/arm_absmin_no_idx_q15.c @@ -56,8 +56,8 @@ ARM_DSP_ATTRIBUTE void arm_absmin_no_idx_q15( uint16_t blkCnt; /* loop counters */ q15x8_t vecSrc; q15_t const *pSrcVec; - uint16x8_t curExtremValVec = vdupq_n_s16(Q15_ABSMAX); - q15_t minValue = Q15_ABSMAX; + uint16x8_t curExtremValVec = vdupq_n_u16(Q15_ABSMAX); + uint16_t minValue = Q15_ABSMAX; mve_pred16_t p0; @@ -95,8 +95,8 @@ ARM_DSP_ATTRIBUTE void arm_absmin_no_idx_q15( /* * Get min value across the vector */ - minValue = vminavq(minValue, (q15x8_t)curExtremValVec); - *pResult = minValue; + minValue = vminvq(minValue, curExtremValVec); + *pResult = __USAT(minValue, 15); } #else diff --git a/Source/StatisticsFunctions/arm_absmin_no_idx_q31.c b/Source/StatisticsFunctions/arm_absmin_no_idx_q31.c index d3045ae8..23d06239 100755 --- a/Source/StatisticsFunctions/arm_absmin_no_idx_q31.c +++ b/Source/StatisticsFunctions/arm_absmin_no_idx_q31.c @@ -57,8 +57,8 @@ ARM_DSP_ATTRIBUTE void arm_absmin_no_idx_q31( int32_t blkCnt; /* loop counters */ q31x4_t vecSrc; q31_t const *pSrcVec; - uint32x4_t curExtremValVec = vdupq_n_s32(Q31_ABSMAX); - q31_t minValue = Q31_ABSMAX; + uint32x4_t curExtremValVec = vdupq_n_u32(Q31_ABSMAX); + uint32_t minValue = Q31_ABSMAX; mve_pred16_t p0; @@ -96,8 +96,8 @@ ARM_DSP_ATTRIBUTE void arm_absmin_no_idx_q31( /* * Get min value across the vector */ - minValue = vminavq(minValue, (q31x4_t)curExtremValVec); - *pResult = minValue; + minValue = vminvq(minValue, curExtremValVec); + *pResult = clip_q63_to_q31((q63_t)minValue); } #else diff --git a/Source/StatisticsFunctions/arm_absmin_no_idx_q7.c b/Source/StatisticsFunctions/arm_absmin_no_idx_q7.c index 588752e5..a20f4943 100755 --- a/Source/StatisticsFunctions/arm_absmin_no_idx_q7.c +++ b/Source/StatisticsFunctions/arm_absmin_no_idx_q7.c @@ -59,8 +59,8 @@ ARM_DSP_ATTRIBUTE void arm_absmin_no_idx_q7( int32_t blkCnt; /* loop counters */ q7x16_t vecSrc; q7_t const *pSrcVec; - uint8x16_t curExtremValVec = vdupq_n_s8(Q7_ABSMAX); - q7_t minValue = Q7_ABSMAX; + uint8x16_t curExtremValVec = vdupq_n_u8(Q7_ABSMAX); + uint8_t minValue = Q7_ABSMAX; mve_pred16_t p0; @@ -98,8 +98,8 @@ ARM_DSP_ATTRIBUTE void arm_absmin_no_idx_q7( /* * Get min value across the vector */ - minValue = vminavq(minValue, (q7x16_t)curExtremValVec); - *pResult = minValue; + minValue = vminvq(minValue, curExtremValVec); + *pResult = __USAT(minValue,7); } #else