Tiny Core Extensions > TCE Talk
Compiler flags and semi-portable extensions for "newer" pcs?
curaga:
SSE* can have a noticable benefit, but at the cost of dropping support for older cpus.
GCC on x86 always creates float instructions; it's up to the kernel to emulate them if there is no fpu. We have that disabled in our kernel, since it would just add size when we can have a fpu as a minimum requirement.
gerald_clark:
qopit, I for example have several machines that run 486 compatible processors.
Anything not compiled with -march=i486 will segfault.
These are not old machines either.
Many embedded computers use the 486 on a chip type processors.
Rich:
Hi curaga
I agree, gcc does a fine job when it comes to optimization. Occasionally I will reorder a sequence of instructions
based on the variables they are manipulating to see if gcc will produce smaller output. I'd say about 19 times out
of 20 there is no change because the optimization routines are that good.
Rich:
Hi qopit
When I'm looking for performance in a program I'm working on, compiler flags are the last thing I look at. In fact, even
though I've played with them on occasion out of curiosity, I always use -march=i486 -mtune=i686 -Os -Wall in the end.
If I want more performance, I look at the program to see which sections lend themselves to optimization. While gcc does
a good job of generating optimized code, a careful review of program flow in many cases will produce a much greater
performance boost than any compiler switches will. All it takes is a suboptimal algorithm, loop, or even worse, compound
loop, to produce a significant impact on performance.
qopit:
Rich:
Code quality/structure is clearly FAR more important than incremental benefits obtainable with compiler optimization. I'm mostly interested in the "best" (for performance AND compatibility) compiler settings from an academic/curiousity perspective, as well as for code which is "done" or that I don't have control over myself.
This thread, and associated side research, has been very informative on that front. Thanks, all!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version