OSDN Git Service

* real.h (ieee_extended_intel_96_round_53_format): New.
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / darwin.h
1 /* Target definitions for x86 running Darwin.
2    Copyright (C) 2001, 2002 Free Software Foundation, Inc.
3    Contributed by Apple Computer Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 /* Enable Mach-O bits in generic x86 code.  */
23 #undef TARGET_MACHO
24 #define TARGET_MACHO 1
25
26 #define TARGET_VERSION fprintf (stderr, " (i386 Darwin)");
27
28 #define TARGET_OS_CPP_BUILTINS()                \
29   do                                            \
30     {                                           \
31       builtin_define ("__i386__");              \
32       builtin_define ("__LITTLE_ENDIAN__");     \
33       builtin_define ("__MACH__");              \
34       builtin_define ("__APPLE__");             \
35     }                                           \
36   while (0)
37
38 /* We want -fPIC by default, unless we're using -static to compile for
39    the kernel or some such.  */
40
41 #undef CC1_SPEC
42 #define CC1_SPEC "%{!static:-fPIC}"
43
44 /* The Darwin assembler mostly follows AT&T syntax.  */
45 #undef ASSEMBLER_DIALECT
46 #define ASSEMBLER_DIALECT ASM_ATT
47
48 /* Define macro used to output shift-double opcodes when the shift
49    count is in %cl.  Some assemblers require %cl as an argument;
50    some don't.  This macro controls what to do: by default, don't
51    print %cl.  */
52
53 #define SHIFT_DOUBLE_OMITS_COUNT 0
54
55 /* Define the syntax of pseudo-ops, labels and comments.  */
56
57 /* String containing the assembler's comment-starter.  */
58
59 #define ASM_COMMENT_START "#"
60
61 /* By default, target has a 80387, uses IEEE compatible arithmetic,
62    and returns float values in the 387.  */
63
64 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
65
66 /* TARGET_DEEP_BRANCH_PREDICTION is incompatible with Mach-O PIC.  */
67
68 #undef TARGET_DEEP_BRANCH_PREDICTION
69 #define TARGET_DEEP_BRANCH_PREDICTION   0
70
71 /* For now, disable dynamic-no-pic.  We'll need to go through i386.c
72    with a fine-tooth comb looking for refs to flag_pic!  */
73 #define MASK_MACHO_DYNAMIC_NO_PIC 0
74 #define TARGET_DYNAMIC_NO_PIC     (target_flags & MASK_MACHO_DYNAMIC_NO_PIC)
75
76 /* Define the syntax of pseudo-ops, labels and comments.  */
77
78 #define LPREFIX "L"
79
80 /* Assembler pseudos to introduce constants of various size.  */
81
82 #define ASM_BYTE_OP "\t.byte\t"
83 #define ASM_SHORT "\t.word\t"
84 #define ASM_LONG "\t.long\t"
85 /* Darwin as doesn't do ".quad".  */
86
87 #undef ASM_OUTPUT_ALIGN
88 #define ASM_OUTPUT_ALIGN(FILE,LOG)      \
89  do { if ((LOG) != 0)                   \
90         {                               \
91           if (in_text_section ())       \
92             fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \
93           else                          \
94             fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \
95         }                               \
96     } while (0)
97
98 /* This says how to output an assembler line
99    to define a global common symbol.  */
100
101 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
102 ( fputs (".comm ", (FILE)),                     \
103   assemble_name ((FILE), (NAME)),               \
104   fprintf ((FILE), ",%lu\n", (unsigned long)(ROUNDED)))
105
106 /* This says how to output an assembler line
107    to define a local common symbol.  */
108
109 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
110 ( fputs (".lcomm ", (FILE)),                    \
111   assemble_name ((FILE), (NAME)),               \
112   fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (ROUNDED)))
113
114 /* Darwin profiling -- call mcount.  */
115 #undef FUNCTION_PROFILER
116 #define FUNCTION_PROFILER(FILE, LABELNO)                                \
117     do {                                                                \
118       if (MACHOPIC_INDIRECT)                                            \
119         {                                                               \
120           const char *name = machopic_stub_name ("*mcount");            \
121           fprintf (FILE, "\tcall %s\n", name+1);  /*  skip '&'  */      \
122           machopic_validate_stub_or_non_lazy_ptr (name, /*stub:*/1);    \
123         }                                                               \
124       else fprintf (FILE, "\tcall mcount\n");                           \
125     } while (0)