Skip to contentSkip to conversation

Athlon CFLAGS

PATCH In review Daniel Mehrmann 4 participants 6 messages Sep 8, 2002 – Sep 9, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Athlon CFLAGS

Hi Alan,

i add for the AMD Athlon family some optimize compilerflags. Gcc 3.1 and 3.2 support more specific Athlon instructions as 3.0 or 2.95x. This patch for 2.4.19, 2.4.20-pre5 and 2.5.33 set a new "-march" flag:

Athlon TB/Duron += -march=athlon-tbird
Athlon XP/Athlon4/Duron += -march=athlon-xp
Athlon MP += -march=athlon-mp

It tests the possible flags and if it`s fail we made a downgrade to "-march=athlon" or "-march=i686". So we can use gcc 2.95x and 3.0 without any problems :-)

I add this in the configmenu and documentation.

i made serval tests with my compilers and it looks like good. LMBENCH 2.0 said it`s a little bit faster as before :-))

I think it allso a good step for the furture of the kernel, because we can now specific more cpu feature in config.in and support all gcc features.

I hope this patch is nice for you.

chears,
Daniel

2.4.19:

Documentation/Configure.help 2002-09-08 19:31:31.000000000 +0200 renamed from Documentation/Configure.help 2002-08-03 02:39:42.000000000 +0200 +5 -1
diff -Pur linux-2.4.19.orig/Documentation/Configure.help linux-2.4.19/Documentation/Configure.help
@@ -3963,7 +3963,11 @@
      and Celerons based on the Coppermine core.
    - "Pentium-4" for the Intel Pentium 4.
    - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
-   - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
+   - "Atlon-TB" for the AMD Athlon Thunderbird
+     and Durons based on the Splitfire core.
+   - "Athlon-XP" for the AMD AthlonXP
+     and Mobile and Durons based on Morgan core.
+   - "Athlon-MP" for the AMD AthlonMP
    - "Elan" for the AMD Elan family (Elan SC400/SC410).
    - "Crusoe" for the Transmeta Crusoe series.
    - "Winchip-C6" for original IDT Winchip.
arch/i386/Makefile 2002-09-08 18:58:38.000000000 +0200 renamed from arch/i386/Makefile 2001-04-12 21:20:31.000000000 +0200 +9 -2
diff -Pur linux-2.4.19.orig/arch/i386/Makefile linux-2.4.19/arch/i386/Makefile
@@ -62,10 +62,17 @@
 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_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)
+ifdef CONFIG_MATHLONTB
+CFLAGS += $(shell if $(CC) -march=athlon-tbird -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-tbird"; elif $(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
 
+ifdef CONFIG_MATHLONXP
+CFLAGS += $(shell if $(CC) -march=athlon-xp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-xp"; elif $(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
+
+ifdef CONFIG_MATHLONMP
+CFLAGS += $(shell if $(CC) -march=athlon-mp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-mp"; elif $(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
 ifdef CONFIG_MCRUSOE
 CFLAGS += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
 endif
arch/i386/config.in 2002-09-08 19:16:05.000000000 +0200 renamed from arch/i386/config.in 2002-08-03 02:39:42.000000000 +0200 +20 -2
diff -Pur linux-2.4.19.orig/arch/i386/config.in linux-2.4.19/arch/i386/config.in
@@ -36,7 +36,9 @@
         Pentium-III/Celeron(Coppermine)        CONFIG_MPENTIUMIII \
         Pentium-4                              CONFIG_MPENTIUM4 \
         K6/K6-II/K6-III                        CONFIG_MK6 \
-        Athlon/Duron/K7                        CONFIG_MK7 \
+        Athlon-TB/Duron(Splitfire)             CONFIG_MATHLONTB \
+        Athlon-XP/Athlon4/Duron(Morgan)        CONFIG_MATHLONXP \
+        Athlon-MP                              CONFIG_MATHLONMP \
         Elan                                   CONFIG_MELAN \
         Crusoe                                 CONFIG_MCRUSOE \
         Winchip-C6                             CONFIG_MWINCHIPC6 \
@@ -119,7 +121,23 @@
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
 fi
-if [ "$CONFIG_MK7" = "y" ]; then
+if [ "$CONFIG_MATHLONTB" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONXP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONMP" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_GOOD_APIC y

2.4.20-pre5:

Documentation/Configure.help 2002-09-08 19:55:07.000000000 +0200 renamed from Documentation/Configure.help 2002-09-08 19:42:28.000000000 +0200 +5 -1
diff -Pur linux-2.4.20-pre5.orig/Documentation/Configure.help linux-2.4.20-pre5/Documentation/Configure.help
@@ -4106,7 +4106,11 @@
      and Celerons based on the Coppermine core.
    - "Pentium-4" for the Intel Pentium 4.
    - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
-   - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
+   - "Atlon-TB" for the AMD Athlon Thunderbird
+     and Durons based on the Splitfire core.
+   - "Athlon-XP" for the AMD AthlonXP
+     and Mobile and Durons based on Morgan core.
+   - "Athlon-MP" for the AMD AthlonMP
    - "Elan" for the AMD Elan family (Elan SC400/SC410).
    - "Crusoe" for the Transmeta Crusoe series.
    - "Winchip-C6" for original IDT Winchip.
arch/i386/Makefile 2002-09-08 20:10:33.000000000 +0200 renamed from arch/i386/Makefile 2001-04-12 21:20:31.000000000 +0200 +10 -2
diff -Pur linux-2.4.20-pre5.orig/arch/i386/Makefile linux-2.4.20-pre5/arch/i386/Makefile
@@ -62,8 +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_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)
+ifdef CONFIG_MATHLONTB
+CFLAGS += $(shell if $(CC) -march=athlon-tbird -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-tbird"; elif $(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
+
+ifdef CONFIG_MATHLONXP
+CFLAGS += $(shell if $(CC) -march=athlon-xp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-xp"; elif $(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
+
+ifdef CONFIG_MATHLONMP
+CFLAGS += $(shell if $(CC) -march=athlon-mp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-mp"; elif $(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
 
 ifdef CONFIG_MCRUSOE
arch/i386/config.in 2002-09-08 20:14:56.000000000 +0200 renamed from arch/i386/config.in 2002-09-08 19:42:29.000000000 +0200 +21 -2
diff -Pur linux-2.4.20-pre5.orig/arch/i386/config.in linux-2.4.20-pre5/arch/i386/config.in
@@ -35,7 +35,9 @@
         Pentium-III/Celeron(Coppermine)        CONFIG_MPENTIUMIII \
         Pentium-4                              CONFIG_MPENTIUM4 \
         K6/K6-II/K6-III                        CONFIG_MK6 \
-        Athlon/Duron/K7                        CONFIG_MK7 \
+        Athlon-TB/Duron(Splitfire)             CONFIG_MATHLONTB \
+        Athlon-XP/Athlon4/Duron(Morgan)        CONFIG_MATHLONXP \
+        Athlon-MP                              CONFIG_MATHLONMP \
         Elan                                   CONFIG_MELAN \
         Crusoe                                 CONFIG_MCRUSOE \
         Winchip-C6                             CONFIG_MWINCHIPC6 \
@@ -126,7 +128,7 @@
    define_bool CONFIG_X86_HAS_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
 fi
-if [ "$CONFIG_MK7" = "y" ]; then
+if [ "$CONFIG_MATHLONTB" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    define_bool CONFIG_X86_HAS_TSC y
    define_bool CONFIG_X86_GOOD_APIC y
@@ -135,6 +137,23 @@
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
    define_bool CONFIG_X86_F00F_WORKS_OK y
 fi
+if [ "$CONFIG_MATHLONXP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_HAS_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_F00F_WORKS_OK y
+fi
+if [ "$CONFIG_MATHLONMP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_HAS_TSC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_F00F_WORKS_OK y
+fi
 if [ "$CONFIG_MELAN" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 4
    define_bool CONFIG_X86_USE_STRING_486 y

2.5.33:

arch/i386/Config.help 2002-09-08 20:43:40.000000000 +0200 renamed from arch/i386/Config.help 2002-09-01 00:04:49.000000000 +0200 +5 -1
diff -Pur linux-2.5.33.orig/arch/i386/Config.help linux-2.5.33/arch/i386/Config.help
@@ -411,7 +411,11 @@
      and Celerons based on the Coppermine core.
    - "Pentium-4" for the Intel Pentium 4.
    - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
-   - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
+   - "Atlon-TB" for the AMD Athlon Thunderbird
+     and Durons based on the Splitfire core.
+   - "Athlon-XP" for the AMD AthlonXP
+     and Mobile and Durons based on Morgan core.
+   - "Athlon-MP" for the AMD AthlonMP
    - "Crusoe" for the Transmeta Crusoe series.
    - "Winchip-C6" for original IDT Winchip.
    - "Winchip-2" for IDT Winchip 2.
arch/i386/Makefile 2002-09-08 20:27:06.000000000 +0200 renamed from arch/i386/Makefile 2002-09-01 00:04:55.000000000 +0200 +10 -2
diff -Pur linux-2.5.33.orig/arch/i386/Makefile linux-2.5.33/arch/i386/Makefile
@@ -61,10 +61,18 @@
 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_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)
+ifdef CONFIG_MATHLONTB
+CFLAGS += $(shell if $(CC) -march=athlon-tbird -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-tbird"; elif $(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
 
+ifdef CONFIG_MATHLONXP
+CFLAGS += $(shell if $(CC) -march=athlon-xp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-xp"; elif $(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
+
+ifdef CONFIG_MATHLONMP
+CFLAGS += $(shell if $(CC) -march=athlon-mp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-mp"; elif $(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
+
 ifdef CONFIG_MCRUSOE
 CFLAGS += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
 endif
arch/i386/config.in 2002-09-08 20:31:22.000000000 +0200 renamed from arch/i386/config.in 2002-09-01 00:04:55.000000000 +0200 +18 -2
diff -Pur linux-2.5.33.orig/arch/i386/config.in linux-2.5.33/arch/i386/config.in
@@ -25,7 +25,9 @@
         Pentium-III/Celeron(Coppermine)        CONFIG_MPENTIUMIII \
         Pentium-4                              CONFIG_MPENTIUM4 \
         K6/K6-II/K6-III                        CONFIG_MK6 \
-        Athlon/Duron/K7                        CONFIG_MK7 \
+        Athlon-TB/Duron(Splitfire)             CONFIG_MATHLONTB \
+        Athlon-XP/Athlon4/Duron(Morgan)        CONFIG_MATHLONXP \
+        Athlon-MP                              CONFIG_MATHLONMP \
         Elan                                   CONFIG_MELAN \
         Crusoe                                 CONFIG_MCRUSOE \
         Winchip-C6                             CONFIG_MWINCHIPC6 \
@@ -110,7 +112,21 @@
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
 fi
-if [ "$CONFIG_MK7" = "y" ]; then
+if [ "$CONFIG_MATHLONTB" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONXP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONMP" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_GOOD_APIC y
Documentation/Configure.help +5 -1
diff -Pur linux-2.4.19.orig/Documentation/Configure.help linux-2.4.19/Documentation/Configure.help
@@ -3963,7 +3963,11 @@
      and Celerons based on the Coppermine core.
    - "Pentium-4" for the Intel Pentium 4.
    - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
-   - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
+   - "Atlon-TB" for the AMD Athlon Thunderbird
+     and Durons based on the Splitfire core.
+   - "Athlon-XP" for the AMD AthlonXP
+     and Mobile and Durons based on Morgan core.
+   - "Athlon-MP" for the AMD AthlonMP 
    - "Elan" for the AMD Elan family (Elan SC400/SC410).
    - "Crusoe" for the Transmeta Crusoe series.
    - "Winchip-C6" for original IDT Winchip.
arch/i386/Makefile +9 -2
diff -Pur linux-2.4.19.orig/arch/i386/Makefile linux-2.4.19/arch/i386/Makefile
@@ -62,10 +62,17 @@
 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_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) 
+ifdef CONFIG_MATHLONTB
+CFLAGS += $(shell if $(CC) -march=athlon-tbird -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-tbird"; elif $(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
 
+ifdef CONFIG_MATHLONXP
+CFLAGS += $(shell if $(CC) -march=athlon-xp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-xp"; elif $(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
+
+ifdef CONFIG_MATHLONMP
+CFLAGS += $(shell if $(CC) -march=athlon-mp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-mp"; elif $(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
 ifdef CONFIG_MCRUSOE
 CFLAGS += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
 endif
arch/i386/config.in +20 -2
diff -Pur linux-2.4.19.orig/arch/i386/config.in linux-2.4.19/arch/i386/config.in
@@ -36,7 +36,9 @@
 	 Pentium-III/Celeron(Coppermine)	CONFIG_MPENTIUMIII \
 	 Pentium-4				CONFIG_MPENTIUM4 \
 	 K6/K6-II/K6-III			CONFIG_MK6 \
-	 Athlon/Duron/K7			CONFIG_MK7 \
+	 Athlon-TB/Duron(Splitfire)             CONFIG_MATHLONTB \
+	 Athlon-XP/Athlon4/Duron(Morgan)        CONFIG_MATHLONXP \
+	 Athlon-MP                              CONFIG_MATHLONMP \
 	 Elan					CONFIG_MELAN \
 	 Crusoe					CONFIG_MCRUSOE \
 	 Winchip-C6				CONFIG_MWINCHIPC6 \
@@ -119,7 +121,23 @@
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
 fi
-if [ "$CONFIG_MK7" = "y" ]; then
+if [ "$CONFIG_MATHLONTB" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONXP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONMP" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_GOOD_APIC y
Documentation/Configure.help +5 -1
diff -Pur linux-2.4.20-pre5.orig/Documentation/Configure.help linux-2.4.20-pre5/Documentation/Configure.help
@@ -4106,7 +4106,11 @@
      and Celerons based on the Coppermine core.
    - "Pentium-4" for the Intel Pentium 4.
    - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
-   - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
+   - "Atlon-TB" for the AMD Athlon Thunderbird
+     and Durons based on the Splitfire core.
+   - "Athlon-XP" for the AMD AthlonXP
+     and Mobile and Durons based on Morgan core.
+   - "Athlon-MP" for the AMD AthlonMP 
    - "Elan" for the AMD Elan family (Elan SC400/SC410).
    - "Crusoe" for the Transmeta Crusoe series.
    - "Winchip-C6" for original IDT Winchip.
arch/i386/Makefile +10 -2
diff -Pur linux-2.4.20-pre5.orig/arch/i386/Makefile linux-2.4.20-pre5/arch/i386/Makefile
@@ -62,8 +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_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) 
+ifdef CONFIG_MATHLONTB
+CFLAGS += $(shell if $(CC) -march=athlon-tbird -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-tbird"; elif $(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
+
+ifdef CONFIG_MATHLONXP
+CFLAGS += $(shell if $(CC) -march=athlon-xp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-xp"; elif $(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
+
+ifdef CONFIG_MATHLONMP
+CFLAGS += $(shell if $(CC) -march=athlon-mp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-mp"; elif $(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
 
 ifdef CONFIG_MCRUSOE
arch/i386/config.in +21 -2
diff -Pur linux-2.4.20-pre5.orig/arch/i386/config.in linux-2.4.20-pre5/arch/i386/config.in
@@ -35,7 +35,9 @@
 	 Pentium-III/Celeron(Coppermine)	CONFIG_MPENTIUMIII \
 	 Pentium-4				CONFIG_MPENTIUM4 \
 	 K6/K6-II/K6-III			CONFIG_MK6 \
-	 Athlon/Duron/K7			CONFIG_MK7 \
+	 Athlon-TB/Duron(Splitfire)             CONFIG_MATHLONTB \
+	 Athlon-XP/Athlon4/Duron(Morgan)        CONFIG_MATHLONXP \
+	 Athlon-MP                              CONFIG_MATHLONMP \
 	 Elan					CONFIG_MELAN \
 	 Crusoe					CONFIG_MCRUSOE \
 	 Winchip-C6				CONFIG_MWINCHIPC6 \
@@ -126,7 +128,7 @@
    define_bool CONFIG_X86_HAS_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
 fi
-if [ "$CONFIG_MK7" = "y" ]; then
+if [ "$CONFIG_MATHLONTB" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    define_bool CONFIG_X86_HAS_TSC y
    define_bool CONFIG_X86_GOOD_APIC y
@@ -135,6 +137,23 @@
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
    define_bool CONFIG_X86_F00F_WORKS_OK y
 fi
+if [ "$CONFIG_MATHLONXP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_HAS_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_F00F_WORKS_OK y
+fi
+if [ "$CONFIG_MATHLONMP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_HAS_TSC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_PGE y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_F00F_WORKS_OK y
+fi 
 if [ "$CONFIG_MELAN" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 4
    define_bool CONFIG_X86_USE_STRING_486 y
arch/i386/Config.help +5 -1
diff -Pur linux-2.5.33.orig/arch/i386/Config.help linux-2.5.33/arch/i386/Config.help
@@ -411,7 +411,11 @@
      and Celerons based on the Coppermine core.
    - "Pentium-4" for the Intel Pentium 4.
    - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
-   - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
+   - "Atlon-TB" for the AMD Athlon Thunderbird
+     and Durons based on the Splitfire core.
+   - "Athlon-XP" for the AMD AthlonXP
+     and Mobile and Durons based on Morgan core.
+   - "Athlon-MP" for the AMD AthlonMP 
    - "Crusoe" for the Transmeta Crusoe series.
    - "Winchip-C6" for original IDT Winchip.
    - "Winchip-2" for IDT Winchip 2.
arch/i386/Makefile +10 -2
diff -Pur linux-2.5.33.orig/arch/i386/Makefile linux-2.5.33/arch/i386/Makefile
@@ -61,10 +61,18 @@
 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_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) 
+ifdef CONFIG_MATHLONTB
+CFLAGS += $(shell if $(CC) -march=athlon-tbird -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-tbird"; elif $(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
 
+ifdef CONFIG_MATHLONXP
+CFLAGS += $(shell if $(CC) -march=athlon-xp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-xp"; elif $(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
+
+ifdef CONFIG_MATHLONMP
+CFLAGS += $(shell if $(CC) -march=athlon-mp -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon-mp"; elif $(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
+ 
 ifdef CONFIG_MCRUSOE
 CFLAGS += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
 endif
arch/i386/config.in +18 -2
diff -Pur linux-2.5.33.orig/arch/i386/config.in linux-2.5.33/arch/i386/config.in
@@ -25,7 +25,9 @@
 	 Pentium-III/Celeron(Coppermine)	CONFIG_MPENTIUMIII \
 	 Pentium-4				CONFIG_MPENTIUM4 \
 	 K6/K6-II/K6-III			CONFIG_MK6 \
-	 Athlon/Duron/K7			CONFIG_MK7 \
+	 Athlon-TB/Duron(Splitfire)             CONFIG_MATHLONTB \
+	 Athlon-XP/Athlon4/Duron(Morgan)        CONFIG_MATHLONXP \
+	 Athlon-MP                              CONFIG_MATHLONMP \
 	 Elan					CONFIG_MELAN \
 	 Crusoe					CONFIG_MCRUSOE \
 	 Winchip-C6				CONFIG_MWINCHIPC6 \
@@ -110,7 +112,21 @@
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
 fi
-if [ "$CONFIG_MK7" = "y" ]; then
+if [ "$CONFIG_MATHLONTB" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONXP" = "y" ]; then
+   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
+   define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_USE_3DNOW y
+   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+fi
+if [ "$CONFIG_MATHLONMP" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_GOOD_APIC y
#1 lore raw
Quoted 9 lines · Daniel Mehrmann

Hi Alan,

i add for the AMD Athlon family some optimize compilerflags. Gcc 3.1 and 3.2 support more specific Athlon instructions as 3.0 or 2.95x. This patch for 2.4.19, 2.4.20-pre5 and 2.5.33 set a new "-march" flag:

Athlon TB/Duron += -march=athlon-tbird
Athlon XP/Athlon4/Duron += -march=athlon-xp
Athlon MP += -march=athlon-mp

I thought these were all just gcc aliases for the same options ? It's been a while since I looked at the gcc option parser, so I've forgotten exactly what happens, but at least you missed the bogus athlon-4 option.

Are the gains between all these options really worth the added complexity ?

Dave

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
#2 lore raw
Quoted 17 lines · Dave Jones
Quoted 10 lines · Daniel Mehrmann

Hi Alan,

i add for the AMD Athlon family some optimize compilerflags. Gcc 3.1 and 3.2 support more specific Athlon instructions as 3.0 or 2.95x. This patch for 2.4.19, 2.4.20-pre5 and 2.5.33 set a new "-march" flag:

Athlon TB/Duron += -march=athlon-tbird
Athlon XP/Athlon4/Duron += -march=athlon-xp
Athlon MP += -march=athlon-mp

I thought these were all just gcc aliases for the same options ? It's been a while since I looked at the gcc option parser, so I've forgotten exactly what happens, but at least you missed the bogus athlon-4 option.

Quoted 4 lines

Are the gains between all these options really worth the added complexity ?

Dave

Hi Dave,

yes, you`re right with the athlon-4 option. Well, first thing, the mobile athlon have the same core as XP (Palomino) expect some "speed scheudle".
I never see that we support mobile chips. So i think it`s enough that we put Athlon4 into the "XP group". I think too the new core "Thoroughbread" should use the "XP group".

I readed the gcc documentation, gcc-3.2 only, very deep. This was the idea for this patch. Then i looked fast into gcc-3.1/3.0/2.95x. I believe that the compiler create own code for *every* chip-release. chip-release as: athlon-tbird, athlon-xp, ...

Also take a look into the binary code and size. It`s different.

chears,
Daniel

#3 lore raw

in your patch, you don't check the gcc version. if i run with a gcc-2.95.3, you will be a compile error

Quoted 53 lines · Daniel Mehrmann
Quoted 17 lines · Dave Jones
Quoted 10 lines · Daniel Mehrmann

Hi Alan,

i add for the AMD Athlon family some optimize compilerflags. Gcc 3.1 and 3.2 support more specific Athlon instructions as 3.0 or 2.95x. This patch for 2.4.19, 2.4.20-pre5 and 2.5.33 set a new "-march" flag:

Athlon TB/Duron += -march=athlon-tbird
Athlon XP/Athlon4/Duron += -march=athlon-xp
Athlon MP += -march=athlon-mp

I thought these were all just gcc aliases for the same options ? It's been a while since I looked at the gcc option parser, so I've forgotten exactly what happens, but at least you missed the bogus athlon-4 option.

Quoted 4 lines

Are the gains between all these options really worth the added complexity ?

Dave

Hi Dave,

yes, you`re right with the athlon-4 option. Well, first thing, the mobile athlon have the same core as XP (Palomino) expect some "speed scheudle".
I never see that we support mobile chips. So i think it`s enough that we put Athlon4 into the "XP group". I think too the new core "Thoroughbread" should use the "XP group".

I readed the gcc documentation, gcc-3.2 only, very deep. This was the idea for this patch. Then i looked fast into gcc-3.1/3.0/2.95x. I believe that the compiler create own code for *every* chip-release. chip-release as: athlon-tbird, athlon-xp, ...

Also take a look into the binary code and size. It`s different.

chears,
Daniel

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

Signature · 2 lines
Stephane Wirtel <[email protected]>
Web : www.linux-mons.be	 "Linux Is Not UniX !!!"
#4 lore raw
Quoted 2 lines · Stephane Wirtel

in your patch, you don't check the gcc version. if i run with a gcc-2.95.3, you will be a compile error

[...]
No, thats not correct. gcc-2.95.3 support the i686 flag. I made tests in the Makefile to check the compiler. If youre using 2.95x we make fallback to i686.

chears,
Daniel

#5 lore raw
In reply to Dave Jones
Quoted 16 lines · Dave Jones
Quoted 9 lines · Daniel Mehrmann

Hi Alan,

i add for the AMD Athlon family some optimize compilerflags. Gcc 3.1 and 3.2 support more specific Athlon instructions as 3.0 or 2.95x. This patch for 2.4.19, 2.4.20-pre5 and 2.5.33 set a new "-march" flag:

Athlon TB/Duron += -march=athlon-tbird
Athlon XP/Athlon4/Duron += -march=athlon-xp
Athlon MP += -march=athlon-mp

I thought these were all just gcc aliases for the same options ? It's been a while since I looked at the gcc option parser, so I've forgotten exactly what happens, but at least you missed the bogus athlon-4 option.

Quoted 5 lines

Are the gains between all these options really worth the added complexity ?

Dave

They all have the same scheduling AFAICS, there are minor variations between athlon, athlon-tbird, and the rest:

Quoted 11 lines

{"athlon", PROCESSOR_ATHLON, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW
| PTA_3DNOW_A},
{"athlon-tbird", PROCESSOR_ATHLON, PTA_MMX | PTA_PREFETCH_SSE
| PTA_3DNOW | PTA_3DNOW_A},
{"athlon-4", PROCESSOR_ATHLON, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW
| PTA_3DNOW_A | PTA_SSE},
{"athlon-xp", PROCESSOR_ATHLON, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW
| PTA_3DNOW_A | PTA_SSE},
{"athlon-mp", PROCESSOR_ATHLON, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW
| PTA_3DNOW_A | PTA_SSE},