Difference between --target=i386 and i686

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When compiling gcc (and binutils) for x86 targets, what is the difference
between specifying --target=i386 vs i486 vs i586 etc? How does it affect
code generation exactly?

As a test I've built toolchains with both i386 and i686, and compiled a
program with both. I'm looking for cmov instructions since a 386 wouldn't
support those.

i386-gcc            : no cmov
i686-gcc            : cmov
i386-gcc -march=i686: cmov
i686-gcc -march=i386: cmov (!)

So it looks like gcc compiled with --target=i686-* is incapable of producing
i386 code, and --target=i386-* is the most versatile option for backwards
compatibility with older cpus. Are there any disadvantages (reduced
optimization, etc) to using an i386-gcc with -march=i686 when compiling for
"newer" systems?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux