This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi exeprt
I want to use do sqrt calculation in cla task. In the cla math library UG, I found that there are two realization:
1. assembly functions 2. inline functions.
in benchmarks, it seems both methods have similiar efficiency.
Does that mean I can just only include clamath.h and invoke the inline funciton without include the library?
(I found this in the UG: the inline function can only used in the background task? but in the example it seems not.
The inline C functions provide the same CLA math operations as the assembly functions, but are
written in inline C to enable their use in the type 2 CLA background task.)
Since I don't use any trigonometric functions, do I need to include rom_symbols_lib in project?
One more quesiton is that in the clamath.h, it present several realization of sqrt, by TMU, FPU, inline, .lib,
I want to know, are they all avaliable in cla code? Thanks.
Linna
Linna,
user6283973 said:I found this in the UG: the inline function can only used in the background task? but in the example it seems not.
It should say that within the background task, only the inline function can be used. The background task doesn't allow for calling functions.
Within other tasks, either the inline or the called function can be used.
user6283973 said:Does that mean I can just only include clamath.h and invoke the inline funciton without include the library?
Yes, however, if the non-inline version is included but not used it won't take up codespace. Did you have trouble doing this?
user6283973 said:Since I don't use any trigonometric functions, do I need to include rom_symbols_lib in project?
You don't. But if they are not used, they do not take up any space.
user6283973 said:One more quesiton is that in the clamath.h, it present several realization of sqrt, by TMU, FPU, inline, .lib,
I want to know, are they all avaliable in cla code? Thanks.
The #defines in the CLAmath.h translate a C28x FPU/TMU intrinsic to a CLA function. This is for code that is being migrated from the C28x FPU/TMU to the CLA.
For example:
// // TMU Intrinsics for CLA2 // #define __divf32 CLAdiv_inline #define __sqrt CLAsqrt_inline #define __sin CLAsin_inline #define __cos CLAcos_inline #define __atan CLAatan_inline #define __atan2 CLAatan2_inline #define __sinpuf32 CLAsinPU_inline #define __cospuf32 CLAcosPU_inline