Gentoo Archives: gentoo-user

From: Daniel da Veiga <danieldaveiga@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Cannot compile texinfo: Illegal instruction -> Wrong -march and -mtune flags?
Date: Fri, 03 Aug 2007 01:13:12
Message-Id: 342e1090708021806h46eaa6cbodce8ad37d39f80fb@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: Cannot compile texinfo: Illegal instruction -> Wrong -march and -mtune flags? by Florian Philipp
1 On 8/2/07, Florian Philipp <f.philipp@××××××.de> wrote:
2 > Am Donnerstag 02 August 2007 23:36 schrieb Alexander Skwar:
3 > > · Florian Philipp <f.philipp@××××××.de>:
4 > > > You see, they are not compatible and even if some code works I wouldn't
5 > > > bet multimedia apps will perform well.
6 > > >
7 > > > With -mtune the instruction set stays the same. It is just "rearranged".
8 > >
9 > > Hm. Allright. When using just -mtune (ie. without -march), the
10 > > docs at
11 > > http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/i386-and-x86_002d64-Options.htm
12 > >l
13 > >
14 > > say:
15 > > | While picking a specific cpu-type will schedule things appropriately
16 > > | for that particular chip, the compiler will not generate any code that
17 > > | does not run on the i386 without the -march=cpu-type option being used.
18 > >
19 > > If -mtune=athlon-xp is used, code is generated which may make
20 > > use of 3dNOW!. 3dNOW! is, of course, not to be found on 386 :)
21 > > If the instruction set stays the same, code generated with
22 > > -mtune=athlon-xp would not be executable on 386 machines, if
23 > > I understand you correctly.
24 > >
25 > > Hm. With -mtune, the set of available instructions (ie.
26 > > stuff like 3dNOW!, I suppose?) is NOT changed from the default
27 > > of i386, is it? Or what does "Tune to cpu-type everything applicable
28 > > about the generated code, except for the ABI and the set of available
29 > > instructions." mean - especially note the "except for [...] the set of
30 > > available instructions" part.
31 > >
32 > > So with "-mtune=pentium-m -march=athlon-xp" I'm making the compiler
33 > > generate code which is "ordered" the way it's best for pentium-m
34 > > machines while allowing it to use athlon-xp instruction set? Is
35 > > that what I'm doing?
36 > >
37 > > If so, then it seems you're right - code will run, but maybe not
38 > > so well.
39 > >
40 > > Is that understanding correct? If so, then I really should think
41 > > twice about using "-mtune=pentium-m -march=athlon-xp", shouldn't
42 > > I?
43 > >
44 > > Curious,
45 > >
46 > > Alexander Skwar
47 > > --
48 >
49 > At least that's how I understand the issue. At the moment I've got two ideas
50 > to solve your problem:
51 >
52 > 1. set march to an inferior target (pentium-3 and pentium-3m seem okay: mmx
53 > and sse) and mtune for one (or even both?) of them
54 > 2. set march to one of them and disable incompatible instruction sets with
55 > options like -mno-sse2 or -mno-3dnow
56 >
57 >
58
59 Isn't the -march=i686 valid?
60 I guess that would be the most "compatible" option for binaries that
61 will run on AMD and Intel processors... Or simply use no "-march"
62 setting, only "-mtune"... I did that recently to switch a whole system
63 from an Athlon XP to a Intel Core Duo...
64
65 --
66 Daniel da Veiga
67 Computer Operator - RS - Brazil
68 -----BEGIN GEEK CODE BLOCK-----
69 Version: 3.1
70 GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
71 PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
72 ------END GEEK CODE BLOCK------
73 --
74 gentoo-user@g.o mailing list

Replies