cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, Are There Virtual Floating Point Libraries Equivalent To The IQ Math Library Of Texas Instruments? Are there alternative ways to implement floating point representations on fixed STM32?

ben5en
Associate II
 
6 REPLIES 6

It is a micro-controller, it will do whatever the software you construct facilitates.

ARM has CMSIS DSP libraries, other code and libraries presumably can be ported.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ozone
Lead II

Almost all toolchains come with the appropriate libraries (soft, softfp and hard).

TI's IQ lib is, AFAIK, more about optimisation.

Besides of certain compiler specific points, it should be easily portable to other Cortex M MCUs. Legal issues aside.

S.Ma
Principal

Don't know about TI specifics. For the second question, C compilers come with libraries to manage float or double format.

STM32F4 have floating coprocessor (float 32 bit type) by HW

STM32F76x have double floating coprocessor (double 64 bit) by HW

Look into the project compiler properties/settings.

Singh.Harjit
Senior II

I'm not familiar with TI's IQ library, so, if this is off base, my apologies in advance.

Take a look at this post: https://blog.segger.com/floating-point-face-off/. Perhaps that will get you close enough to what you need.

ben5en
Associate II

Good evening and many thanks for the many, quick answers. Of course, I know that I can write to almost every microcontroller float calculation in C and the compiler translates accordingly.

But that was not the intension of my question and maybe I put it too unspecifically: The TI IQ Math library is an abstract layer, which sets x bits for the integer part according to the selected IQ format and sets y bits for the fractional part. In this way you can calculate with float in an abstract layer, but in the controller itself it does fast fixed-point arithmetic operations.

The calculations are correspondingly faster. An example:

_iq a = _IQ(0.23);      // is a handled as a int32_t

_iq b = _IQ(2.87);      // is a handled as a int32_t

_iq c = _IQmpy (a, b);

requires less computing time than:

float32_t a = 0.23;

float32_t b = 2.87;

float32_t c = a * b;

on a controller without a HW FPU. And the question refers to a STM32 controller without fpu…

Here I see significant advantages in the use of the IQ Lib of TI on an C2000 or MSP430 in terms of the computing time. Should I be wrong or there are other comparable approaches for a fixed point controller, I would be glad about further answers. Thank you very much.

Bob S
Principal

As @Community member​ mentioned, there are ARM CMSIS DSP libraries and they support fixed point, but I don't think they support a mixture of any precision and mixtures of precision. See AN4841 (https://www.st.com/resource/en/application_note/dm00273990.pdf) and/or the DSP Demo Cube expansion pack (https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-dspdemo.html#resource).