An updated patch for i386 specs

H.J. Lu hjl@valinux.com
Mon Oct 18 07:00:00 GMT 1999


Hi,

Here is the updated patch for i386 specs. It is for gcc 2.95.2.
It is similar to

http://egcs.cygnus.com/ml/gcc-patches/1999-09/msg00419.html

But this one doesn't require the gcc driver change.

-- 
H.J. Lu (hjl@gnu.org)
Wed Sep  8 14:54:00 1999  H.J. Lu  (hjl@gnu.org)

	* gcc/config/i386/i386.h (CC1_CPU_SPEC): Remove "-march=i386"
	from "m386". Remove "-march=i486" from "m486". Add "m586",
	"m686".
	(CPP_486_ARCH_SPEC): Renamed from CPP_486_SPEC.
	(CPP_586_ARCH_SPEC): Renamed from CPP_586_SPEC.
	(CPP_686_ARCH_SPEC): Renamed from CPP_686_SPEC.
	(CPP_K6_ARCH_SPEC): Renamed from CPP_K6_SPEC.
	(CPP_386_CPU_SPEC): New.
	(CPP_486_CPU_SPEC): New.
	(CPP_586_CPU_SPEC): New.
	(CPP_686_CPU_SPEC): New.
	(CPP_K6_CPU_SPEC): New.
	(EXTRA_SPECS): Remove "cpp_486", "cpp_586", "cpp_686",
	"cpp_k6". Add "cpp_386_cpu", "cpp_486_cpu", "cpp_586_cpu",
	"cpp_686_cpu", "cpp_k6_cpu", "cpp_486_arch", "cpp_586_arch",
	"cpp_686_arch", "cpp_k6_arch".
	(CPP_CPU_DEFAULT_SPEC): Changed to "%(cpp_*6_cpu)".
	(CPP_CPU_SPEC): Use "%(cpp_*6_cpu)" and "%(cpp_*6_arch)".

--- ../../import/gcc-2.95.x/egcs/gcc/config/i386/i386.h	Sun Apr 25 04:43:49 1999
+++ gcc/config/i386/i386.h	Wed Sep  8 15:39:31 1999
@@ -293,32 +293,38 @@ extern int ix86_arch;
 #ifndef CC1_CPU_SPEC
 #define CC1_CPU_SPEC "\
 %{!mcpu*: \
-%{m386:-mcpu=i386 -march=i386} \
-%{m486:-mcpu=i486 -march=i486} \
-%{mpentium:-mcpu=pentium} \
-%{mpentiumpro:-mcpu=pentiumpro}}"
+%{m386:-mcpu=i386} \
+%{m486:-mcpu=i486} \
+%{mpentium|m586:-mcpu=pentium} \
+%{mpentiumpro|m686:-mcpu=pentiumpro}}"
 #endif
 
-#define CPP_486_SPEC "%{!ansi:-Di486} -D__i486 -D__i486__"
-#define CPP_586_SPEC "%{!ansi:-Di586 -Dpentium} \
+#define CPP_486_ARCH_SPEC "%{!ansi:-Di486} -D__i486 -D__i486__"
+#define CPP_586_ARCH_SPEC "%{!ansi:-Di586 -Dpentium} \
 	-D__i586 -D__i586__ -D__pentium -D__pentium__"
-#define CPP_K6_SPEC "%{!ansi:-Di586 -Dk6} \
+#define CPP_K6_ARCH_SPEC "%{!ansi:-Di586 -Dk6} \
 	-D__i586 -D__i586__ -D__k6 -D__k6__" 
-#define CPP_686_SPEC "%{!ansi:-Di686 -Dpentiumpro} \
+#define CPP_686_ARCH_SPEC "%{!ansi:-Di686 -Dpentiumpro} \
 	-D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__"
 
+#define CPP_386_CPU_SPEC "-D__tune_i386__"
+#define CPP_486_CPU_SPEC "-D__tune_i486__"
+#define CPP_586_CPU_SPEC "-D__tune_pentium__"
+#define CPP_K6_CPU_SPEC "-D__tune_k6__"
+#define CPP_686_CPU_SPEC "-D__tune_pentiumpro__"
+
 #ifndef CPP_CPU_DEFAULT_SPEC
 #if TARGET_CPU_DEFAULT == 1
-#define CPP_CPU_DEFAULT_SPEC "%(cpp_486)"
+#define CPP_CPU_DEFAULT_SPEC "%(cpp_486_cpu)"
 #endif
 #if TARGET_CPU_DEFAULT == 2
-#define CPP_CPU_DEFAULT_SPEC "%(cpp_586)"
+#define CPP_CPU_DEFAULT_SPEC "%(cpp_586_cpu)"
 #endif
 #if TARGET_CPU_DEFAULT == 3
-#define CPP_CPU_DEFAULT_SPEC "%(cpp_686)"
+#define CPP_CPU_DEFAULT_SPEC "%(cpp_686_cpu)"
 #endif
 #if TARGET_CPU_DEFAULT == 4
-#define CPP_CPU_DEFAULT_SPEC "%(cpp_k6)"
+#define CPP_CPU_DEFAULT_SPEC "%(cpp_k6_cpu)"
 #endif
 #ifndef CPP_CPU_DEFAULT_SPEC
 #define CPP_CPU_DEFAULT_SPEC ""
@@ -329,11 +335,16 @@ extern int ix86_arch;
 #define CPP_CPU_SPEC "\
 -Acpu(i386) -Amachine(i386) \
 %{!ansi:-Di386} -D__i386 -D__i386__ \
-%{mcpu=i486:%(cpp_486)} %{m486:%(cpp_486)} \
-%{mpentium:%(cpp_586)} %{mcpu=pentium:%(cpp_586)} \
-%{mpentiumpro:%(cpp_686)} %{mcpu=pentiumpro:%(cpp_686)} \
-%{mcpu=k6:%(cpp_k6)} \
-%{!mcpu*:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}"
+%{march=i486: %(cpp_486_arch)} \
+%{march=pentium|march=i586: %(cpp_586_arch)} \
+%{march=pentiumpro|march=i686: %(cpp_686_arch)} \
+%{march=k6: %(cpp_k6_arch)} \
+%{m386|mcpu=i386: %(cpp_386_cpu)} \
+%{m486|mcpu=i486: %(cpp_486_cpu)} \
+%{mpentium|m586|mcpu=pentium|mcpu=i586: %(cpp_586_cpu)} \
+%{mpentiumpro|m686|mcpu=pentiumpro|mcpu=i686: %(cpp_686_cpu)} \
+%{mcpu=k6:%(cpp_k6_cpu)} \
+%{!mcpu*:%{!m386:%{!m486:%{!m586:%{!m686:%{!mpentium*:%(cpp_cpu_default)}}}}}}"
 #endif
 
 #ifndef CC1_SPEC
@@ -355,10 +366,15 @@ extern int ix86_arch;
 #endif
 
 #define EXTRA_SPECS							\
-  { "cpp_486", CPP_486_SPEC},						\
-  { "cpp_586", CPP_586_SPEC},						\
-  { "cpp_k6", CPP_K6_SPEC},						\
-  { "cpp_686", CPP_686_SPEC},						\
+  { "cpp_386_cpu", CPP_386_CPU_SPEC},					\
+  { "cpp_486_cpu", CPP_486_CPU_SPEC},					\
+  { "cpp_586_cpu", CPP_586_CPU_SPEC},					\
+  { "cpp_k6_cpu", CPP_K6_CPU_SPEC},					\
+  { "cpp_686_cpu", CPP_686_CPU_SPEC},					\
+  { "cpp_486_arch", CPP_486_ARCH_SPEC},					\
+  { "cpp_586_arch", CPP_586_ARCH_SPEC},					\
+  { "cpp_k6_arch", CPP_K6_ARCH_SPEC},					\
+  { "cpp_686_arch", CPP_686_ARCH_SPEC},					\
   { "cpp_cpu_default",	CPP_CPU_DEFAULT_SPEC },				\
   { "cpp_cpu",	CPP_CPU_SPEC },						\
   { "cc1_cpu",  CC1_CPU_SPEC },						\


More information about the Gcc-patches mailing list