Gentoo Archives: gentoo-user

From: Shawn Haggett <podge@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] mtune=k6-2 and a *small* upgrade
Date: Wed, 09 Apr 2008 00:37:54
Message-Id: 47FC0FD2.20108@podgeweb.com
In Reply to: Re: [gentoo-user] mtune=k6-2 and a *small* upgrade by Anthony Metcalf
1 Anthony Metcalf wrote:
2 > Alan McKinnon wrote:
3 >> Now the existing system should work with your new hardware and you can
4 >> update your CFLAGS and 'emerge -e world' at your leisure.
5 >>
6 >> That's the theory at least anyway :-)
7 >>
8 >>
9 > Well, exactly. That is the theory. I want to know the likelihood of
10 > success. I know that using mtune=k6-2 means it won't run on anything
11 > before a k6-2, and most likely not on anything Intel, due to the symbols
12 > and optimisations used. What I want is some idea of the chance it will
13 > run on a *later* AMD processor. Will an Athlon honour the k6-2
14 > optimisations?
15
16 There's two points that come to mind.
17
18 1) mtune is a request for the compiler to make the code more suited to
19 the given processor, but without breaking compatibility. march is
20 telling the compiler, do everything you can to make this code fastest on
21 this processor.
22
23 From the GCC docs for 4.2.3:
24 "-mtune=cpu-type: Tune to cpu-type everything applicable about the
25 generated code, except for the ABI and the set of available instructions."
26 "-march=cpu-type: Generate instructions for the machine type cpu-type.
27 The choices for cpu-type are the same as for -mtune. Moreover,
28 specifying -march=cpu-type implies -mtune=cpu-type."
29
30 So mtune shouldn't be using any instructions that are in K-6 that
31 weren't in a 386.
32
33 2) I believe x86 hardware never goes backwards. That is, if a new
34 feature is added, all future versions of the chip have that feature,
35 just with more added. Of course Intel and AMD both have their separate
36 additions, but since your staying with AMD, moving to a new processor
37 shouldn't break anything (even if you had used march).
38
39 Disclaimer: I'm not an expert on hardware architectures or compilers, so
40 I might be wrong.
41
42 Shawn
43 --
44 gentoo-user@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-user] mtune=k6-2 and a *small* upgrade Anthony Metcalf <Anthony.Metcalf@×××××××××××.cx>