2024-06-10 01:38 AM
Hello,
I am dealing with fixed-point arithmetic calculations on STM32G0.
To avoid integer overflow risks I have scaled properly all the values involved in calculations, but a mistake can be always possible...
On Texas Instruments DSPs, I have the possibility to switch the integer overflow mode, from wrap to saturate, thanks to a couple of intrinsic instructions.
Is there such a possibility also on Cortex processors (and in particular on Cortex M0+)?
Thank you,
Carlo
Solved! Go to Solution.
2024-06-10 08:19 AM - edited 2024-06-10 08:20 AM
There is no saturation support in M0 /M0+ core but I think it's supported by other Cortex-M like M33:
2024-06-10 01:49 AM
Hello,
https://community.st.com/t5/stm32-mcus-products/32-sum-with-saturation/td-p/467407
https://www.eevblog.com/forum/microcontrollers/converting-to-cortex-m0-asm/
2024-06-10 07:36 AM
Thank you @SofLit.
So there isn't an hardware support on Cortex-M processors to switch the integer overflow from wrap mode to saturate mode, like TI.
It must be handled by software...
Regards,
Carlo
2024-06-10 08:19 AM - edited 2024-06-10 08:20 AM
There is no saturation support in M0 /M0+ core but I think it's supported by other Cortex-M like M33:
2024-06-10 11:47 PM
Thank you for informations.
Regards,
Carlo