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

Re: Debian x86 32-bits built for i586 !?



On Sun, May 15, 2011 at 09:28:05AM -0300, Henrique de Moraes Holschuh wrote:
> What are the *exact* differences between code generated for march=i486
> to code generated for march=i586?  What CPUs would break?

With -march=i586, code will be generated that runs on a Pentium without
MMX (or later chips) instead of code that runs on any i486 or better.
The extra instructions are CMPXCHG8B, CPUID, RDMSR, WRMSR, RDTSC, and
MOV (when it's used with a control register)[0].  AIUI, some IDT
Winchips do not support these instructions either.

With -march=i486, the code will work on any 32-bit or 64-bit x86
processor other than the i386 itself.  We originally switched to
generating code for the i486 because it was needed for certain C++
support in GCC and libstdc++, although that is no longer the case, IIRC.

The -march use, which specifies which instructions may be generated, is
different from -mtune, which specifies for which processor the
instructions are scheduled.  -mtune has been set to i686 (since most
32-bit processors these days are i686) and tuning for the i586 is a bad
idea since it was designed for executing 16-bit code efficiently, not
32-bit code.  I believe the -mtune value should remain i686.

[0] http://www.singlix.com/trdos/pentium.txt

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature


Reply to: