Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add architecture agnostic namespace to be used in Zephyr #53

Closed
wants to merge 1 commit into from

Conversation

yperess
Copy link

@yperess yperess commented Oct 3, 2022

Fixes #52

Signed-off-by: Yuval Peress <peress@google.com>
@yperess
Copy link
Author

yperess commented Oct 3, 2022

@christophe0606 I've uploaded this WIP PR, it's a very very small start. I just wanted to check and make sure this is what you had in mind before I do all of the headers

Copy link
Contributor

@christophe0606 christophe0606 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize that in the Include folder, lot of files should instead be in the PrivateInclude folder since they will never be used by the user of the library but are only used by the implementation.
I am creating an issue to track this and will do the change at a later time.

The public includes for which a cmsis_dsp_ wrapper is needed are:

arm_math_types.h 
arm_math_types_f16.h

arm_math.h
arm_math_f16.h

arm_const_structs.h
arm_const_structs_f16.h

arm_const_structs.h is used for old style initialization of the FFT and still used in lot of existing code in the ecosystem.

* @brief Architecture agnostic naming
* @see arm_mult_q7
*/
#define cmsis_mult_q7 arm_mult_q7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be named cmsis_dsp_mult_q7 because cmsis is the umbrella project containing several sub-projects.

#define CMSIS_MATH_SIZE_MISMATCH ARM_MATH_SIZE_MISMATH
#define CMSIS_MATH_MANIF ARM_MATH_MANIF
#define CMSIS_MATH_TEST_FAILURE ARM_MATH_TEST_FAILURE
#define CMSIS_MATH_DECOMPOSITION_FAILURE ARM_MATH_DECOMPOSITION_FAILURE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may perhaps add those to arm_math_types.h. A developer can (for instance) only include dsp/basic_math_functions.h if there is no need to include all of the headers. For instance, if the application is only using a subset of the functions.

This basic_math_functions.h is including arm_math_types.h so the developer would only have access to the ARM_MATH_ error codes without those defines.

There is no other public symbol that would need to be defined.

basic_math_functions.h is including

#include "arm_math_types.h"
#include "arm_math_memory.h"

#include "dsp/none.h"
#include "dsp/utils.h"

The arm_math_types.h doesn't have any arm_ prefix except for the error code.
The arm_math_memory.h is providing some memory functions with no arm_ prefix.

none.h is used to provide C implementation of some intrinsics when they are missing. No arm_ prefix.

utils.h is containing some functions with arm_ prefix and so may also require a few define inside. For instance

#define cmsis_dsp_div_int64_to_int32 arm_div_int64_to_int32

@yperess
Copy link
Author

yperess commented Oct 4, 2022

Thank you for the feedback, I'll update on Thursday after the holiday.

@yperess yperess closed this Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the header prefixes to be architecture agnostic
2 participants