On Tue, May 24, 2011 at 2:32 AM, Pandu Poluan <pa...@poluan.info> wrote: > WHOA... lots of nice ideas here... > > On Tue, May 24, 2011 at 09:44, Fabiano - deStilaDo > <fabianoeng...@gmail.com> wrote: >> For example, if you have intel and amd server you can optimize to >> i686. I like better this approach on more homogeneous setups, like >> everything optimized for say core 2. > > Core 2 optimizations work for AMD Opterons?
By homogeneous setup I meant, if all servers are Core 2, you can obviously take advantage of this by optimizing everything to Core 2. But since you asked if Core 2 optimizations work for AMD Opteron, well it /may/, depends. There are two levels of instruction (cpu) optimization on GCC, -march and -mtune. -march controls what instructions the compiler can produce, so this breaks binary compatibility. For example, trying to run a binary compiled with -march=core2 on an AMD processor should fail, as the binary may have instructions not implemented by AMD. And there is -mtune optimization level, this optimization is restricted by the instruction set specified by -march, and thus is binary compatible with it. For example, you can compile the binaries with -march=i686 and -mtune=core2, now it run on both Intel and AMD, but will be more optimized for Core 2 processors but should run on any processor that implements i686 and above, like k6 and pentium pro. Fabiano.