aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386/darwin.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/darwin.h')
-rw-r--r--gcc/config/i386/darwin.h89
1 files changed, 82 insertions, 7 deletions
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index accffeee90c..f20c9d896b5 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -23,15 +23,21 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_MACHO
#define TARGET_MACHO 1
-#define TARGET_VERSION fprintf (stderr, " (i686 Darwin)");
+/* APPLE LOCAL begin default to ppro */
+/* Default to -mcpu=pentiumpro instead of i386 (radar 2730299) ilr */
+#undef TARGET_CPU_DEFAULT
+#define TARGET_CPU_DEFAULT 4
+/* APPLE LOCAL end default to ppro */
+
+#define TARGET_VERSION fprintf (stderr, " (i386 Darwin)");
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__i386__"); \
builtin_define ("__LITTLE_ENDIAN__"); \
- builtin_define ("__MACH__"); \
- builtin_define ("__APPLE__"); \
+ /* APPLE LOCAL constant cfstrings */ \
+ SUBTARGET_OS_CPP_BUILTINS (); \
} \
while (0)
@@ -39,19 +45,51 @@ Boston, MA 02111-1307, USA. */
the kernel or some such. */
#undef CC1_SPEC
-#define CC1_SPEC "%{!static:-fPIC}"
+/* APPLE LOCAL dynamic-no-pic */
+/* APPLE LOCAL ignore -mcpu=G4 -mcpu=G5 */
+/* When -mdynamic-no-pic finally works, remove the "xx" below. FIXME!! */
+#define CC1_SPEC "%{!static:%{!mxxdynamic-no-pic:-fPIC}} %<faltivec %<mlong-branch %<mlongcall %<mcpu=G4 %<mcpu=G5"
+
+/* APPLE LOCAL AltiVec */
+#define CPP_ALTIVEC_SPEC "%<faltivec"
+
+/* APPLE LOCAL begin 3492132 */
-#define ASM_SPEC "-arch i686 \
+#define ASM_SPEC "%(darwin_arch_asm_spec)\
-force_cpusubtype_ALL \
%{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
%{!Zforce_cpusubtype_ALL:%{mmmx:-force_cpusubtype_ALL}\
%{msse:-force_cpusubtype_ALL}\
%{msse2:-force_cpusubtype_ALL}}"
+#define DARWIN_ARCH_LD_SPEC \
+"%{march=i386: %{!Zdynamiclib:-arch i386} %{Zdynamiclib:-arch_only i386}} \
+ %{march=i486: %{!Zdynamiclib:-arch i486} %{Zdynamiclib:-arch_only i486}} \
+ %{march=i586: %{!Zdynamiclib:-arch i586} %{Zdynamiclib:-arch_only i586}} \
+ %{march=pentium: %{!Zdynamiclib:-arch pentium} %{Zdynamiclib:-arch_only pentium}} \
+ %{march=pentiumpro: %{!Zdynamiclib:-arch pentpro} %{Zdynamiclib:-arch_only pentpro}} \
+ %{march=i686: %{!Zdynamiclib:-arch i686} %{Zdynamiclib:-arch_only i686}} \
+ %{march=pentium3: %{!Zdynamiclib:-arch pentIIm3} %{Zdynamiclib:-arch_only pentIIm3}} \
+ %{!mcpu*:%{!march*:%{!Zdynamiclib:-arch i686} %{Zdynamiclib:-arch_only i686}}} "
+
+#define DARWIN_ARCH_ASM_SPEC \
+"%{march=i386: -arch i386} \
+ %{march=i486: -arch i486} \
+ %{march=i586: -arch i586} \
+ %{march=pentium: -arch pentium} \
+ %{march=pentiumpro: -arch pentpro} \
+ %{march=i686: -arch i686} \
+ %{march=pentium3: -arch pentIIm3} \
+ %{!mcpu*:%{!march*: -arch i686}} "
+
#undef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS \
+#define SUBTARGET_EXTRA_SPECS \
+ { "darwin_arch_asm_spec", DARWIN_ARCH_ASM_SPEC }, \
+ { "darwin_arch_ld_spec", DARWIN_ARCH_LD_SPEC }, \
{ "darwin_arch", "i686" },
+/* APPLE LOCAL end 3492132 */
+
/* Use the following macro for any Darwin/x86-specific command-line option
translation. */
#define SUBTARGET_OPTION_TRANSLATE_TABLE \
@@ -104,7 +142,12 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
do { if ((LOG) != 0) \
{ \
- if (in_text_section ()) \
+ /* APPLE LOCAL coalescing */ \
+ if (in_text_section () \
+ || in_unlikely_text_section () \
+ || darwin_named_section_is ("__TEXT,__textcoal,coalesced") \
+ || darwin_named_section_is ("__TEXT,__textcoal_nt,coalesced,no_toc") \
+ || darwin_named_section_is (STATIC_INIT_SECTION)) \
fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \
else \
fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \
@@ -127,6 +170,27 @@ Boston, MA 02111-1307, USA. */
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (ROUNDED)))
+
+/* APPLE LOCAL begin Macintosh alignment 2002-2-19 ff */
+#define MASK_ALIGN_NATURAL 0x40000000
+#define TARGET_ALIGN_NATURAL (target_flags & MASK_ALIGN_NATURAL)
+#define rs6000_alignment_flags target_flags
+#define MASK_ALIGN_MAC68K 0x20000000
+#define TARGET_ALIGN_MAC68K (target_flags & MASK_ALIGN_MAC68K)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ {"align-mac68k", MASK_ALIGN_MAC68K, \
+ N_("Align structs and unions according to mac68k rules")}, \
+ {"align-power", - (MASK_ALIGN_MAC68K | MASK_ALIGN_NATURAL), \
+ N_("Align structs and unions according to PowerPC rules")}, \
+ {"align-natural", MASK_ALIGN_NATURAL, \
+ N_("Align structs and unions according to natural rules")}, \
+ {"dynamic-no-pic", MASK_MACHO_DYNAMIC_NO_PIC, \
+ N_("Generate code suitable for executables (NOT shared libs)")},\
+ {"no-dynamic-no-pic", -MASK_MACHO_DYNAMIC_NO_PIC, ""},
+/* APPLE LOCAL end Macintosh alignment 2002-2-19 ff */
+
/* Darwin profiling -- call mcount. */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
@@ -139,3 +203,14 @@ Boston, MA 02111-1307, USA. */
} \
else fprintf (FILE, "\tcall mcount\n"); \
} while (0)
+
+/* APPLE LOCAL SSE stack alignment */
+#define BASIC_STACK_BOUNDARY (128)
+
+#undef SUBTARGET_OVERRIDE_OPTIONS
+/* Force Darwin/x86 to default as "-march=i686 -mcpu=pentium4". */
+#define SUBTARGET_OVERRIDE_OPTIONS \
+ do { \
+ if (!ix86_arch_string) ix86_arch_string = "pentiumpro"; \
+ if (!ix86_tune_string) ix86_tune_string = "pentium4"; \
+ } while (0)