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.h125
1 files changed, 107 insertions, 18 deletions
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index ec816259bde..3b8c091efc7 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -1,5 +1,6 @@
/* Target definitions for x86 running Darwin.
- Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+ APPLE LOCAL mainline 2005-04-11
+ Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
This file is part of GCC.
@@ -25,13 +26,19 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (i686 Darwin)");
+/* APPLE LOCAL begin mainline 2005-04-11 4010614 */
+#undef TARGET_FPMATH_DEFAULT
+#define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387)
+/* APPLE LOCAL end mainline 2005-04-11 4010614 */
+
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__i386__"); \
builtin_define ("__LITTLE_ENDIAN__"); \
- builtin_define ("__MACH__"); \
- builtin_define ("__APPLE__"); \
+ /* APPLE LOCAL remove __MACH__ and __APPLE__, defined in gcc/config/darwin.h */\
+ /* APPLE LOCAL constant cfstrings */ \
+ SUBTARGET_OS_CPP_BUILTINS (); \
} \
while (0)
@@ -39,17 +46,34 @@ Boston, MA 02111-1307, USA. */
the kernel or some such. */
#undef CC1_SPEC
-#define CC1_SPEC "%{!static:-fPIC}\
- %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}"
+/* APPLE LOCAL begin dynamic-no-pic */
+#define CC1_SPEC "\
+%{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
+"/* APPLE LOCAL ignore -mcpu=G4 -mcpu=G5 */"\
+%{!static:%{!mdynamic-no-pic:-fPIC}} %<faltivec %<mno-fused-madd %<mlong-branch %<mlongcall %<mcpu=G4 %<mcpu=G5"
+/* APPLE LOCAL end dynamic-no-pic */
+
+/* APPLE LOCAL AltiVec */
+#define CPP_ALTIVEC_SPEC "%<faltivec"
#undef ASM_SPEC
-#define ASM_SPEC "-arch i686 -force_cpusubtype_ALL"
+/* APPLE LOCAL mainline 2005-04-11 */
+#define ASM_SPEC "-arch i386 -force_cpusubtype_ALL"
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
- { "darwin_arch", "i686" }, \
- { "darwin_subarch", "%{march=pentium3:pentIIm3;:i686}" },
-
+ /* APPLE LOCAL begin mainline 2005-04-11 */ \
+ { "darwin_arch", "i386" }, \
+ { "darwin_subarch", "i386" },
+ /* APPLE LOCAL end mainline 2005-04-11 */
+
+/* APPLE LOCAL begin 4078600 */
+/* Support for configure-time defaults of some command line options. */
+#undef OPTION_DEFAULT_SPECS
+#define OPTION_DEFAULT_SPECS \
+ {"arch", "%{!march=*:-march=%(VALUE)}"}, \
+ {"tune", "%{!mtune=*:-mtune=%(VALUE)}"}
+/* APPLE LOCAL end 4078600 */
/* Use the following macro for any Darwin/x86-specific command-line option
translation. */
@@ -67,6 +91,12 @@ Boston, MA 02111-1307, USA. */
#define SHIFT_DOUBLE_OMITS_COUNT 0
+/* APPLE LOCAL begin deep branch prediction pic-base */
+extern void darwin_x86_file_end (void);
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END darwin_x86_file_end
+/* APPLE LOCAL end deep branch prediction pic-base */
+
/* Define the syntax of pseudo-ops, labels and comments. */
/* String containing the assembler's comment-starter. */
@@ -76,17 +106,16 @@ Boston, MA 02111-1307, USA. */
/* By default, target has a 80387, uses IEEE compatible arithmetic,
and returns float values in the 387. */
-#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
-
-/* TARGET_DEEP_BRANCH_PREDICTION is incompatible with Mach-O PIC. */
+/* APPLE LOCAL temporary not ALIGN_DOUBLE */
+#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_128BIT_LONG_DOUBLE | (0 & MASK_ALIGN_DOUBLE))
-#undef TARGET_DEEP_BRANCH_PREDICTION
-#define TARGET_DEEP_BRANCH_PREDICTION 0
+/* APPLE LOCAL begin dynamic-no-pic */
+/* Darwin switches. */
+/* Use dynamic-no-pic codegen (no picbase reg; not suitable for shlibs.) */
+#define MASK_MACHO_DYNAMIC_NO_PIC (0x00800000)
-/* For now, disable dynamic-no-pic. We'll need to go through i386.c
- with a fine-tooth comb looking for refs to flag_pic! */
-#define MASK_MACHO_DYNAMIC_NO_PIC 0
-#define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC)
+#define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC)
+/* APPLE LOCAL end dynamic-no-pic */
/* Define the syntax of pseudo-ops, labels and comments. */
@@ -131,6 +160,37 @@ 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)
+
+#define REGISTER_TARGET_PRAGMAS DARWIN_REGISTER_TARGET_PRAGMAS
+
+#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED) \
+ (((TREE_CODE (TYPE) == RECORD_TYPE \
+ || TREE_CODE (TYPE) == UNION_TYPE \
+ || TREE_CODE (TYPE) == QUAL_UNION_TYPE) \
+ && TARGET_ALIGN_MAC68K \
+ && MAX (COMPUTED, SPECIFIED) == 8) ? 16 \
+ : MAX (COMPUTED, SPECIFIED))
+
+#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) \
@@ -143,3 +203,32 @@ Boston, MA 02111-1307, USA. */
} \
else fprintf (FILE, "\tcall mcount\n"); \
} while (0)
+
+/* APPLE LOCAL begin SSE stack alignment */
+#define BASIC_STACK_BOUNDARY (128)
+/* APPLE LOCAL end SSE stack alignment */
+
+/* APPLE LOCAL begin fix-and-continue x86 */
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+ do { \
+ /* Handle -mfix-and-continue. */ \
+ if (darwin_fix_and_continue_switch) \
+ { \
+ const char *base = darwin_fix_and_continue_switch; \
+ while (base[-1] != 'm') base--; \
+ \
+ if (*darwin_fix_and_continue_switch != '\0') \
+ error ("invalid option %qs", base); \
+ darwin_fix_and_continue = (base[0] != 'n'); \
+ } \
+ } while (0)
+
+/* True, iff we're generating fast turn around debugging code. When
+ true, we arrange for function prologues to start with 6 nops so
+ that gdb may insert code to redirect them, and for data to be
+ accessed indirectly. The runtime uses this indirection to forward
+ references for data to the original instance of that data. */
+
+#define TARGET_FIX_AND_CONTINUE (darwin_fix_and_continue)
+/* APPLE LOCAL end fix-and-continue x86 */