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]

A bit of CPP stuff for i386/


I'm going to do this a bit at a time; it's too much of a tangle
otherwise.

This does the basic stuff differentiating 32 and 64 bit.  OK?

Neil.

	* config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): New.
	(CPP_CPU32_SPEC, CPP_CPU64_SPEC): Kill.
	(CPP_CPUCOMMON_SPEC): Rename CPP_CPU_SPEC.

Index: i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.266
diff -u -p -r1.266 i386.h
--- i386.h	30 May 2002 00:38:36 -0000	1.266
+++ i386.h	2 Jun 2002 22:49:21 -0000
@@ -473,6 +473,26 @@ extern int x86_prefetch_sse;
 %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.\n}"
 #endif
 
+/* Target CPU builtins.  */
+#define TARGET_CPU_CPP_BUILTINS()			\
+  do							\
+    {							\
+      if (TARGET_64BIT)					\
+	{						\
+	  builtin_assert ("cpu=x86_64");		\
+	  builtin_assert ("machine=x86_64");		\
+	  builtin_define ("__x86_64");			\
+	  builtin_define ("__x86_64__");		\
+	}						\
+      else						\
+	{						\
+	  builtin_assert ("cpu=i386");			\
+	  builtin_assert ("machine=i386");		\
+	  builtin_define_std ("i386");			\
+	}						\
+    }							\
+  while (0)
+
 #define TARGET_CPU_DEFAULT_i386 0
 #define TARGET_CPU_DEFAULT_i486 1
 #define TARGET_CPU_DEFAULT_pentium 2
@@ -535,14 +555,7 @@ extern int x86_prefetch_sse;
 #endif
 #endif /* CPP_CPU_DEFAULT_SPEC */
 
-#define CPP_CPU32_SPEC \
-  "-Acpu=i386 -Amachine=i386 %{!ansi:%{!std=c*:%{!std=i*:-Di386}}} -D__i386 \
--D__i386__"
-
-#define CPP_CPU64_SPEC \
-  "-Acpu=x86_64 -Amachine=x86_64 -D__x86_64 -D__x86_64__"
-
-#define CPP_CPUCOMMON_SPEC "\
+#define CPP_CPU_SPEC "\
 %{march=i386:%{!mcpu*:-D__tune_i386__ }}\
 %{march=i486:-D__i486 -D__i486__ %{!mcpu*:-D__tune_i486__ }}\
 %{march=pentium|march=i586:-D__i586 -D__i586__ -D__pentium -D__pentium__ \
@@ -589,22 +602,6 @@ extern int x86_prefetch_sse;
 %{march=pentium4: -D__SSE2__ }\
 %{!march*:%{!mcpu*:%{!m386:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}}}"
 
-#ifndef CPP_CPU_SPEC
-#ifdef TARGET_BI_ARCH
-#if TARGET_64BIT_DEFAULT
-#define CPP_CPU_SPEC "%{m32:%(cpp_cpu32)}%{!m32:%(cpp_cpu64)} %(cpp_cpucommon)"
-#else
-#define CPP_CPU_SPEC "%{m64:%(cpp_cpu64)}%{!m64:%(cpp_cpu32)} %(cpp_cpucommon)"
-#endif
-#else
-#if TARGET_64BIT_DEFAULT
-#define CPP_CPU_SPEC "%(cpp_cpu64) %(cpp_cpucommon)"
-#else
-#define CPP_CPU_SPEC "%(cpp_cpu32) %(cpp_cpucommon)"
-#endif
-#endif
-#endif
-
 #ifndef CC1_SPEC
 #define CC1_SPEC "%(cc1_cpu) "
 #endif
@@ -626,9 +623,6 @@ extern int x86_prefetch_sse;
 #define EXTRA_SPECS							\
   { "cpp_cpu_default",	CPP_CPU_DEFAULT_SPEC },				\
   { "cpp_cpu",	CPP_CPU_SPEC },						\
-  { "cpp_cpu32", CPP_CPU32_SPEC },					\
-  { "cpp_cpu64", CPP_CPU64_SPEC },					\
-  { "cpp_cpucommon", CPP_CPUCOMMON_SPEC },				\
   { "cc1_cpu",  CC1_CPU_SPEC },						\
   SUBTARGET_EXTRA_SPECS
 


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