Benefit of Cortex-M4F

Embedded systems gurus always repeated: don’t use floating-point numbers in your firmware! But what if you have processor with a FPU? Well, then you simply can. Do not forget, however, to carefully look at your disassembly file, as always.

So this is what we get with GCC 4.6.2 on Cortex-M3:

And this is output from the same GCC version on Cortex-M4F (compiled with flags -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -fsingle-precision-constant):

This is the difference, isn’t it?

08. July 2012 by resset
Categories: Electronics, Software | Tags: , , , | Leave a comment

Leave a Reply

Required fields are marked *