diff --git a/Source/BasicMathFunctions/arm_scale_q15.c b/Source/BasicMathFunctions/arm_scale_q15.c
index fbad607f..95a35421 100644
--- a/Source/BasicMathFunctions/arm_scale_q15.c
+++ b/Source/BasicMathFunctions/arm_scale_q15.c
@@ -65,7 +65,7 @@ void arm_scale_q15(
uint32_t blkCnt; /* loop counters */
q15x8_t vecSrc;
q15x8_t vecDst;
-
+ q31x4_t low, high;
/* Compute 8 outputs at a time */
blkCnt = blockSize >> 3;
@@ -77,8 +77,14 @@ void arm_scale_q15(
* Scale the input and then store the result in the destination buffer.
*/
vecSrc = vld1q(pSrc);
- vecDst = vmulhq(vecSrc, vdupq_n_s16(scaleFract));
- vecDst = vqshlq_r(vecDst, shift + 1);
+ low = vmullbq_int(vecSrc, vdupq_n_s16(scaleFract));
+ low = vqshlq_r(low, shift);
+ vecDst = vqshrnbq_n_s32(vecDst,low,15);
+
+ high = vmulltq_int(vecSrc, vdupq_n_s16(scaleFract));
+ high = vqshlq_r(high, shift);
+ vecDst = vqshrntq_n_s32(vecDst,high,15);
+
vst1q(pDst, vecDst);
/*
* Decrement the blockSize loop counter
@@ -96,10 +102,15 @@ void arm_scale_q15(
blkCnt = blockSize & 7;
if (blkCnt > 0U)
{
- mve_pred16_t p0 = vctp16q(blkCnt);;
+ mve_pred16_t p0 = vctp16q(blkCnt);
vecSrc = vld1q(pSrc);
- vecDst = vmulhq(vecSrc, vdupq_n_s16(scaleFract));
- vecDst = vqshlq_r(vecDst, shift + 1);
+ low = vmullbq_int(vecSrc, vdupq_n_s16(scaleFract));
+ low = vqshlq_r(low, shift);
+ vecDst = vqshrnbq_n_s32(vecDst,low,15);
+
+ high = vmulltq_int(vecSrc, vdupq_n_s16(scaleFract));
+ high = vqshlq_r(high, shift);
+ vecDst = vqshrntq_n_s32(vecDst,high,15);
vstrhq_p(pDst, vecDst, p0);
}
diff --git a/Source/BasicMathFunctions/arm_scale_q31.c b/Source/BasicMathFunctions/arm_scale_q31.c
index 4e28441b..5f086bad 100644
--- a/Source/BasicMathFunctions/arm_scale_q31.c
+++ b/Source/BasicMathFunctions/arm_scale_q31.c
@@ -48,7 +48,12 @@
@par Scaling and Overflow Behavior
The input data *pSrc and scaleFract are in 1.31 format.
- These are multiplied to yield a 2.62 intermediate result and this is shifted with saturation to 1.31 format.
+ These are multiplied to yield a 2.62 intermediate result and this is shifted
+ with saturation to 1.31 format.
+ There is an intermediate shift by 32 to go from the
+ 2.62 to 1.31 format.
+ The shift argument is applied on the 1.31 result and not to the intermediate
+ 2.62 format.
*/
#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
diff --git a/Source/BasicMathFunctions/arm_scale_q7.c b/Source/BasicMathFunctions/arm_scale_q7.c
index 5bb4580f..c8ba5053 100644
--- a/Source/BasicMathFunctions/arm_scale_q7.c
+++ b/Source/BasicMathFunctions/arm_scale_q7.c
@@ -55,7 +55,6 @@
#include "arm_helium_utils.h"
-
void arm_scale_q7(
const q7_t * pSrc,
q7_t scaleFract,
@@ -66,6 +65,7 @@ void arm_scale_q7(
uint32_t blkCnt; /* loop counters */
q7x16_t vecSrc;
q7x16_t vecDst;
+ q15x8_t low, high;
/* Compute 16 outputs at a time */
@@ -78,8 +78,14 @@ void arm_scale_q7(
* Scale the input and then store the result in the destination buffer.
*/
vecSrc = vld1q(pSrc);
- vecDst = vmulhq(vecSrc, vdupq_n_s8(scaleFract));
- vecDst = vqshlq_r(vecDst, shift + 1);
+
+ low = vmullbq_int(vecSrc, vdupq_n_s8(scaleFract));
+ low = vqshlq_r(low, shift);
+ vecDst = vqshrnbq_n_s16(vecDst,low,7);
+ high = vmulltq_int(vecSrc, vdupq_n_s8(scaleFract));
+ high = vqshlq_r(high, shift);
+ vecDst = vqshrntq_n_s16(vecDst,high,7);
+
vst1q(pDst, vecDst);
/*
* Decrement the blockSize loop counter
@@ -99,9 +105,16 @@ void arm_scale_q7(
{
mve_pred16_t p0 = vctp8q(blkCnt);
vecSrc = vld1q(pSrc);
- vecDst = vmulhq(vecSrc, vdupq_n_s8(scaleFract));
- vecDst = vqshlq_r(vecDst, shift + 1);
- vstrbq_p(pDst, vecDst, p0);
+ low = vmullbq_int_s8(vecSrc, vdupq_n_s8(scaleFract));
+ low = vqshlq_r(low, shift);
+ vecDst = vqshrnbq_n_s16(vecDst,low,7);
+
+ high = vmulltq_int_s8(vecSrc, vdupq_n_s8(scaleFract));
+ high = vqshlq_r(high, shift);
+ vecDst = vqshrntq_n_s16(vecDst,high,7);
+
+ /* narrowing & merge */
+ vstrbq_p_s8(pDst, vecDst, p0);
}
}
diff --git a/Testing/cmsis_build/.gitignore b/Testing/cmsis_build/.gitignore
new file mode 100644
index 00000000..631ea102
--- /dev/null
+++ b/Testing/cmsis_build/.gitignore
@@ -0,0 +1,3 @@
+out/
+results*.txt
+*.html
diff --git a/Testing/cmsis_build/RTE/_test.Release_VHT_M7_UNROLLED/RTE_Components.h b/Testing/cmsis_build/RTE/_test.Release_VHT_M7_UNROLLED/RTE_Components.h
new file mode 100644
index 00000000..3e726945
--- /dev/null
+++ b/Testing/cmsis_build/RTE/_test.Release_VHT_M7_UNROLLED/RTE_Components.h
@@ -0,0 +1,21 @@
+
+/*
+ * Auto generated Run-Time-Environment Configuration File
+ * *** Do not modify ! ***
+ *
+ * Project: 'test.Release+VHT_M7_UNROLLED'
+ * Target: 'test.Release+VHT_M7_UNROLLED'
+ */
+
+#ifndef RTE_COMPONENTS_H
+#define RTE_COMPONENTS_H
+
+
+/*
+ * Define the Device Header File:
+ */
+#define CMSIS_device_header "ARMCM7_DP.h"
+
+
+
+#endif /* RTE_COMPONENTS_H */
diff --git a/Testing/cmsis_build/boot.clayer.yml b/Testing/cmsis_build/boot.clayer.yml
new file mode 100644
index 00000000..7696bbc0
--- /dev/null
+++ b/Testing/cmsis_build/boot.clayer.yml
@@ -0,0 +1,49 @@
+layer:
+ # name: boot
+ description: Boot code for Virtual Hardware
+
+
+
+ components:
+ - component: Device:Startup&C Startup
+ not-for-type:
+ - +VHT-Corstone-300
+ - +VHT-Corstone-310
+ - +FVP_A5Neon
+ - +FVP_A7Neon
+ - +FVP_A9Neon
+ - component: Device:Startup
+ for-type:
+ - +FVP_A5Neon
+ - +FVP_A7Neon
+ - +FVP_A9Neon
+ - component: Device:IRQ Controller
+ for-type:
+ - +FVP_A5Neon
+ - +FVP_A7Neon
+ - +FVP_A9Neon
+ - component: Device:OS Tick
+ for-type:
+ - +FVP_A5Neon
+ - +FVP_A7Neon
+ - +FVP_A9Neon
+ - component: ARM::Device:Definition
+ for-type:
+ - +VHT-Corstone-300
+ - +VHT-Corstone-310
+ - component: ARM::Device:Startup&Baremetal
+ for-type:
+ - +VHT-Corstone-300
+ - +VHT-Corstone-310
+ - component: ARM::Native Driver:Timeout
+ for-type:
+ - +VHT-Corstone-300
+ - +VHT-Corstone-310
+ - component: ARM::Native Driver:SysCounter
+ for-type:
+ - +VHT-Corstone-300
+ - +VHT-Corstone-310
+ - component: ARM::Native Driver:SysTimer
+ for-type:
+ - +VHT-Corstone-300
+ - +VHT-Corstone-310
diff --git a/Testing/cmsis_build/build.bat b/Testing/cmsis_build/build.bat
new file mode 100644
index 00000000..3f9d4db7
--- /dev/null
+++ b/Testing/cmsis_build/build.bat
@@ -0,0 +1,14 @@
+ECHO OFF
+cbuild "test.Release+VHT_M0P.cprj"
+cbuild "test.Release+VHT_M23.cprj"
+cbuild "test.Release+VHT_M3.cprj"
+cbuild "test.Release+VHT_M4.cprj"
+cbuild "test.Release+VHT_M7.cprj"
+cbuild "test.Release+VHT_M7_UNROLLED.cprj"
+cbuild "test.Release+VHT_M33.cprj"
+cbuild "test.Release+VHT-Corstone-300.cprj"
+cbuild "test.Release+VHT-Corstone-310.cprj"
+cbuild "test.Release+FVP_M55.cprj"
+REM cbuild "test.Release+FVP_A5Neon.cprj"
+REM cbuild "test.Release+FVP_A7Neon.cprj"
+REM cbuild "test.Release+FVP_A9Neon.cprj"
diff --git a/Testing/cmsis_build/build.sh b/Testing/cmsis_build/build.sh
deleted file mode 100644
index ac618d1a..00000000
--- a/Testing/cmsis_build/build.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# cbuild "test.Release+VHT_M0P.cprj" --outdir=Objects --intdir=Tmp
-# cbuild "test.Release+VHT_M23.cprj" --outdir=Objects --intdir=Tmp
-# cbuild "test.Release+VHT_M3.cprj" --outdir=Objects --intdir=Tmp
-# cbuild "test.Release+VHT_M4.cprj" --outdir=Objects --intdir=Tmp
-# cbuild "test.Release+VHT_M7.cprj" --outdir=Objects --intdir=Tmp
-# cbuild "test.Release+VHT_M33.cprj" --outdir=Objects --intdir=Tmp
-cbuild "test.Release+VHT-Corstone-300.cprj" --outdir=Objects --intdir=Tmp
-# cbuild "test.Release+VHT-Corstone-310.cprj" --outdir=Objects --intdir=Tmp
-# cbuild "test.Release+FVP_M55.cprj" --outdir=Objects --intdir=Tmp
-
-#cbuild "test.Release+FVP_A5Neon.cprj" --outdir=Objects --intdir=Tmp
-#cbuild "test.Release+FVP_A7Neon.cprj" --outdir=Objects --intdir=Tmp
-#cbuild "test.Release+FVP_A9Neon.cprj" --outdir=Objects --intdir=Tmp
diff --git a/Testing/cmsis_build/buildsolution.bat b/Testing/cmsis_build/buildsolution.bat
new file mode 100644
index 00000000..b9beb208
--- /dev/null
+++ b/Testing/cmsis_build/buildsolution.bat
@@ -0,0 +1,3 @@
+ECHO OFF
+csolution convert -s testac6.csolution.yml
+REM csolution convert -s testgcc.csolution.yml
diff --git a/Testing/cmsis_build/buildsolution.sh b/Testing/cmsis_build/buildsolution.sh
deleted file mode 100644
index e8518ba6..00000000
--- a/Testing/cmsis_build/buildsolution.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-csolution convert -s test.csolution_ac6.yml
-csolution convert -s test.csolution_gcc.yml
diff --git a/Testing/cmsis_build/check.bat b/Testing/cmsis_build/check.bat
new file mode 100644
index 00000000..538a5aba
--- /dev/null
+++ b/Testing/cmsis_build/check.bat
@@ -0,0 +1,30 @@
+ECHO OFF
+ECHO "M0P"
+python ..\processResult.py -f ..\Output.pickle -e -r results_m0p.txt -html > m0p.html
+
+ECHO "M23"
+python ..\processResult.py -f ..\Output.pickle -e -r results_m23.txt -html > m23.html
+
+ECHO "M3"
+python ..\processResult.py -f ..\Output.pickle -e -r results_m3.txt -html > m3.html
+
+ECHO "M4"
+python ..\processResult.py -f ..\Output.pickle -e -r results_m4.txt -html > m4.html
+
+ECHO "M7"
+python ..\processResult.py -f ..\Output.pickle -e -r results_m7.txt -html > m7.html
+
+ECHO "M7 unrolled"
+python ..\processResult.py -f ..\Output.pickle -e -r results_m7_unrolled.txt -html > m7_unrolled.html
+
+ECHO "M33"
+python ..\processResult.py -f ..\Output.pickle -e -r results_m33.txt -html > m33.html
+
+ECHO "CS300"
+python ..\processResult.py -f ..\Output.pickle -e -r results_cs300.txt -html > cs300.html
+
+ECHO "CS300 U55"
+python ..\processResult.py -f ..\Output.pickle -e -r results_cs300_u55.txt -html > cs300_u55.html
+
+ECHO "CS310"
+python ..\processResult.py -f ..\Output.pickle -e -r results_cs310.txt -html > cs310.html
\ No newline at end of file
diff --git a/Testing/cmsis_build/dsp.clayer.yml b/Testing/cmsis_build/dsp.clayer.yml
new file mode 100644
index 00000000..fbcacf38
--- /dev/null
+++ b/Testing/cmsis_build/dsp.clayer.yml
@@ -0,0 +1,40 @@
+layer:
+ description: CMSIS-DSP
+
+
+ add-path:
+ - ../../Include
+ - ../../PrivateInclude
+
+ groups:
+ - group: CMSIS-DSP
+ files:
+ - file: ../../Source/BasicMathFunctions/BasicMathFunctions.c
+ - file: ../../Source/BasicMathFunctions/BasicMathFunctionsF16.c
+ - file: ../../Source/DistanceFunctions/DistanceFunctions.c
+ - file: ../../Source/DistanceFunctions/DistanceFunctionsF16.c
+ - file: ../../Source/MatrixFunctions/MatrixFunctions.c
+ - file: ../../Source/MatrixFunctions/MatrixFunctionsF16.c
+ - file: ../../Source/BayesFunctions/BayesFunctions.c
+ - file: ../../Source/BayesFunctions/BayesFunctionsF16.c
+ - file: ../../Source/FastMathFunctions/FastMathFunctions.c
+ - file: ../../Source/FastMathFunctions/FastMathFunctionsF16.c
+ - file: ../../Source/QuaternionMathFunctions/QuaternionMathFunctions.c
+ - file: ../../Source/StatisticsFunctions/StatisticsFunctions.c
+ - file: ../../Source/StatisticsFunctions/StatisticsFunctionsF16.c
+ - file: ../../Source/CommonTables/CommonTables.c
+ - file: ../../Source/CommonTables/CommonTablesF16.c
+ - file: ../../Source/FilteringFunctions/FilteringFunctions.c
+ - file: ../../Source/FilteringFunctions/FilteringFunctionsF16.c
+ - file: ../../Source/SupportFunctions/SupportFunctions.c
+ - file: ../../Source/SupportFunctions/SupportFunctionsF16.c
+ - file: ../../Source/ComplexMathFunctions/ComplexMathFunctions.c
+ - file: ../../Source/ComplexMathFunctions/ComplexMathFunctionsF16.c
+ - file: ../../Source/SVMFunctions/SVMFunctions.c
+ - file: ../../Source/SVMFunctions/SVMFunctionsF16.c
+ - file: ../../Source/InterpolationFunctions/InterpolationFunctions.c
+ - file: ../../Source/InterpolationFunctions/InterpolationFunctionsF16.c
+ - file: ../../Source/TransformFunctions/TransformFunctions.c
+ - file: ../../Source/TransformFunctions/TransformFunctionsF16.c
+ - file: ../../Source/ControllerFunctions/ControllerFunctions.c
+
\ No newline at end of file
diff --git a/Testing/cmsis_build/runarmds.bat b/Testing/cmsis_build/runarmds.bat
index d0b5ccf6..ad01d0c3 100644
--- a/Testing/cmsis_build/runarmds.bat
+++ b/Testing/cmsis_build/runarmds.bat
@@ -1,11 +1,11 @@
-REM "C:\Program Files\ARM\Development Studio 2022.0\bin\FVP_VE_Cortex-A5x1.exe" ^
-REM -f configs/ARMCA5neon_config.txt ^
-REM Objects\test.Release+FVP_A5Neon.axf
+"C:\Program Files\ARM\Development Studio 2022.0\bin\FVP_VE_Cortex-A5x1.exe" ^
+ -f configs/ARMCA5neon_config.txt ^
+ Objects\test.Release+FVP_A5Neon.axf > results_a5.txt
-REM "C:\Program Files\ARM\Development Studio 2022.0\bin\FVP_VE_Cortex-A7x1.exe" ^
-REM -f configs/ARMCA7neon_config.txt ^
-REM Objects\test.Release+FVP_A7Neon.axf
+"C:\Program Files\ARM\Development Studio 2022.0\bin\FVP_VE_Cortex-A7x1.exe" ^
+ -f configs/ARMCA7neon_config.txt ^
+ Objects\test.Release+FVP_A7Neon.axf > results_a7.txt
"C:\Program Files\ARM\Development Studio 2022.0\bin\FVP_VE_Cortex-A9x1.exe" ^
-f configs/ARMCA9neon_config.txt ^
- Objects\test.Release+FVP_A9Neon.axf
\ No newline at end of file
+ Objects\test.Release+FVP_A9Neon.axf > results_a9.txt
\ No newline at end of file
diff --git a/Testing/cmsis_build/runkeil.bat b/Testing/cmsis_build/runkeil.bat
index e6ea2aba..812e14e8 100644
--- a/Testing/cmsis_build/runkeil.bat
+++ b/Testing/cmsis_build/runkeil.bat
@@ -1,40 +1,42 @@
-REM C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M0plus.exe ^
-REM -f configs/ARM_VHT_MPS2_M0plus_config.txt ^
-REM Objects\test.Release+VHT_M0P.axf
+ECHO OFF
+C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M0plus.exe ^
+ -f configs/ARM_VHT_MPS2_M0plus_config.txt ^
+ out\test\VHT_M0P\Release\test.Release+VHT_M0P.axf > results_m0p.txt
-REM C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M23.exe ^
-REM -f configs/ARM_VHT_MPS2_M23_config.txt ^
-REM Objects\test.Release+VHT_M23.axf
+C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M23.exe ^
+ -f configs/ARM_VHT_MPS2_M23_config.txt ^
+ out\test\VHT_M23\Release\test.Release+VHT_M23.axf > results_m23.txt
-REM C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M3.exe ^
-REM -f configs/ARM_VHT_MPS2_M3_config.txt ^
-REM Objects\test.Release+VHT_M3.axf
+C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M3.exe ^
+ -f configs/ARM_VHT_MPS2_M3_config.txt ^
+ out\test\VHT_M3\Release\test.Release+VHT_M3.axf > results_m3.txt
-REM C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M4.exe ^
-REM -f configs/ARM_VHT_MPS2_M4FP_config.txt ^
-REM Objects\test.Release+VHT_M4.axf
+C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M4.exe ^
+ -f configs/ARM_VHT_MPS2_M4FP_config.txt ^
+ out\test\VHT_M4\Release\test.Release+VHT_M4.axf > results_m4.txt
-REM C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M7.exe ^
-REM -f configs/ARM_VHT_MPS2_M7DP_config.txt ^
-REM Objects\test.Release+VHT_M7.axf
+C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M7.exe ^
+ -f configs/ARM_VHT_MPS2_M7DP_config.txt ^
+ out\test\VHT_M7\Release\test.Release+VHT_M7.axf > results_m7.txt
-REM C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M33.exe ^
-REM -f configs/ARM_VHT_MPS2_M33_DSP_FP_config.txt ^
-REM -a cpu0="Objects\test.Release+VHT_M33.axf"
+C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M7.exe ^
+ -f configs/ARM_VHT_MPS2_M7DP_config.txt ^
+ out\test\VHT_M7_UNROLLED\Release\test.Release+VHT_M7_UNROLLED.axf > results_m7_unrolled.txt
-REM C:\Keil_v5\ARM\VHT\VHT_MPS3_Corstone_SSE-300.exe ^
-REM -f configs/ARM_VHT_Corstone_300_config.txt ^
-REM -a cpu0="Objects\test.Release+VHT-Corstone-300.axf"
+C:\Keil_v5\ARM\VHT\VHT_MPS2_Cortex-M33.exe ^
+ -f configs/ARM_VHT_MPS2_M33_DSP_FP_config.txt ^
+ -a cpu0="out\test\VHT_M33\Release\test.Release+VHT_M33.axf" > results_m33.txt
+
+C:\Keil_v5\ARM\VHT\VHT_MPS3_Corstone_SSE-300.exe ^
+ -f configs/ARM_VHT_Corstone_300_config.txt ^
+ -a cpu0="out\test\VHT-Corstone-300\Release\test.Release+VHT-Corstone-300.axf" > results_cs300.txt
-REM C:\Keil_v5\ARM\VHT\VHT_Corstone_SSE-310.exe ^
-REM -f configs/ARM_VHT_Corstone_310_config.txt ^
-REM -a cpu0="Objects\test.Release+VHT-Corstone-310.axf"
+
+C:\Keil_v5\ARM\VHT\VHT_Corstone_SSE-310.exe ^
+ -f configs/ARM_VHT_Corstone_310_config.txt ^
+ -a cpu0="out\test\VHT-Corstone-310\Release\test.Release+VHT-Corstone-310.axf" > results_cs310.txt
C:\Keil_v5\ARM\VHT\VHT_Corstone_SSE-300_Ethos-U55.exe ^
-f configs/ARM_VHT_Corstone_300_config.txt ^
- -a cpu0="Objects\test.Release+VHT-Corstone-300.axf"
-
-REM C:\Keil_v5\ARM\FVP\MPS2_Cortex-M\FVP_MPS2_Cortex-M55_MDK.exe ^
-REM -f configs/ARM_VHT_MPS2_M55_config.txt ^
-REM Objects\test.Release+FVP_M55.axf
\ No newline at end of file
+ -a cpu0="out\test\VHT-Corstone-300\Release\test.Release+VHT-Corstone-300.axf" > results_cs300_u55.txt
diff --git a/Testing/cmsis_build/test.Release+FVP_A5Neon.cprj b/Testing/cmsis_build/test.Release+FVP_A5Neon.cprj
index 5b4531b6..ba0deb8d 100644
--- a/Testing/cmsis_build/test.Release+FVP_A5Neon.cprj
+++ b/Testing/cmsis_build/test.Release+FVP_A5Neon.cprj
@@ -1,42 +1,38 @@