public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Why no -march=athlon?
@ 2001-12-17 14:59 nbecker
  2001-12-17 15:54 ` Dominik Mierzejewski
  2001-12-17 17:40 ` M. R. Brown
  0 siblings, 2 replies; 13+ messages in thread
From: nbecker @ 2001-12-17 14:59 UTC (permalink / raw)
  To: linux-kernel

I noticed that linux/arch/i386/Makefile says:

ifdef CONFIG_MK7
CFLAGS += -march=i686 -malign-functions=4 
endif


Why not -march=athlon?  Is this just for compatibility with old gcc?
If so, can't we fix it with an ifdef?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why no -march=athlon?
  2001-12-17 14:59 Why no -march=athlon? nbecker
@ 2001-12-17 15:54 ` Dominik Mierzejewski
  2001-12-17 17:40 ` M. R. Brown
  1 sibling, 0 replies; 13+ messages in thread
From: Dominik Mierzejewski @ 2001-12-17 15:54 UTC (permalink / raw)
  To: linux-kernel

On Monday, 17 December 2001, nbecker@fred.net wrote:
> I noticed that linux/arch/i386/Makefile says:
> 
> ifdef CONFIG_MK7
> CFLAGS += -march=i686 -malign-functions=4 
> endif

Hm. As long as I can remember, 2.4 has always had this:
ifdef CONFIG_MK7
CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi)
endif

Perhaps you're describing a 2.2 kernel?

-- 
"The Universe doesn't give you any points for doing things that are easy."
        -- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"
Dominik 'Rathann' Mierzejewski <rathann(at)we.are.one.pl>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why no -march=athlon?
  2001-12-17 14:59 Why no -march=athlon? nbecker
  2001-12-17 15:54 ` Dominik Mierzejewski
@ 2001-12-17 17:40 ` M. R. Brown
  2001-12-19 17:46   ` On K7, -march=k6 is good (Was Re: Why no -march=athlon?) Benoit Poulot-Cazajous
  1 sibling, 1 reply; 13+ messages in thread
From: M. R. Brown @ 2001-12-17 17:40 UTC (permalink / raw)
  To: nbecker; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

* nbecker@fred.net <nbecker@fred.net> on Mon, Dec 17, 2001:

> I noticed that linux/arch/i386/Makefile says:
> 
> ifdef CONFIG_MK7
> CFLAGS += -march=i686 -malign-functions=4 
> endif
> 
> 
> Why not -march=athlon?  Is this just for compatibility with old gcc?

The recommend kernel compiler is gcc 2.95.x, which doesn't support
"-march=athlon".

> If so, can't we fix it with an ifdef?

Can you fix it?  You'd have to parse the output of `gcc -v`, I think
kbuild 2.5 does this, so start there first.

M. R.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-17 17:40 ` M. R. Brown
@ 2001-12-19 17:46   ` Benoit Poulot-Cazajous
  2001-12-19 17:56     ` M. R. Brown
  0 siblings, 1 reply; 13+ messages in thread
From: Benoit Poulot-Cazajous @ 2001-12-19 17:46 UTC (permalink / raw)
  To: M. R. Brown; +Cc: nbecker, linux-kernel

"M. R. Brown" <mrbrown@0xd6.org> writes:

> * nbecker@fred.net <nbecker@fred.net> on Mon, Dec 17, 2001:
> 
> > I noticed that linux/arch/i386/Makefile says:
> > 
> > ifdef CONFIG_MK7
> > CFLAGS += -march=i686 -malign-functions=4 
> > endif
> > 
> > 
> > Why not -march=athlon?  Is this just for compatibility with old gcc?
> 
> The recommend kernel compiler is gcc 2.95.x, which doesn't support
> "-march=athlon".

But gcc-2.95,x _supports_ "-march=k6", and we should use that instead of
"-march-i686".

Obvious patch for 2.4.16 :

--- linux-2.4.16/arch/i386/Makefile	Thu Apr 12 21:20:31 2001
+++ linux-2.4.16-bpc/arch/i386/Makefile	Sun Dec 16 15:44:06 2001
@@ -63,7 +63,7 @@
 endif
 
 ifdef CONFIG_MK7
-CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi) 
+CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; elif $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6 -malign-functions=4"; else echo "-march=i686 -malign-functions=4"; fi)
 endif
 
 ifdef CONFIG_MCRUSOE

I have tested this change, using 3 steps of the ChorusOS compilation
as benchmarks (The test first bootstrap gcc, then compiles various
cross-compilers in parallel and then uses them to build ChorusOS for
various architectures). On my XP1800+, it gives :

before the patch :
1017.92user 261.80system 24:39.89elapsed 86%CPU
706.33user 160.79system 16:23.61elapsed 88%CPU
1787.38user 418.76system 43:35.97elapsed 84%CPU

after the patch :
1018.42user 253.85system 24:44.68elapsed 85%CPU
704.89user 151.76system 16:16.14elapsed 87%CPU
1786.96user 410.76system 43:05.32elapsed 85%CPU

The improvement in system time is nice.

  -- Benoit


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 17:46   ` On K7, -march=k6 is good (Was Re: Why no -march=athlon?) Benoit Poulot-Cazajous
@ 2001-12-19 17:56     ` M. R. Brown
  2001-12-19 18:39       ` nbecker
  2001-12-19 21:40       ` Benoit Poulot-Cazajous
  0 siblings, 2 replies; 13+ messages in thread
From: M. R. Brown @ 2001-12-19 17:56 UTC (permalink / raw)
  To: Benoit Poulot-Cazajous; +Cc: nbecker, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 802 bytes --]

* Benoit Poulot-Cazajous <poulot@ifrance.com> on Wed, Dec 19, 2001:

> 
> But gcc-2.95,x _supports_ "-march=k6", and we should use that instead of
> "-march-i686".
> 

No, k6 != athlon.  IIRC, the i686 optimization is closer to the Athlon than
the k6 opt.

> 
> before the patch :
> 1017.92user 261.80system 24:39.89elapsed 86%CPU
> 706.33user 160.79system 16:23.61elapsed 88%CPU
> 1787.38user 418.76system 43:35.97elapsed 84%CPU
> 
> after the patch :
> 1018.42user 253.85system 24:44.68elapsed 85%CPU
> 704.89user 151.76system 16:16.14elapsed 87%CPU
> 1786.96user 410.76system 43:05.32elapsed 85%CPU
> 
> The improvement in system time is nice.
> 

Er, there's not much difference...

Curious, what happens when you compile using gcc 3.0.1 against
-march=athlon?

M. R.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 17:56     ` M. R. Brown
@ 2001-12-19 18:39       ` nbecker
  2001-12-19 18:47         ` M. R. Brown
  2001-12-19 19:38         ` Allan Sandfeld
  2001-12-19 21:40       ` Benoit Poulot-Cazajous
  1 sibling, 2 replies; 13+ messages in thread
From: nbecker @ 2001-12-19 18:39 UTC (permalink / raw)
  To: M. R. Brown; +Cc: Benoit Poulot-Cazajous, linux-kernel

>>>>> "M" == M R Brown <mrbrown@0xd6.org> writes:


    M> Curious, what happens when you compile using gcc 3.0.1 against
    M> -march=athlon?

Is it safe to use gcc-3.0.2 to compile the kernel?


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 18:39       ` nbecker
@ 2001-12-19 18:47         ` M. R. Brown
  2001-12-19 18:52           ` J Sloan
  2001-12-19 19:38         ` Allan Sandfeld
  1 sibling, 1 reply; 13+ messages in thread
From: M. R. Brown @ 2001-12-19 18:47 UTC (permalink / raw)
  To: nbecker; +Cc: Benoit Poulot-Cazajous, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

* nbecker@fred.net <nbecker@fred.net> on Wed, Dec 19, 2001:

> >>>>> "M" == M R Brown <mrbrown@0xd6.org> writes:
> 
> 
>     M> Curious, what happens when you compile using gcc 3.0.1 against
>     M> -march=athlon?
> 
> Is it safe to use gcc-3.0.2 to compile the kernel?

Absolutely not.  There was at least one reported ICE (internal compiler
error) with drivers/net/8139too.c.  Stick to the 2.95.x series.

M. R.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 18:47         ` M. R. Brown
@ 2001-12-19 18:52           ` J Sloan
  2001-12-19 19:01             ` Josh McKinney
  2001-12-19 19:21             ` M. R. Brown
  0 siblings, 2 replies; 13+ messages in thread
From: J Sloan @ 2001-12-19 18:52 UTC (permalink / raw)
  To: M. R. Brown; +Cc: nbecker, Benoit Poulot-Cazajous, linux-kernel

"M. R. Brown" wrote:

> * nbecker@fred.net <nbecker@fred.net> on Wed, Dec 19, 2001:
>
> > Is it safe to use gcc-3.0.2 to compile the kernel?
>
> Absolutely not.  There was at least one reported ICE (internal compiler
> error) with drivers/net/8139too.c.  Stick to the 2.95.x series.

BTW 2.96 is fine also -

cu

jjs


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 18:52           ` J Sloan
@ 2001-12-19 19:01             ` Josh McKinney
  2001-12-19 19:21             ` M. R. Brown
  1 sibling, 0 replies; 13+ messages in thread
From: Josh McKinney @ 2001-12-19 19:01 UTC (permalink / raw)
  To: linux-kernel

On approximately Wed, Dec 19, 2001 at 10:52:40AM -0800, J Sloan wrote:
> "M. R. Brown" wrote:
> 
> > * nbecker@fred.net <nbecker@fred.net> on Wed, Dec 19, 2001:
> >
> > > Is it safe to use gcc-3.0.2 to compile the kernel?

 Just another side note, gcc-3.0.3 prerelease is out, and it compiles kernels fine here so far.

Josh
-- 
Linux, the choice                | Ever feel like life was a game and you had 
of a GNU generation       -o)    | the wrong instruction book? 
Kernel 2.4.17-rc2          /\    | 
on a i586                 _\_v   | 
                                 | 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 18:52           ` J Sloan
  2001-12-19 19:01             ` Josh McKinney
@ 2001-12-19 19:21             ` M. R. Brown
  2001-12-19 19:28               ` J Sloan
  1 sibling, 1 reply; 13+ messages in thread
From: M. R. Brown @ 2001-12-19 19:21 UTC (permalink / raw)
  To: J Sloan; +Cc: nbecker, Benoit Poulot-Cazajous, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

* J Sloan <jjs@lexus.com> on Wed, Dec 19, 2001:

> "M. R. Brown" wrote:
> 
> > * nbecker@fred.net <nbecker@fred.net> on Wed, Dec 19, 2001:
> >
> > > Is it safe to use gcc-3.0.2 to compile the kernel?
> >
> > Absolutely not.  There was at least one reported ICE (internal compiler
> > error) with drivers/net/8139too.c.  Stick to the 2.95.x series.
> 
> BTW 2.96 is fine also -
> 

There is no 2.96 except the Red Hat maintained version of GCC, but if
you're saying that Red Hat's compiler works, more power to you.

M. R.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 19:21             ` M. R. Brown
@ 2001-12-19 19:28               ` J Sloan
  0 siblings, 0 replies; 13+ messages in thread
From: J Sloan @ 2001-12-19 19:28 UTC (permalink / raw)
  To: M. R. Brown; +Cc: nbecker, Benoit Poulot-Cazajous, linux-kernel

"M. R. Brown" wrote:

> There is no 2.96 except the Red Hat maintained version of GCC

IIRC mandrake ships it also -

> but if
> you're saying that Red Hat's compiler works, more power to you.

Not only me, but such notables as Alan Cox -

It's a fine compiler, and I'm a bit puzzled at the
anti-gcc-2.96 hysteria - aside from some initial
bugs (quickly fixed) in the old guiness release.

Here's a heads-up for those interested -

http://www.bero.org/gcc296.html

Regards,

jjs



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 18:39       ` nbecker
  2001-12-19 18:47         ` M. R. Brown
@ 2001-12-19 19:38         ` Allan Sandfeld
  1 sibling, 0 replies; 13+ messages in thread
From: Allan Sandfeld @ 2001-12-19 19:38 UTC (permalink / raw)
  To: linux-kernel

On Wednesday 19 December 2001 19:39, nbecker@fred.net wrote:
> >>>>> "M" == M R Brown <mrbrown@0xd6.org> writes:
>
>     M> Curious, what happens when you compile using gcc 3.0.1 against
>     M> -march=athlon?
>
> Is it safe to use gcc-3.0.2 to compile the kernel?
>
If it compiles.. Otherwise use gcc-3.0.3(prerelease), it has fixes that makes 
the _current_ kernel compile. 
<sarcasm> 
Obviously it's still full of bugs, it wouldn't really be gcc if it wasn't.
</sarcasm>

I am currently running a linux-2.4.16-gcc3, where the only changed part is 
the use of the gcc-3.0 compiler, and a -foptimize-siblings-calls flag. It's 
running smoothly, although I havn't done any performance test yet.

Btw. I havent found anything that compiles with gcc-3.1 yet.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: On K7, -march=k6 is good (Was Re: Why no -march=athlon?)
  2001-12-19 17:56     ` M. R. Brown
  2001-12-19 18:39       ` nbecker
@ 2001-12-19 21:40       ` Benoit Poulot-Cazajous
  1 sibling, 0 replies; 13+ messages in thread
From: Benoit Poulot-Cazajous @ 2001-12-19 21:40 UTC (permalink / raw)
  To: M. R. Brown; +Cc: Benoit Poulot-Cazajous, nbecker, linux-kernel

"M. R. Brown" <mrbrown@0xd6.org> writes:

> * Benoit Poulot-Cazajous <poulot@ifrance.com> on Wed, Dec 19, 2001:
> 
> > 
> > But gcc-2.95,x _supports_ "-march=k6", and we should use that instead of
> > "-march-i686".
> > 
> 
> No, k6 != athlon.  IIRC, the i686 optimization is closer to the Athlon than
> the k6 opt.

In theory, you may be right. But gcc-2.95.3 may not follow the theory.

> > before the patch :
> > 1017.92user 261.80system 24:39.89elapsed 86%CPU
> > 706.33user 160.79system 16:23.61elapsed 88%CPU
> > 1787.38user 418.76system 43:35.97elapsed 84%CPU
> > 
> > after the patch :
> > 1018.42user 253.85system 24:44.68elapsed 85%CPU
> > 704.89user 151.76system 16:16.14elapsed 87%CPU
> > 1786.96user 410.76system 43:05.32elapsed 85%CPU
> > 
> > The improvement in system time is nice.
> > 
> 
> Er, there's not much difference...

>From 261.80 to 253.85 => -3%
>From 160.79 to 151.76 => -6%
>From 418.76 to 410.76 => -2%

So the kernel looks between 2 and 6% faster. Not so bad for a one-line
patch ;-)

> Curious, what happens when you compile using gcc 3.0.1 against
> -march=athlon?

Yep, I will try with gcc 3.0.3.

  -- Benoit

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-12-19 21:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-17 14:59 Why no -march=athlon? nbecker
2001-12-17 15:54 ` Dominik Mierzejewski
2001-12-17 17:40 ` M. R. Brown
2001-12-19 17:46   ` On K7, -march=k6 is good (Was Re: Why no -march=athlon?) Benoit Poulot-Cazajous
2001-12-19 17:56     ` M. R. Brown
2001-12-19 18:39       ` nbecker
2001-12-19 18:47         ` M. R. Brown
2001-12-19 18:52           ` J Sloan
2001-12-19 19:01             ` Josh McKinney
2001-12-19 19:21             ` M. R. Brown
2001-12-19 19:28               ` J Sloan
2001-12-19 19:38         ` Allan Sandfeld
2001-12-19 21:40       ` Benoit Poulot-Cazajous

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox