Skip to content

Commit 84c1a59

Browse files
Partial correction to issue #306
MVE and scalar now behave the same for q7 and q15. They also probably behave the same for q31 but with stricter test criteria the q31 test fails. Python reference code for q31 must be looked at to confirm. Neon tests have not yet been run.
1 parent e10a010 commit 84c1a59

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Source/SupportFunctions/arm_float_to_q15.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ARM_DSP_ATTRIBUTE void arm_float_to_q15(
6868
uint32_t blockSize)
6969
{
7070
uint32_t blkCnt;
71-
float32_t maxQ = (float32_t) Q15_MAX;
71+
float32_t maxQ = (float32_t) (Q15_MAX) + 1.0f;
7272
f32x4x2_t tmp;
7373
q15x8_t vecDst = { 0 };
7474
#ifdef ARM_MATH_ROUNDING

Source/SupportFunctions/arm_float_to_q31.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ARM_DSP_ATTRIBUTE void arm_float_to_q31(
7878
uint32_t blockSize)
7979
{
8080
uint32_t blkCnt;
81-
float32_t maxQ = (float32_t) Q31_MAX;
81+
float32_t maxQ = (float32_t) (Q31_MAX) + 1.0f;
8282
f32x4_t vecDst;
8383
#ifdef ARM_MATH_ROUNDING
8484
float32_t in;

Testing/Source/Tests/SupportTestsF32.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
#define SNR_THRESHOLD 120
88
#define REL_ERROR (1.0e-5)
9-
#define ABS_Q15_ERROR ((q15_t)10)
10-
#define ABS_Q31_ERROR ((q31_t)80)
11-
#define ABS_Q7_ERROR ((q7_t)10)
9+
#define ABS_Q15_ERROR ((q15_t)0)
10+
#define ABS_Q31_ERROR ((q31_t)0)
11+
#define ABS_Q7_ERROR ((q7_t)0)
1212

1313

1414
void SupportTestsF32::test_weighted_average_f32()

0 commit comments

Comments
 (0)