madhat1
madhat1

Reputation: 704

Is fixed point math faster than floating point on armv7-a?

Do libraries like libfixmath perform better than arm FP and NEON or is there no gain from fixed point over existing FP hw?

I'm considering converting all instances of float in my code to a fixed point C++ class (similar to libfixmath) to optimize in terms of run-time an algorithm running on a Cortex-A9. The question is whether someone has any experience with this.

Current results with several fixed-point implementations both on Intel-i5 and on ARM-Cortex-A9 didn't show any improvement with fixed-point over floating point HW.

Upvotes: 0

Views: 1864

Answers (1)

Usually, fixed is much faster than float because :

  • integer instructions require much less cycles
  • the latency is much lower
  • no conversion necessary

However, if you are dealing with 32bit source data, thus requiring 64bit math, you might be better served with float since long integer operations require more cycles, registers, and instructions.

It rather depends on the source/target data type : when they are both integer, fixed is much better. If not, stick to float.

Upvotes: 1

Related Questions