On K7, -march=k6 is good (Was Re: Why no -march=athlon?)

From: Benoit Poulot-Cazajous (poulot@ifrance.com)
Date: Wed Dec 19 2001 - 12:46:13 EST


"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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 23 2001 - 21:00:19 EST