Hi Bernard,

In mspgcc floats are functional, but have not received significant optimisation. However, a major factor in the speed difference you see may be due to the use of trig functions. If you really want to compare compilers, I suggest you try doing straightforward floating calculations, and see how they perform between the various compilers.

This isn't trying to duck the issue. It is a matter of finding where the real performance issues lie. Trig functions, especially the arc one, vary a lot due to implementation tradeoffs - size, versus speed, versus error, etc. Unless you know what they were supposed to be optimised for, it is hard to make a fair comparison. Have you tried comparing the results produced to see how the errors vary between compilers. I have no idea what you may find, but from experience with other tools there may be some surprises.

As I said, floats have not received intensive work, and when time is available it would be interesting to see how much they might be improved. As you said, mspgcc generally beats IAR on integer code size and speed, although I haven't really tried the new PF6 version. It is supposed to be somewhat better than the old version.

Regards,
Steve

Bernard Mentink wrote:

Hi All,

I am having trouble getting good performance from the maths library (libm.a). I wrote a quick (simple) benchmark program that does some simple floating point math, including an atan function, it is included below.

To measure the time taken, a scope is attached to the LED line on P1OUT/BIT4.

With the IAR compiler at fastest optimization, the loop executes at 35 times per second (35 hz). However msp430-gcc with -O2 optimization can only do 7Hz (Hardware is a x149 with a 7.3Mhz clock). This is a big difference.....

What is the state of the maths library, is it optimized?
In normal integer maths, operation etc, gcc seems to be as good as, if not faster than IAR.

Can someone verify my measurements, or comment on libm.a

Many Thanks,
Bernie Mentink




Reply via email to