Gentoo Archives: gentoo-user

From: Alexander Skwar <listen@×××××××××××××××.name>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Cannot compile texinfo: Illegal instruction -> Wrong -march and -mtune flags?
Date: Thu, 02 Aug 2007 21:40:42
Message-Id: 10988999.8Y4yEoeYLD@m-id.message-center.info
In Reply to: Re: [gentoo-user] Re: Cannot compile texinfo: Illegal instruction -> Wrong -march and -mtune flags? by Florian Philipp
1 · Florian Philipp <f.philipp@××××××.de>:
2
3 > You see, they are not compatible and even if some code works I wouldn't bet
4 > multimedia apps will perform well.
5 >
6 > With -mtune the instruction set stays the same. It is just "rearranged".
7
8 Hm. Allright. When using just -mtune (ie. without -march), the
9 docs at http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/i386-and-x86_002d64-Options.html
10 say:
11
12 | While picking a specific cpu-type will schedule things appropriately
13 | for that particular chip, the compiler will not generate any code that
14 | does not run on the i386 without the -march=cpu-type option being used.
15
16 If -mtune=athlon-xp is used, code is generated which may make
17 use of 3dNOW!. 3dNOW! is, of course, not to be found on 386 :)
18 If the instruction set stays the same, code generated with
19 -mtune=athlon-xp would not be executable on 386 machines, if
20 I understand you correctly.
21
22 Hm. With -mtune, the set of available instructions (ie.
23 stuff like 3dNOW!, I suppose?) is NOT changed from the default
24 of i386, is it? Or what does "Tune to cpu-type everything applicable
25 about the generated code, except for the ABI and the set of available
26 instructions." mean - especially note the "except for [...] the set of
27 available instructions" part.
28
29 So with "-mtune=pentium-m -march=athlon-xp" I'm making the compiler
30 generate code which is "ordered" the way it's best for pentium-m
31 machines while allowing it to use athlon-xp instruction set? Is
32 that what I'm doing?
33
34 If so, then it seems you're right - code will run, but maybe not
35 so well.
36
37 Is that understanding correct? If so, then I really should think
38 twice about using "-mtune=pentium-m -march=athlon-xp", shouldn't
39 I?
40
41 Curious,
42
43 Alexander Skwar
44 --
45 No matter how many resources you have, it is never enough.
46 -- Murphy's Computer Laws n°1
47
48
49 --
50 gentoo-user@g.o mailing list

Replies