* config/i386/i386.md (mmx_pinsrw): Output operands in correct
[official-gcc.git] / gcc / defaults.h
blobb6fe9ec8c860bfe03c7a041f1d5c1d132f0735e4
1 /* Definitions of various defaults for how to do assembler output
2 (most of which are designed to be appropriate for GAS or for
3 some BSD assembler).
4 Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000
5 Free Software Foundation, Inc.
6 Contributed by Ron Guilmette (rfg@monkeys.com)
8 This file is part of GNU CC.
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING. If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 #ifndef GCC_DEFAULTS_H
26 #define GCC_DEFAULTS_H
28 /* Store in OUTPUT a string (made with alloca) containing
29 an assembler-name for a local static variable or function named NAME.
30 LABELNO is an integer which is different for each call. */
32 #ifndef ASM_FORMAT_PRIVATE_NAME
33 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
34 do { \
35 int len = strlen (NAME); \
36 char *temp = (char *) alloca (len + 3); \
37 temp[0] = 'L'; \
38 strcpy (&temp[1], (NAME)); \
39 temp[len + 1] = '.'; \
40 temp[len + 2] = 0; \
41 (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
42 ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
43 } while (0)
44 #endif
46 #ifndef ASM_STABD_OP
47 #define ASM_STABD_OP "\t.stabd\t"
48 #endif
50 /* This is how to output an element of a case-vector that is absolute.
51 Some targets don't use this, but we have to define it anyway. */
53 #ifndef ASM_OUTPUT_ADDR_VEC_ELT
54 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
55 do { fprintf (FILE, "\t%s\t", ASM_LONG); \
56 ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \
57 fputc ('\n', FILE); \
58 } while (0)
59 #endif
61 /* Provide default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. */
62 #ifndef ASM_OUTPUT_ALTERNATE_LABEL_NAME
63 #define ASM_OUTPUT_ALTERNATE_LABEL_NAME(FILE,INSN) \
64 do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
65 #endif
67 /* choose a reasonable default for ASM_OUTPUT_ASCII. */
69 #ifndef ASM_OUTPUT_ASCII
70 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
71 do { \
72 FILE *_hide_asm_out_file = (MYFILE); \
73 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
74 int _hide_thissize = (MYLENGTH); \
75 { \
76 FILE *asm_out_file = _hide_asm_out_file; \
77 const unsigned char *p = _hide_p; \
78 int thissize = _hide_thissize; \
79 int i; \
80 fprintf (asm_out_file, "\t.ascii \""); \
82 for (i = 0; i < thissize; i++) \
83 { \
84 register int c = p[i]; \
85 if (c == '\"' || c == '\\') \
86 putc ('\\', asm_out_file); \
87 if (ISPRINT(c)) \
88 putc (c, asm_out_file); \
89 else \
90 { \
91 fprintf (asm_out_file, "\\%o", c); \
92 /* After an octal-escape, if a digit follows, \
93 terminate one string constant and start another. \
94 The Vax assembler fails to stop reading the escape \
95 after three digits, so this is the only way we \
96 can get it to parse the data properly. */ \
97 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
98 fprintf (asm_out_file, "\"\n\t.ascii \""); \
99 } \
101 fprintf (asm_out_file, "\"\n"); \
104 while (0)
105 #endif
107 #ifndef ASM_IDENTIFY_GCC
108 /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
109 because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
110 outputting labels, if we do want it to, then it must be defined
111 in the tm.h file. */
112 #ifndef ASM_IDENTIFY_LANGUAGE
113 #define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
114 #endif
115 #endif
117 /* This is how we tell the assembler to equate two values. */
118 #ifdef SET_ASM_OP
119 #ifndef ASM_OUTPUT_DEF
120 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
121 do { fprintf ((FILE), "%s", SET_ASM_OP); \
122 assemble_name (FILE, LABEL1); \
123 fprintf (FILE, ","); \
124 assemble_name (FILE, LABEL2); \
125 fprintf (FILE, "\n"); \
126 } while (0)
127 #endif
128 #endif
130 /* This is how to output a reference to a user-level label named NAME. */
132 #ifndef ASM_OUTPUT_LABELREF
133 #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
134 #endif
136 /* Allow target to print debug info labels specially. This is useful for
137 VLIW targets, since debug info labels should go into the middle of
138 instruction bundles instead of breaking them. */
140 #ifndef ASM_OUTPUT_DEBUG_LABEL
141 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
142 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
143 #endif
145 /* This determines whether or not we support weak symbols. */
146 #ifndef SUPPORTS_WEAK
147 #ifdef ASM_WEAKEN_LABEL
148 #define SUPPORTS_WEAK 1
149 #else
150 #define SUPPORTS_WEAK 0
151 #endif
152 #endif
154 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
155 provide a weak attribute. Else define it to nothing.
157 This would normally belong in gansidecl.h, but SUPPORTS_WEAK is
158 not available at that time.
160 Note, this is only for use by target files which we know are to be
161 compiled by GCC. */
162 #ifndef TARGET_ATTRIBUTE_WEAK
163 # if SUPPORTS_WEAK
164 # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
165 # else
166 # define TARGET_ATTRIBUTE_WEAK
167 # endif
168 #endif
170 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
171 the rest of the DWARF 2 frame unwind support is also provided. */
172 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
173 #define DWARF2_UNWIND_INFO 1
174 #endif
176 #if defined (DWARF2_UNWIND_INFO) && !defined (EH_FRAME_SECTION)
177 # if defined (EH_FRAME_SECTION_ASM_OP)
178 # define EH_FRAME_SECTION() eh_frame_section();
179 # else
180 /* If we aren't using crtstuff to run ctors, don't use it for EH. */
181 # if defined (ASM_OUTPUT_SECTION_NAME) && defined (ASM_OUTPUT_CONSTRUCTOR)
182 # define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,\"aw\""
183 # define EH_FRAME_SECTION() \
184 do { named_section (NULL_TREE, ".eh_frame", 0); } while (0)
185 # endif
186 # endif
187 #endif
189 /* By default, we generate a label at the beginning and end of the
190 text section, and compute the size of the text section by
191 subtracting the two. However, on some platforms that doesn't
192 work, and we use the section itself, rather than a label at the
193 beginning of it, to indicate the start of the section. On such
194 platforms, define this to zero. */
195 #ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL
196 #define DWARF2_GENERATE_TEXT_SECTION_LABEL 1
197 #endif
199 /* Supply a default definition for PROMOTE_PROTOTYPES. */
200 #ifndef PROMOTE_PROTOTYPES
201 #define PROMOTE_PROTOTYPES 0
202 #endif
204 /* Number of hardware registers that go into the DWARF-2 unwind info.
205 If not defined, equals FIRST_PSEUDO_REGISTER */
207 #ifndef DWARF_FRAME_REGISTERS
208 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
209 #endif
211 /* Default sizes for base C types. If the sizes are different for
212 your target, you should override these values by defining the
213 appropriate symbols in your tm.h file. */
215 #ifndef CHAR_TYPE_SIZE
216 #define CHAR_TYPE_SIZE BITS_PER_UNIT
217 #endif
219 #ifndef SHORT_TYPE_SIZE
220 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
221 #endif
223 #ifndef INT_TYPE_SIZE
224 #define INT_TYPE_SIZE BITS_PER_WORD
225 #endif
227 #ifndef LONG_TYPE_SIZE
228 #define LONG_TYPE_SIZE BITS_PER_WORD
229 #endif
231 #ifndef LONG_LONG_TYPE_SIZE
232 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
233 #endif
235 #ifndef WCHAR_TYPE_SIZE
236 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
237 #endif
239 #ifndef WCHAR_UNSIGNED
240 #define WCHAR_UNSIGNED 0
241 #endif
243 #ifndef FLOAT_TYPE_SIZE
244 #define FLOAT_TYPE_SIZE BITS_PER_WORD
245 #endif
247 #ifndef DOUBLE_TYPE_SIZE
248 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
249 #endif
251 #ifndef LONG_DOUBLE_TYPE_SIZE
252 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
253 #endif
255 #endif /* GCC_DEFAULTS_H */