Gentoo Archives: gentoo-dev

From: Paul de Vrieze <pauldv@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Question about mcpu, mtune and march
Date: Mon, 23 Aug 2004 12:22:38
Message-Id: 200408231420.59826.pauldv@gentoo.org
In Reply to: Re: [gentoo-dev] Question about mcpu, mtune and march by Ioannis Aslanidis
1 On Saturday 21 August 2004 17:09, Ioannis Aslanidis wrote:
2 > Thank you.
3 >
4 > What I'm trying to do is to compile in my Athlon XP in order to use
5 > those same packages under a K6-2 and a Pentium-4.
6 >
7 > I am not sure how the order of -march and -mtune/-mcpu should be. What
8 > I want is to do code for Athlon XP without breaking the compatibility
9 > with Pentium 4 and K6-2.
10 >
11 > The flags I am currently using are the following:
12 >
13 > CFLAGS="-O3 -march=i586 -mtune=athlon-xp -mtune=k6-2 -mtune=i586
14 > -mtune=i686 -mmmx -fomit-frame-pointer -funroll-loops -pipe
15 > -fforce-addr -fforce-mem -fmove-all-movables"
16
17 Well one thing that is just nonsense is to mention different mtune
18 targets. There will be one chosen. I don't know exactly which, but either
19 the first or the last. -fforce-mem is implied by O2 (and so O3). The
20 -march should probably be k6-2 as pentium4's can execute that. It is
21 further unlikely that you would need "-mmmx" in your options as it still
22 needs support in the sourcecode (it only enables access to the mmx
23 functions). Most packages use the mmx useflag to control this, not
24 CFLAGS. Also note that -O3 can and will create bugs. -O3 is not as well
25 tested as -O2 and in some cases not even faster.
26
27 Paul
28
29 ps. -mtune determines the scheduling of instructions, you can only
30 schedule in one way, you said you wanted to use athlon-xp then only
31 specify -mtune=athlon-xp
32
33
34
35 --
36 Paul de Vrieze
37 Gentoo Developer
38 Mail: pauldv@g.o
39 Homepage: http://www.devrieze.net