Soroush Rabiei
Soroush Rabiei

Reputation: 10868

Optimization issue

I'm developing a controller program used to run a humanoid kidsize robot. The OS is debian 6 and whole programs are written in C++11. CPU is a 1GHz VorteX86 SD and its architecture is Intel i486.

I need to compile my code with maximum possible optimization. currently I'm using gcc with 3rd level optimization flag and i486 optimization tunning:

g++ -std=c++0x -O3 -march=i486 -mtunes=i486

I'm wondering if its possible to gain more optimized code or not. I searched around about optimization flags and compiler benchmarks, but didn't find any...

My question is which compiler for C++ is generates faster code? Specially for i486 architecture.

Current candidates are: ICC XE, GCC 4.6, EkoPath

Upvotes: 1

Views: 322

Answers (2)

linello
linello

Reputation: 8694

An option which typically makes the code faster is -funroll-loops

Upvotes: 2

Sebastian Mach
Sebastian Mach

Reputation: 39089

See the documentation. There are too many permutations to test them all; maybe give Acovea a try, which tests for the best one with a genetic approach.

If you have many floating points optimizations, you may try -ffast-math or -Ofast, which includes -ffast-math. However, you lose IEEE floating math compliance.

Upvotes: 1

Related Questions