This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Switch the default for x86_64-pc-linux to x86-64 not k8


GCC currently defaults to compiling x86-64 builds to march=k8.

With the upcoming Nocona processor, this isn't quite right since the k8 allows for 3DNow which Nocona will not support. Patches were already committed which allows for a generic x86-64 build (i.e. without 3DNow or SSE3), but config.gcc was not changed to default to that mode.

This patch now makes that generic mode the default for x86_64 builds. Like i386-*-*, it accomodates that builds for specific processors such as athlon64-pc-linux-gnu to default to the appropriate architecture.

Tested by cross building cc1.exe to x86_64-pc-linux, amd64-pc-linux, and nocona-pc-linux (along with the appropriate hack to config.sub).

OK for install?
2004-05-06  Kelley Cook  <kcook34@gcc.gnu.org>

	* config.gcc: Recognize --with-cpu=x86-64 and default to it for target
	x86_64-*-*.
	* config/i386/i386.h: Recognize --with-cpu=x86-64.

diff -uprd ../../gcc-orig/gcc/config/i386/i386.h ./config/i386/i386.h
--- ../../gcc-orig/gcc/config/i386/i386.h	2004-04-09 15:57:45.000000000 -0400
+++ ./config/i386/i386.h	2004-05-05 10:28:08.968979500 -0400
@@ -710,7 +710,7 @@ extern int x86_prefetch_sse;
 				  "pentiumpro", "pentium2", "pentium3", \
 				  "pentium4", "k6", "k6-2", "k6-3",\
 				  "athlon", "athlon-4", "k8", \
-				  "pentium-m", "prescott", "nocona"}
+				  "pentium-m", "prescott", "nocona", "x86-64"}
 
 #ifndef CC1_SPEC
 #define CC1_SPEC "%(cc1_cpu) "
diff -uprd ../../gcc-orig/gcc/config.gcc ./config.gcc
--- ../../gcc-orig/gcc/config.gcc	2004-04-30 16:29:19.000000000 -0400
+++ ./config.gcc	2004-05-06 08:40:33.609634500 -0400
@@ -2144,7 +2144,17 @@ if test x$with_cpu = x ; then
       esac
       ;;
     x86_64-*-*)
-      with_cpu=k8
+      case ${target_noncanonical} in
+        k8-*|opteron-*|athlon64-*|amd64-*)
+          with_cpu=k8
+          ;;
+        nocona-*)
+          with_cpu=nocona
+          ;;
+        *)
+          with_cpu=x86-64
+          ;;
+      esac
       ;;
     alphaev6[78]*-*-*)
       with_cpu=ev67
@@ -2344,7 +2354,7 @@ fi
 			| c3 | c3-2 | i686 | pentiumpro | pentium2 | pentium3 \
 			| pentium4 | k6 | k6-2 | k6-3 | athlon | athlon-tbird \
 			| athlon-4 | athlon-xp | athlon-mp | k8 | opteron \
-			| athlon64 | athlon-fx | prescott | pentium-m \
+			| athlon64 | athlon-fx | prescott | x86-64 | pentium-m \
 			| pentium4m | pentium3m| nocona)
 				# OK
 				;;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]