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.
Tool/software: TI C/C++ Compiler
Dear TI forum ,
I have some questions related to TI C/C++ compiler for c2000 platform
1. Is there any drawback on using float32_t type for code sections which are running under c28x cpu ? Or Should I use float instead
2. CLAmath.h library has a function named fminf does it work like the following Macro ?
#ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif
If it does work then which one is advised to be used for code sections running under c28x cpu?
3. Overall Is there any drawback on Using CLAMath.h library for code sections running under c28x mcu ?
Hassin Ayaz said:1. Is there any drawback on using float32_t type for code sections which are running under c28x cpu ? Or Should I use float instead
Datatypes for the C28x and the CLA are described in the Compiler User's Guide - http://www.ti.com/lit/spru514. on both CPUs the float type is 32-bit. float32_t is another way of writing this (it is just a typedef for float) to make it clear to the reader of the size. For example "double" is 64-bit on some CPUs and 32-bit on others. Using float32_t and float64_t makes it clear. I recommend using the size specific typedefs for this reason.
Hassin Ayaz said:2. CLAmath.h library has a function named fminf does it work like the following Macro ?
fminf calls the CLA compiler's intrinsic __minf32. Refer to the Compiler User's Guide for the definition. (table 10-1)
Hassin Ayaz said:If it does work then which one is advised to be used for code sections running under c28x cpu?
There are similar intrinsics for the C28x FPU - (Table 7.7 of the user's guide)
Hassin Ayaz said:3. Overall Is there any drawback on Using CLAMath.h library for code sections running under c28x mcu ?
I don't recommend doing this. There are equivalents for the C28x FPU.
Dear Lori Heustess
Thanks A lot for the Answer , I have found the function needed from the mentioned table 10-1