ARM-software / CMSIS_5

CMSIS Version 5 Development Repository
http://arm-software.github.io/CMSIS_5/index.html
Apache License 2.0
1.33k stars 1.08k forks source link

DSP: Issues with some matrix sources #1169

Closed TTornblom closed 3 years ago

TTornblom commented 3 years ago

While compiling the DSP libraries for IAR I ran into a few apparent bugs. Not sure how these got through for the other toolchains, but it might be a config issue.

https://github.com/ARM-software/CMSIS_5/blob/a4168d3ca5c4e2bf0cb3da7275884c97b97843a2/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f64.c#L91

This line seems bad. "pp" is a pointer to a uint16_t, not a structure.

The same with line 383

Same here: https://github.com/ARM-software/CMSIS_5/blob/a4168d3ca5c4e2bf0cb3da7275884c97b97843a2/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f32.c#L383

https://github.com/ARM-software/CMSIS_5/blob/a4168d3ca5c4e2bf0cb3da7275884c97b97843a2/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f16.c#L165

No identifier "ut" here

or here: https://github.com/ARM-software/CMSIS_5/blob/a4168d3ca5c4e2bf0cb3da7275884c97b97843a2/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f32.c#L264

or here: https://github.com/ARM-software/CMSIS_5/blob/a4168d3ca5c4e2bf0cb3da7275884c97b97843a2/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f64.c#L58

JonatanAntoni commented 3 years ago

This code seems to have more issues, e.g.

https://github.com/ARM-software/CMSIS_5/blob/a4168d3ca5c4e2bf0cb3da7275884c97b97843a2/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f64.c#L92

This looks like copy-paste-issue. Might be worth to apply some sort of static code analysis.

christophe0606 commented 3 years ago

@TTornblom You're right. The config with ARM_MATH_SIZE_MISMATCH is generally the one I test last. And you tested it before me. There are some build issues. I am working on it.

christophe0606 commented 3 years ago

@TTornblom It should now be corrected in commit https://github.com/ARM-software/CMSIS_5/commit/6f8bea76ff635d6f5adb5858525fc802bd2bef80