lkml.org 
[lkml]   [1999]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch]K6-2/K-III compile option
Jeff Garzik wrote:
>
> I submitted a similar patch a couple weeks ago. Comments:
>
> '-march=k6' doesn't always exist. Fall back to '-march=i586' if k6
> isn't known to the compiler.

Good idea...Done. See patch below.

>
> I'm not sure CONFIG_X86_USE_3DNOW, which enables _MMX_ code, is a win on
> all K6's. Wasn't the original K6 rather slow when doing MMX?

I beleive that the plain K6 is slower using mmx routines, but the
K6-2/K6-III should gain a bit.
This is why the options is only for the K6-2/K6-III, as mentioned in
Configure.help

Quoting you :-)
"Patches in the 2.3.18ac series enable MMX routines for the K7. Code
comments state that these routines are a win on K6-III, and I think
possibly the K6-II as well. It is definitely useful to enable
CONFIG_X86_USE_3DNOW and -march=k6 on the K6 series, but doing so
requires separating the K6 option from the PentiumTSC option."

>
> grep and make sure CONFIG_M586TSC isn't used in code as a conditional.
> (ie. make sure code isn't accidentally ifdef'd out, simply because
> CONFIG_M586TSC is not defined)

I've checked and found none.

BTW.
in the file arch/i386/lib/usercopy.c there is a "#ifdef
CONFIG_X86_USE_3DNOW_AND_WORKS"
which enables some mmx routines. I cannot find any other references to
"CONFIG_X86_USE_3DNOW_AND_WORKS".
Do you have an idea why this variable is used or is it just a typo?
Anyway... I've changed it to "#ifdef CONFIG_X86_USE_3DNOW", as you can
se below.

Also:
To whom should I send this patch, for it to be merged into the kernel
tree?


Thanks for your comments.

Anders Fugmann.

***Patch begins***

diff -r -u vanilla-2.3.18ac10/Documentation/Configure.help
linux/Documentation/Configure.help
--- vanilla-2.3.18ac10/Documentation/Configure.help Thu Sep 30
10:58:59 1999
+++ linux/Documentation/Configure.help Thu Sep 30 18:15:02 1999
@@ -1846,13 +1846,13 @@
CONFIG_M386
This is the processor type of your CPU. This information is used for
optimizing purposes. In order to compile a kernel that can run on
- all x86 CPU types (albeit not optimally fast), you can specify
- "386" here.
+ all x86 CPU types (albeit not optimally fast), you can specify "386"
+ here.

- If you specify one of "486" or "586" or "Pentium" or "PPro", then
- the kernel will not necessarily run on earlier architectures (e.g. a
- Pentium optimized kernel will run on a PPro, but not necessarily on
- a i486).
+ If you specify one of "486" or "586" or "Pentium" or "K6" or "PPro"
or
+ K7, then the kernel will not necessarily run on earlier architectures
+ (e.g. a Pentium optimized kernel will run on a PPro, but not
necessarily
+ on a i486).

Here are the settings recommended for greatest speed:
- "386" for the AMD/Cyrix/Intel 386DX/DXL/SL/SLC/SX, Cyrix/TI
@@ -1862,10 +1862,11 @@
AMD/Cyrix 5x86, NexGen Nx586 and UMC U5D or U5S.
- "586" for generic Pentium CPUs, possibly lacking the TSC
(time stamp counter) register.
- - "Pentium" for the Intel Pentium/Pentium MMX, AMD K5, K6 and
- K6-3D.
+ - "Pentium" for the Intel Pentium/Pentium MMX, AMD K5 and K6.
+ - "K6-II(I)" for AMD K6-2 or AMD K6-III.
- "PPro" for the Cyrix/IBM/National Semiconductor 6x86MX, MII and
Intel Pentium II/Pentium Pro.
+ - "K7" for the AMD Athlon processor.

If you don't know what to do, choose "386".

Only in linux/Documentation: Configure.help~
diff -r -u vanilla-2.3.18ac10/arch/i386/Makefile
linux/arch/i386/Makefile
--- vanilla-2.3.18ac10/arch/i386/Makefile Thu Sep 30 10:58:59 1999
+++ linux/arch/i386/Makefile Thu Sep 30 17:51:03 1999
@@ -52,6 +52,13 @@
AFLAGS := $(AFLAGS) -DCPU=586
endif

+ifdef CONFIG_MK6
+CFLAGS := $(CFLAGS) -DCPU=586
+CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null
>/dev/null 2>&1; then echo "-march=k6"; \
+ elif $(CC) -march=i586 -S -o /dev/null -xc /dev/null
>/dev/null 2>&1; then echo "-march=i586"; fi)
+AFLAGS := $(AFLAGS) -DCPU=586
+endif
+
ifdef CONFIG_M686
CFLAGS := $(CFLAGS) -DCPU=686
CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null
>/dev/null 2>&1; then echo "-march=i686"; fi)
@@ -59,7 +66,7 @@
endif

ifdef CONFIG_MK7
-CFLAGS := $(CFLAGS) -DCPU=686 -march=pentiumpro -mpentiumpro
-malign-functions=4 -fschedule-insns2 -mwide-multiply
-fexpensive-optimizations
+CFLAGS := $(CFLAGS) -DCPU=686 -malign-functions=4 -fschedule-insns2
-mwide-multiply -fexpensive-optimizations
CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null
>/dev/null 2>&1; then echo "-march=i686"; fi)
AFLAGS := $(AFLAGS) -DCPU=686
endif
diff -r -u vanilla-2.3.18ac10/arch/i386/config.in
linux/arch/i386/config.in
--- vanilla-2.3.18ac10/arch/i386/config.in Thu Sep 30 10:58:59 1999
+++ linux/arch/i386/config.in Thu Sep 30 17:47:44 1999
@@ -18,8 +18,9 @@
"386 CONFIG_M386 \
486/Cx486 CONFIG_M486 \
586/K5/5x86/6x86 CONFIG_M586 \
- Pentium/K6/TSC CONFIG_M586TSC \
- PPro/6x86MX CONFIG_M686 \
+ Pentium/TSC/K6 CONFIG_M586TSC \
+ K6-2/K6-III CONFIG_MK6 \
+ PPro/6x86MX CONFIG_M686 \
Athlon CONFIG_MK7" PPro
#
# Define implied options from the CPU selection here
@@ -30,15 +31,14 @@
define_bool CONFIG_X86_BSWAP y
define_bool CONFIG_X86_POPAD_OK y
fi
-if [ "$CONFIG_M686" = "y" -o "$CONFIG_M586TSC" = "y" ]; then
+if [ "$CONFIG_M686" = "y" -o "$CONFIG_M586TSC" = "y" -o \
+ "$CONFIG_MK6" = "y" -o "$CONFIG_MK7" = "y" ]; then
define_bool CONFIG_X86_TSC y
fi
-if [ "$CONFIG_M686" = "y" ]; then
+if [ "$CONFIG_M686" = "y" -o "$CONFIG_MK7" = "y" ]; then
define_bool CONFIG_X86_GOOD_APIC y
fi
-if [ "$CONFIG_MK7" = "y" ]; then
- define_bool CONFIG_X86_TSC y
- define_bool CONFIG_X86_GOOD_APIC y
+if [ "$CONFIG_MK6" = "y" -o "$CONFIG_MK7" = "y" ]; then
define_bool CONFIG_X86_USE_3DNOW y
fi

diff -r -u vanilla-2.3.18ac10/arch/i386/defconfig
linux/arch/i386/defconfig
--- vanilla-2.3.18ac10/arch/i386/defconfig Thu Sep 30 10:58:59 1999
+++ linux/arch/i386/defconfig Thu Sep 30 17:47:44 1999
@@ -16,6 +16,7 @@
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
+# CONFIG_MK6 is not set
CONFIG_M686=y
# CONFIG_MK7 is not set
CONFIG_X86_WP_WORKS_OK=y
diff -r -u vanilla-2.3.18ac10/arch/i386/lib/usercopy.c
linux/arch/i386/lib/usercopy.c
--- vanilla-2.3.18ac10/arch/i386/lib/usercopy.c Wed Sep 29 18:41:25 1999
+++ linux/arch/i386/lib/usercopy.c Thu Sep 30 18:15:07 1999
@@ -8,7 +8,7 @@
#include <asm/uaccess.h>
#include <asm/mmx.h>

-#ifdef CONFIG_X86_USE_3DNOW_AND_WORKS
+#ifdef CONFIG_X86_USE_3DNOW

unsigned long
__generic_copy_to_user(void *to, const void *from, unsigned long n)
***Patch ends***[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.063 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site