summaryrefslogtreecommitdiff
path: root/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-05-03 19:53:02 +0200
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-05-03 19:53:02 +0200
commit2628932a40d769d8d0180ba6fed1e7b9b2718982 (patch)
treeea485897653003d01cd16e2b506f69363928fafa /Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions
parent972da3c0fd449dd6153edaf3c56e0c50d16b726b (diff)
downloadminikbd-2628932a40d769d8d0180ba6fed1e7b9b2718982.tar.gz
minikbd-2628932a40d769d8d0180ba6fed1e7b9b2718982.tar.bz2
minikbd-2628932a40d769d8d0180ba6fed1e7b9b2718982.zip
minkbd: repo restructure
Diffstat (limited to 'Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions')
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/abs.c53
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/add.c57
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/dot_prod.c65
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/mult.c64
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/negate.c53
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/offset.c57
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/scale.c69
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/shift.c73
-rw-r--r--Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/sub.c57
9 files changed, 0 insertions, 548 deletions
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/abs.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/abs.c
deleted file mode 100644
index baca23f..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/abs.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "ref.h"
-
-void ref_abs_f32(
- float32_t * pSrc,
- float32_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] < 0 ? -pSrc[i] : pSrc[i];
- }
-}
-
-void ref_abs_q31(
- q31_t * pSrc,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] < 0 ? -pSrc[i] : pSrc[i];
- }
-}
-
-void ref_abs_q15(
- q15_t * pSrc,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] < 0 ? -pSrc[i] : pSrc[i];
- }
-}
-
-void ref_abs_q7(
- q7_t * pSrc,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] < 0 ? -pSrc[i] : pSrc[i];
- }
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/add.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/add.c
deleted file mode 100644
index 489c8a0..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/add.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "ref.h"
-
-void ref_add_f32(
- float32_t * pSrcA,
- float32_t * pSrcB,
- float32_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrcA[i] + pSrcB[i];
- }
-}
-
-void ref_add_q31(
- q31_t * pSrcA,
- q31_t * pSrcB,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q31( (q63_t)pSrcA[i] + pSrcB[i] );
- }
-}
-
-void ref_add_q15(
- q15_t * pSrcA,
- q15_t * pSrcB,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q15( (q31_t)pSrcA[i] + pSrcB[i] );
- }
-}
-
-void ref_add_q7(
- q7_t * pSrcA,
- q7_t * pSrcB,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q7( (q15_t)pSrcA[i] + pSrcB[i] );
- }
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/dot_prod.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/dot_prod.c
deleted file mode 100644
index 08f6178..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/dot_prod.c
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "ref.h"
-
-void ref_dot_prod_f32(
- float32_t * pSrcA,
- float32_t * pSrcB,
- uint32_t blockSize,
- float32_t * result)
-{
- uint32_t i;
- float32_t sum = 0.0f;
-
- for(i=0;i<blockSize;i++)
- {
- sum += pSrcA[i] * pSrcB[i];
- }
- *result = sum;
-}
-
-void ref_dot_prod_q31(
- q31_t * pSrcA,
- q31_t * pSrcB,
- uint32_t blockSize,
- q63_t * result)
-{
- uint32_t i;
- q63_t sum = 0.0f;
-
- for(i=0;i<blockSize;i++)
- {
- sum += ((q63_t)pSrcA[i] * pSrcB[i]) >> 14; //16.48
- }
- *result = sum;
-}
-
-void ref_dot_prod_q15(
- q15_t * pSrcA,
- q15_t * pSrcB,
- uint32_t blockSize,
- q63_t * result)
-{
- uint32_t i;
- q63_t sum = 0.0f;
-
- for(i=0;i<blockSize;i++)
- {
- sum += (q31_t)pSrcA[i] * pSrcB[i]; //34.30
- }
- *result = sum;
-}
-
-void ref_dot_prod_q7(
- q7_t * pSrcA,
- q7_t * pSrcB,
- uint32_t blockSize,
- q31_t * result)
-{
- uint32_t i;
- q31_t sum = 0.0f;
-
- for(i=0;i<blockSize;i++)
- {
- sum += (q31_t)pSrcA[i] * pSrcB[i]; //18.14
- }
- *result = sum;
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/mult.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/mult.c
deleted file mode 100644
index a77c870..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/mult.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "ref.h"
-
-void ref_mult_f32(
- float32_t * pSrcA,
- float32_t * pSrcB,
- float32_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrcA[i] * pSrcB[i];
- }
-}
-
-void ref_mult_q31(
- q31_t * pSrcA,
- q31_t * pSrcB,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
- q63_t temp;
-
- for(i=0;i<blockSize;i++)
- {
- temp = ((q63_t)pSrcA[i] * pSrcB[i]) >> 32;
- temp = temp << 1;
- pDst[i] = ref_sat_q31(temp);
- }
-}
-
-void ref_mult_q15(
- q15_t * pSrcA,
- q15_t * pSrcB,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
- q31_t temp;
-
- for(i=0;i<blockSize;i++)
- {
- temp = ((q31_t)pSrcA[i] * pSrcB[i]) >> 15; //this comment is for JD, this is specifically 15 and not 16 like the q31 case might imply. This is because CMSIS DSP lib does it this way. No other reason.
- pDst[i] = ref_sat_q15(temp);
- }
-}
-
-void ref_mult_q7(
- q7_t * pSrcA,
- q7_t * pSrcB,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
- q15_t temp;
-
- for(i=0;i<blockSize;i++)
- {
- temp = ((q15_t)pSrcA[i] * pSrcB[i]) >> 7;
- pDst[i] = ref_sat_q7(temp);
- }
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/negate.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/negate.c
deleted file mode 100644
index 192da1b..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/negate.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "ref.h"
-
-void ref_negate_f32(
- float32_t * pSrc,
- float32_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = -pSrc[i];
- }
-}
-
-void ref_negate_q31(
- q31_t * pSrc,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = -pSrc[i];
- }
-}
-
-void ref_negate_q15(
- q15_t * pSrc,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = -pSrc[i];
- }
-}
-
-void ref_negate_q7(
- q7_t * pSrc,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = -pSrc[i];
- }
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/offset.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/offset.c
deleted file mode 100644
index b076e75..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/offset.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "ref.h"
-
-void ref_offset_f32(
- float32_t * pSrc,
- float32_t offset,
- float32_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] + offset;
- }
-}
-
-void ref_offset_q31(
- q31_t * pSrc,
- q31_t offset,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q31( (q63_t)pSrc[i] + offset );
- }
-}
-
-void ref_offset_q15(
- q15_t * pSrc,
- q15_t offset,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q15( (q31_t)pSrc[i] + offset );
- }
-}
-
-void ref_offset_q7(
- q7_t * pSrc,
- q7_t offset,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q7( (q15_t)pSrc[i] + offset );
- }
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/scale.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/scale.c
deleted file mode 100644
index 5ab655c..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/scale.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "ref.h"
-
-void ref_scale_f32(
- float32_t * pSrc,
- float32_t scale,
- float32_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] * scale;
- }
-}
-
-void ref_scale_q31(
- q31_t * pSrc,
- q31_t scaleFract,
- int8_t shift,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
- int8_t kShift = shift + 1; /* Shift to apply after scaling */
- int8_t sign = (kShift & 0x80);
- q63_t temp;
-
- for(i=0;i<blockSize;i++)
- {
- temp = ((q63_t) pSrc[i] * scaleFract) >> 32;
- if (sign)
- pDst[i] = temp >> -kShift;
- else
- pDst[i] = ref_sat_q31( (q63_t)temp << kShift );
- }
-}
-
-void ref_scale_q15(
- q15_t * pSrc,
- q15_t scaleFract,
- int8_t shift,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
- int8_t kShift = 15 - shift; /* Shift to apply after scaling */
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q15(((q31_t) pSrc[i] * scaleFract) >> kShift);
- }
-}
-
-void ref_scale_q7(
- q7_t * pSrc,
- q7_t scaleFract,
- int8_t shift,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
- int8_t kShift = 7 - shift; /* Shift to apply after scaling */
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q7(((q15_t) pSrc[i] * scaleFract) >> kShift);
- }
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/shift.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/shift.c
deleted file mode 100644
index 3bc53ad..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/shift.c
+++ /dev/null
@@ -1,73 +0,0 @@
-#include "ref.h"
-
-void ref_shift_q31(
- q31_t * pSrc,
- int8_t shiftBits,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- if (shiftBits < 0)
- {
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] << shiftBits;
- }
- }
- else
- {
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] >> -shiftBits;
- }
- }
-}
-
-void ref_shift_q15(
- q15_t * pSrc,
- int8_t shiftBits,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- if (shiftBits < 0)
- {
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] << shiftBits;
- }
- }
- else
- {
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] >> -shiftBits;
- }
- }
-}
-
-void ref_shift_q7(
- q7_t * pSrc,
- int8_t shiftBits,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- if (shiftBits < 0)
- {
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] << shiftBits;
- }
- }
- else
- {
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrc[i] >> -shiftBits;
- }
- }
-}
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/sub.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/sub.c
deleted file mode 100644
index da89e95..0000000
--- a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/BasicMathFunctions/sub.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "ref.h"
-
-void ref_sub_f32(
- float32_t * pSrcA,
- float32_t * pSrcB,
- float32_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = pSrcA[i] - pSrcB[i];
- }
-}
-
-void ref_sub_q31(
- q31_t * pSrcA,
- q31_t * pSrcB,
- q31_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q31( (q63_t)pSrcA[i] - pSrcB[i] );
- }
-}
-
-void ref_sub_q15(
- q15_t * pSrcA,
- q15_t * pSrcB,
- q15_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q15( (q31_t)pSrcA[i] - pSrcB[i] );
- }
-}
-
-void ref_sub_q7(
- q7_t * pSrcA,
- q7_t * pSrcB,
- q7_t * pDst,
- uint32_t blockSize)
-{
- uint32_t i;
-
- for(i=0;i<blockSize;i++)
- {
- pDst[i] = ref_sat_q7( (q15_t)pSrcA[i] - pSrcB[i] );
- }
-}