diff --git a/Include/dsp/utils.h b/Include/dsp/utils.h index a7d718444..7dba11fd0 100755 --- a/Include/dsp/utils.h +++ b/Include/dsp/utils.h @@ -48,10 +48,12 @@ extern "C" #define MAX(x,y) ((x) > (y) ? (x) : (y)) #endif -#define SQ(x) ((x) * (x)) +#ifndef ARM_SQ +#define ARM_SQ(x) ((x) * (x)) +#endif -#ifndef ROUND_UP - #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) +#ifndef ARM_ROUND_UP + #define ARM_ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) #endif @@ -251,6 +253,7 @@ __STATIC_INLINE int32_t arm_div_int64_to_int32(int64_t num, int32_t den) return result; } +#undef INDEX_MASK #ifdef __cplusplus } diff --git a/Source/DistanceFunctions/arm_euclidean_distance_f16.c b/Source/DistanceFunctions/arm_euclidean_distance_f16.c index 64d5d4a6f..07860e6bc 100755 --- a/Source/DistanceFunctions/arm_euclidean_distance_f16.c +++ b/Source/DistanceFunctions/arm_euclidean_distance_f16.c @@ -113,7 +113,7 @@ float16_t arm_euclidean_distance_f16(const float16_t *pA,const float16_t *pB, ui while(blockSize > 0) { tmp = (_Float16)*pA++ - (_Float16)*pB++; - accum += SQ(tmp); + accum += ARM_SQ(tmp); blockSize --; } arm_sqrt_f16(accum,&result); diff --git a/Source/DistanceFunctions/arm_euclidean_distance_f32.c b/Source/DistanceFunctions/arm_euclidean_distance_f32.c index e226617e9..59702877c 100755 --- a/Source/DistanceFunctions/arm_euclidean_distance_f32.c +++ b/Source/DistanceFunctions/arm_euclidean_distance_f32.c @@ -122,7 +122,7 @@ float32_t arm_euclidean_distance_f32(const float32_t *pA,const float32_t *pB, ui while(blkCnt > 0) { tmp = *pA++ - *pB++; - accum += SQ(tmp); + accum += ARM_SQ(tmp); blkCnt --; } arm_sqrt_f32(accum,&tmp); @@ -137,7 +137,7 @@ float32_t arm_euclidean_distance_f32(const float32_t *pA,const float32_t *pB, ui while(blockSize > 0) { tmp = *pA++ - *pB++; - accum += SQ(tmp); + accum += ARM_SQ(tmp); blockSize --; } arm_sqrt_f32(accum,&tmp); diff --git a/Source/DistanceFunctions/arm_euclidean_distance_f64.c b/Source/DistanceFunctions/arm_euclidean_distance_f64.c index d57857a3b..925769c3a 100644 --- a/Source/DistanceFunctions/arm_euclidean_distance_f64.c +++ b/Source/DistanceFunctions/arm_euclidean_distance_f64.c @@ -73,7 +73,7 @@ float64_t arm_euclidean_distance_f64(const float64_t *pA,const float64_t *pB, ui while(blkCnt > 0) { tmp = *pA++ - *pB++; - accum += SQ(tmp); + accum += ARM_SQ(tmp); blkCnt --; } tmp = sqrt(accum); diff --git a/Source/FilteringFunctions/arm_fir_f16.c b/Source/FilteringFunctions/arm_fir_f16.c index f89c2d37b..f46dbece0 100755 --- a/Source/FilteringFunctions/arm_fir_f16.c +++ b/Source/FilteringFunctions/arm_fir_f16.c @@ -244,7 +244,7 @@ void arm_fir_f16(const arm_fir_instance_f16 * S, float16_t * pDst, uint32_t blockSize) { - float16_t *pRefStatePtr = S->pState + ROUND_UP(blockSize, 8); + float16_t *pRefStatePtr = S->pState + ARM_ROUND_UP(blockSize, 8); float16_t *pState = pRefStatePtr ; /* State pointer */ const float16_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ const float16_t *pSamples; /* Temporary pointer to the sample buffer */ diff --git a/Source/FilteringFunctions/arm_fir_init_f16.c b/Source/FilteringFunctions/arm_fir_init_f16.c index 34913432d..40b8061d6 100755 --- a/Source/FilteringFunctions/arm_fir_init_f16.c +++ b/Source/FilteringFunctions/arm_fir_init_f16.c @@ -89,7 +89,7 @@ void arm_fir_init_f16( /* Clear state buffer. The size is always (blockSize + numTaps - 1) */ #if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) - memset(pState, 0, (numTaps + (blockSize - 1U) + ROUND_UP(blockSize, 8)) * sizeof(float16_t)); + memset(pState, 0, (numTaps + (blockSize - 1U) + ARM_ROUND_UP(blockSize, 8)) * sizeof(float16_t)); #else memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(float16_t)); #endif diff --git a/Source/FilteringFunctions/arm_fir_init_q31.c b/Source/FilteringFunctions/arm_fir_init_q31.c index 96d1fdde3..85bdf4f44 100644 --- a/Source/FilteringFunctions/arm_fir_init_q31.c +++ b/Source/FilteringFunctions/arm_fir_init_q31.c @@ -86,7 +86,7 @@ void arm_fir_init_q31( /* Clear state buffer. The size is always (blockSize + numTaps - 1) */ #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) - memset(pState, 0, (numTaps + (blockSize - 1U) + 2*ROUND_UP(blockSize, 4)) * sizeof(q31_t)); + memset(pState, 0, (numTaps + (blockSize - 1U) + 2*ARM_ROUND_UP(blockSize, 4)) * sizeof(q31_t)); #else memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(q31_t)); #endif diff --git a/Source/FilteringFunctions/arm_fir_q31.c b/Source/FilteringFunctions/arm_fir_q31.c index 40fe52709..fd5f9c36a 100644 --- a/Source/FilteringFunctions/arm_fir_q31.c +++ b/Source/FilteringFunctions/arm_fir_q31.c @@ -107,7 +107,7 @@ #define FIR_Q31_MAIN_CORE() \ { \ - q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4); \ + q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4); \ q31_t *pState = pRefStatePtr; /* State pointer */ \ const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ \ q31_t *pStateCur; /* Points to the current sample of the state */ \ @@ -210,7 +210,7 @@ static void arm_fir_q31_1_4_mve(const arm_fir_instance_q31 * S, const q31_t * __restrict pSrc, q31_t * __restrict pDst, uint32_t blockSize) { - q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4); + q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4); q31_t *pState = pRefStatePtr; /* State pointer */ const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ q31_t *pStateCur; /* Points to the current sample of the state */ @@ -452,7 +452,7 @@ static void arm_fir_q31_29_32_mve(const arm_fir_instance_q31 * S, q31_t * __restrict pDst, uint32_t blockSize) { - q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4); + q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4); q31_t *pState = pRefStatePtr; /* State pointer */ const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ q31_t *pStateCur; /* Points to the current sample of the state */ @@ -652,7 +652,7 @@ void arm_fir_q31( q31_t * pDst, uint32_t blockSize) { - q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4); + q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4); q31_t *pState = pRefStatePtr; /* State pointer */ const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ q31_t *pStateCur; /* Points to the current sample of the state */ diff --git a/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c b/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c index 21053415c..388c2d2c4 100755 --- a/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c +++ b/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c @@ -148,10 +148,10 @@ void arm_quaternion2rotation_f32(const float32_t *pInputQuaternions, uint32_t nb; for(nb=0; nb < nbQuaternions; nb++) { - float32_t q00 = SQ(pInputQuaternions[0 + nb * 4]); - float32_t q11 = SQ(pInputQuaternions[1 + nb * 4]); - float32_t q22 = SQ(pInputQuaternions[2 + nb * 4]); - float32_t q33 = SQ(pInputQuaternions[3 + nb * 4]); + float32_t q00 = ARM_SQ(pInputQuaternions[0 + nb * 4]); + float32_t q11 = ARM_SQ(pInputQuaternions[1 + nb * 4]); + float32_t q22 = ARM_SQ(pInputQuaternions[2 + nb * 4]); + float32_t q33 = ARM_SQ(pInputQuaternions[3 + nb * 4]); float32_t q01 = pInputQuaternions[0 + nb * 4]*pInputQuaternions[1 + nb * 4]; float32_t q02 = pInputQuaternions[0 + nb * 4]*pInputQuaternions[2 + nb * 4]; float32_t q03 = pInputQuaternions[0 + nb * 4]*pInputQuaternions[3 + nb * 4]; diff --git a/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c b/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c index d82bbbf1f..094d3f460 100755 --- a/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c +++ b/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c @@ -96,10 +96,10 @@ void arm_quaternion_inverse_f32(const float32_t *pInputQuaternions, for(i=0; i < nbQuaternions; i++) { - temp = SQ(pInputQuaternions[4 * i + 0]) + - SQ(pInputQuaternions[4 * i + 1]) + - SQ(pInputQuaternions[4 * i + 2]) + - SQ(pInputQuaternions[4 * i + 3]); + temp = ARM_SQ(pInputQuaternions[4 * i + 0]) + + ARM_SQ(pInputQuaternions[4 * i + 1]) + + ARM_SQ(pInputQuaternions[4 * i + 2]) + + ARM_SQ(pInputQuaternions[4 * i + 3]); pInverseQuaternions[4 * i + 0] = pInputQuaternions[4 * i + 0] / temp; pInverseQuaternions[4 * i + 1] = -pInputQuaternions[4 * i + 1] / temp; diff --git a/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c b/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c index af6653a09..d9b92e1bc 100755 --- a/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c +++ b/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c @@ -88,10 +88,10 @@ void arm_quaternion_norm_f32(const float32_t *pInputQuaternions, for(i=0; i < nbQuaternions; i++) { - temp = SQ(pInputQuaternions[4 * i + 0]) + - SQ(pInputQuaternions[4 * i + 1]) + - SQ(pInputQuaternions[4 * i + 2]) + - SQ(pInputQuaternions[4 * i + 3]); + temp = ARM_SQ(pInputQuaternions[4 * i + 0]) + + ARM_SQ(pInputQuaternions[4 * i + 1]) + + ARM_SQ(pInputQuaternions[4 * i + 2]) + + ARM_SQ(pInputQuaternions[4 * i + 3]); pNorms[i] = sqrtf(temp); } } diff --git a/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c b/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c index 605e558bf..0f50c92a6 100755 --- a/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c +++ b/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c @@ -88,10 +88,10 @@ void arm_quaternion_normalize_f32(const float32_t *pInputQuaternions, uint32_t i; for(i=0; i < nbQuaternions; i++) { - temp = SQ(pInputQuaternions[4 * i + 0]) + - SQ(pInputQuaternions[4 * i + 1]) + - SQ(pInputQuaternions[4 * i + 2]) + - SQ(pInputQuaternions[4 * i + 3]); + temp = ARM_SQ(pInputQuaternions[4 * i + 0]) + + ARM_SQ(pInputQuaternions[4 * i + 1]) + + ARM_SQ(pInputQuaternions[4 * i + 2]) + + ARM_SQ(pInputQuaternions[4 * i + 3]); temp = sqrtf(temp); pNormalizedQuaternions[4 * i + 0] = pInputQuaternions[4 * i + 0] / temp; diff --git a/Source/SVMFunctions/arm_svm_rbf_predict_f16.c b/Source/SVMFunctions/arm_svm_rbf_predict_f16.c index 91afcc1a3..cfffcbb3b 100755 --- a/Source/SVMFunctions/arm_svm_rbf_predict_f16.c +++ b/Source/SVMFunctions/arm_svm_rbf_predict_f16.c @@ -334,7 +334,7 @@ void arm_svm_rbf_predict_f16( dot=0.0f16; for(j=0; j < S->vectorDimension; j++) { - dot = dot + SQ((_Float16)in[j] - (_Float16) *pSupport); + dot = dot + ARM_SQ((_Float16)in[j] - (_Float16) *pSupport); pSupport++; } sum += (_Float16)S->dualCoefficients[i] * (_Float16)expf((float32_t)(-(_Float16)S->gamma * (_Float16)dot)); diff --git a/Source/SVMFunctions/arm_svm_rbf_predict_f32.c b/Source/SVMFunctions/arm_svm_rbf_predict_f32.c index d3c43bf63..bb12e0624 100755 --- a/Source/SVMFunctions/arm_svm_rbf_predict_f32.c +++ b/Source/SVMFunctions/arm_svm_rbf_predict_f32.c @@ -413,10 +413,10 @@ void arm_svm_rbf_predict_f32( blkCnt = S->vectorDimension & 3; while (blkCnt > 0U) { - dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,0) + SQ(*pIn - *pSupporta), dotV,0); - dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,1) + SQ(*pIn - *pSupportb), dotV,1); - dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,2) + SQ(*pIn - *pSupportc), dotV,2); - dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,3) + SQ(*pIn - *pSupportd), dotV,3); + dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,0) + ARM_SQ(*pIn - *pSupporta), dotV,0); + dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,1) + ARM_SQ(*pIn - *pSupportb), dotV,1); + dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,2) + ARM_SQ(*pIn - *pSupportc), dotV,2); + dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,3) + ARM_SQ(*pIn - *pSupportd), dotV,3); pSupporta++; pSupportb++; @@ -478,7 +478,7 @@ void arm_svm_rbf_predict_f32( while (blkCnt > 0U) { - dot = dot + SQ(*pIn - *pSupport); + dot = dot + ARM_SQ(*pIn - *pSupport); pIn++; pSupport++; @@ -507,7 +507,7 @@ void arm_svm_rbf_predict_f32( dot=0; for(j=0; j < S->vectorDimension; j++) { - dot = dot + SQ(in[j] - *pSupport); + dot = dot + ARM_SQ(in[j] - *pSupport); pSupport++; } sum += S->dualCoefficients[i] * expf(-S->gamma * dot); diff --git a/Testing/cmsis_build/runall.py b/Testing/cmsis_build/runall.py index 160925b93..1c4bd69db 100644 --- a/Testing/cmsis_build/runall.py +++ b/Testing/cmsis_build/runall.py @@ -226,14 +226,11 @@ def runAVH(build,core): } # Override previous solutions for more restricted testing. -#solutions={ -# 'test_ac6.csolution.yml':[ -# # ("VHT-Corstone-310","CS310"), -# ("VHT_M7","M7DP"), -# ("VHT_M7_UNROLLED","M7DP"), -# ("VHT_M0P","M0plus") -# ] -#} +solutions={ + 'test_ac6.csolution.yml':[ + ("VHT-Corstone-300","CS300"), + ] +} HTMLHEADER="""
diff --git a/Testing/cmsis_build/test.Release+VHT-Corstone-300.cprj b/Testing/cmsis_build/test.Release+VHT-Corstone-300.cprj index f1a0051ca..3730032d6 100644 --- a/Testing/cmsis_build/test.Release+VHT-Corstone-300.cprj +++ b/Testing/cmsis_build/test.Release+VHT-Corstone-300.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT-Corstone-310.cprj b/Testing/cmsis_build/test.Release+VHT-Corstone-310.cprj index 3fd160489..d7f1c88c9 100644 --- a/Testing/cmsis_build/test.Release+VHT-Corstone-310.cprj +++ b/Testing/cmsis_build/test.Release+VHT-Corstone-310.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT_M0P.cprj b/Testing/cmsis_build/test.Release+VHT_M0P.cprj index a9da1994b..565e270d8 100644 --- a/Testing/cmsis_build/test.Release+VHT_M0P.cprj +++ b/Testing/cmsis_build/test.Release+VHT_M0P.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT_M23.cprj b/Testing/cmsis_build/test.Release+VHT_M23.cprj index 7efe783ee..1dbf7ff76 100644 --- a/Testing/cmsis_build/test.Release+VHT_M23.cprj +++ b/Testing/cmsis_build/test.Release+VHT_M23.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT_M3.cprj b/Testing/cmsis_build/test.Release+VHT_M3.cprj index 8491f3f17..f27d738d0 100644 --- a/Testing/cmsis_build/test.Release+VHT_M3.cprj +++ b/Testing/cmsis_build/test.Release+VHT_M3.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT_M33.cprj b/Testing/cmsis_build/test.Release+VHT_M33.cprj index f9237c464..327171086 100644 --- a/Testing/cmsis_build/test.Release+VHT_M33.cprj +++ b/Testing/cmsis_build/test.Release+VHT_M33.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT_M4.cprj b/Testing/cmsis_build/test.Release+VHT_M4.cprj index 7f56a5c73..c44605c8a 100644 --- a/Testing/cmsis_build/test.Release+VHT_M4.cprj +++ b/Testing/cmsis_build/test.Release+VHT_M4.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT_M7.cprj b/Testing/cmsis_build/test.Release+VHT_M7.cprj index dffaa0c9b..e1d9593cd 100644 --- a/Testing/cmsis_build/test.Release+VHT_M7.cprj +++ b/Testing/cmsis_build/test.Release+VHT_M7.cprj @@ -1,6 +1,6 @@ - + Automatically generated project diff --git a/Testing/cmsis_build/test.Release+VHT_M7_UNROLLED.cprj b/Testing/cmsis_build/test.Release+VHT_M7_UNROLLED.cprj index 1baacffa9..f65a85a28 100644 --- a/Testing/cmsis_build/test.Release+VHT_M7_UNROLLED.cprj +++ b/Testing/cmsis_build/test.Release+VHT_M7_UNROLLED.cprj @@ -1,6 +1,6 @@ - + Automatically generated project