Fwd: GCC Optimization for expressions

Nirav Shah nirav4ever4u@gmail.com
Sun Nov 30 19:36:00 GMT 2008


Hi,

I am having a complicated mathematical expression to compute. What
would be a good way to compute it?
1. Should I write a single statement with many mathematical operations
in same statement? or
2. Fragment the expression and compute one operation in each step and
storing partial results in local variables and using them in
subsequent operations?

Readability or maintainability is not an issue for me. I want
performance as high as possible, in terms of less clock cycles, low
cache misses and low memory access. Even few clock cycle save or few
less cache misses or memory access would be big benefits to me.



Regards,
Nirav Shah.



More information about the Gcc-help mailing list