public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch to enable K6-2 and K6-3 processor optimizations
@ 2002-08-09  8:52 David Bronaugh
  0 siblings, 0 replies; 5+ messages in thread
From: David Bronaugh @ 2002-08-09  8:52 UTC (permalink / raw)
  To: linux-kernel

Hi,

Well, I said I was new to this; forgot to include the patch, and what kernel version it was against.

It's against 2.4.19, but doesn't really change much, so should apply to most kernel revisions.

Patch follows: 

diff -Naur -X dontdiff linux/arch/i386/Makefile linux-2.4/arch/i386/Makefile
--- linux/arch/i386/Makefile    2001-04-12 12:20:31.000000000 -0700
+++ linux-2.4/arch/i386/Makefile        2002-08-09 01:16:40.000000000 -0700
@@ -62,6 +62,16 @@
 CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
 endif
 
+ifdef CONFIG_MK6_2
+CFLAGS += $(shell if $(CC) -march=k6-2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6-2"; else if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi; fi)
+endif
+
+ifdef CONFIG_MK6_3
+CFLAGS += $(shell if $(CC) -march=k6-3 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6-3"; else if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi; fi)
+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) 
 endif
diff -Naur -X dontdiff linux/arch/i386/config.in linux-2.4/arch/i386/config.in
--- linux/arch/i386/config.in   2002-08-09 01:21:03.000000000 -0700
+++ linux-2.4/arch/i386/config.in       2002-08-09 01:11:39.000000000 -0700
@@ -35,7 +35,9 @@
         Pentium-Pro/Celeron/Pentium-II         CONFIG_M686 \
         Pentium-III/Celeron(Coppermine)        CONFIG_MPENTIUMIII \
         Pentium-4                              CONFIG_MPENTIUM4 \
-        K6/K6-II/K6-III                        CONFIG_MK6 \
+        K6                                     CONFIG_MK6 \
+        K6-II                                  CONFIG_MK6_2 \
+        K6-III                                 CONFIG_MK6_3 \
         Athlon/Duron/K7                        CONFIG_MK7 \
         Elan                                   CONFIG_MELAN \
         Crusoe                                 CONFIG_MCRUSOE \
@@ -119,6 +121,20 @@
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
 fi
+# Since I don't know whether CONFIG_X86_USE_3DNOW means 3dnowext or not, I'm playing it safe
+if [ "$CONFIG_MK6_2" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 5
+   define_bool CONFIG_X86_ALIGNMENT_16 y
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MK6_3" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 5
+   define_bool CONFIG_X86_ALIGNMENT_16 y
+   define_bool CONFIG_X86_TSC y

+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_USE_3DNOW y
+fi
 if [ "$CONFIG_MK7" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    define_bool CONFIG_X86_TSC y

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Patch to enable K6-2 and K6-3 processor optimizations
@ 2002-08-09  8:48 David Bronaugh
  2002-08-09 10:31 ` Alan Cox
  2002-08-09 16:45 ` Josh McKinney
  0 siblings, 2 replies; 5+ messages in thread
From: David Bronaugh @ 2002-08-09  8:48 UTC (permalink / raw)
  To: linux-kernel

Hi,

This is my first kernel patch, so please go easy on me :)

What it does is conditionally enable -march=k6-2 and -march=k6-3, and provide options for each in the Processor Type and Features menu.

This is conditional on the compiler supporting it; as of this writing only GCC 3.1 does. I compiled this kernel successfully with this patch on my K6-III and am presently running this kernel.

It also enables 3DNow in the case of the K6-III; I wasn't sure if 3DNow might imply the extended Athlon 3DNow instructions, so I only enabled it for the K6-III, which I know supports it.

Anyhow, that's all.

David Bronaugh

ps: This is pretty trivial to apply for other CPUs too; as I understand it several different CPU types gained their own architecture strings with GCC 3.1

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

end of thread, other threads:[~2002-08-09 17:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-09  8:52 Patch to enable K6-2 and K6-3 processor optimizations David Bronaugh
  -- strict thread matches above, loose matches on Subject: below --
2002-08-09  8:48 David Bronaugh
2002-08-09 10:31 ` Alan Cox
2002-08-09 17:28   ` David Bronaugh
2002-08-09 16:45 ` Josh McKinney

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