]> gcc.gnu.org Git - gcc.git/blob - gcc/config/i386/i386.h
Patch from Ulrich to fix problems with default CPU defines.
[gcc.git] / gcc / config / i386 / i386.h
1 /* Definitions of target machine for GNU compiler for Intel X86
2 (386, 486, Pentium).
3 Copyright (C) 1988, 92, 94, 95, 96, 97, 1998 Free Software Foundation, 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 /* The purpose of this file is to define the characteristics of the i386,
23 independent of assembler syntax or operating system.
24
25 Three other files build on this one to describe a specific assembler syntax:
26 bsd386.h, att386.h, and sun386.h.
27
28 The actual tm.h file for a particular system should include
29 this file, and then the file for the appropriate assembler syntax.
30
31 Many macros that specify assembler syntax are omitted entirely from
32 this file because they really belong in the files for particular
33 assemblers. These include AS1, AS2, AS3, RP, IP, LPREFIX, L_SIZE,
34 PUT_OP_SIZE, USE_STAR, ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE,
35 PRINT_B_I_S, and many that start with ASM_ or end in ASM_OP. */
36
37 /* Names to predefine in the preprocessor for this target machine. */
38
39 #define I386 1
40
41 /* Stubs for half-pic support if not OSF/1 reference platform. */
42
43 #ifndef HALF_PIC_P
44 #define HALF_PIC_P() 0
45 #define HALF_PIC_NUMBER_PTRS 0
46 #define HALF_PIC_NUMBER_REFS 0
47 #define HALF_PIC_ENCODE(DECL)
48 #define HALF_PIC_DECLARE(NAME)
49 #define HALF_PIC_INIT() error ("half-pic init called on systems that don't support it.")
50 #define HALF_PIC_ADDRESS_P(X) 0
51 #define HALF_PIC_PTR(X) X
52 #define HALF_PIC_FINISH(STREAM)
53 #endif
54
55 /* Define the specific costs for a given cpu */
56
57 struct processor_costs {
58 int add; /* cost of an add instruction */
59 int lea; /* cost of a lea instruction */
60 int shift_var; /* variable shift costs */
61 int shift_const; /* constant shift costs */
62 int mult_init; /* cost of starting a multiply */
63 int mult_bit; /* cost of multiply per each bit set */
64 int divide; /* cost of a divide/mod */
65 };
66
67 extern struct processor_costs *ix86_cost;
68
69 /* Run-time compilation parameters selecting different hardware subsets. */
70
71 extern int target_flags;
72
73 /* Macros used in the machine description to test the flags. */
74
75 /* configure can arrange to make this 2, to force a 486. */
76 #ifndef TARGET_CPU_DEFAULT
77 #define TARGET_CPU_DEFAULT 0
78 #endif
79
80 /* Masks for the -m switches */
81 #define MASK_80387 000000000001 /* Hardware floating point */
82 #define MASK_NOTUSED1 000000000002 /* bit not currently used */
83 #define MASK_NOTUSED2 000000000004 /* bit not currently used */
84 #define MASK_RTD 000000000010 /* Use ret that pops args */
85 #define MASK_ALIGN_DOUBLE 000000000020 /* align doubles to 2 word boundary */
86 #define MASK_SVR3_SHLIB 000000000040 /* Uninit locals into bss */
87 #define MASK_IEEE_FP 000000000100 /* IEEE fp comparisons */
88 #define MASK_FLOAT_RETURNS 000000000200 /* Return float in st(0) */
89 #define MASK_NO_FANCY_MATH_387 000000000400 /* Disable sin, cos, sqrt */
90 #define MASK_OMIT_LEAF_FRAME_POINTER 0x00000800 /* omit leaf frame pointers */
91 /* Temporary codegen switches */
92 #define MASK_DEBUG_ADDR 000001000000 /* Debug GO_IF_LEGITIMATE_ADDRESS */
93 #define MASK_NO_WIDE_MULTIPLY 000002000000 /* Disable 32x32->64 multiplies */
94 #define MASK_NO_MOVE 000004000000 /* Don't generate mem->mem */
95 #define MASK_NO_PSEUDO 000010000000 /* Move op's args -> pseudos */
96 #define MASK_DEBUG_ARG 000020000000 /* Debug function_arg */
97 #define MASK_SCHEDULE_PROLOGUE 000040000000 /* Emit prologue as rtl */
98 #define MASK_STACK_PROBE 000100000000 /* Enable stack probing */
99
100 /* Use the floating point instructions */
101 #define TARGET_80387 (target_flags & MASK_80387)
102
103 /* Compile using ret insn that pops args.
104 This will not work unless you use prototypes at least
105 for all functions that can take varying numbers of args. */
106 #define TARGET_RTD (target_flags & MASK_RTD)
107
108 /* Align doubles to a two word boundary. This breaks compatibility with
109 the published ABI's for structures containing doubles, but produces
110 faster code on the pentium. */
111 #define TARGET_ALIGN_DOUBLE (target_flags & MASK_ALIGN_DOUBLE)
112
113 /* Put uninitialized locals into bss, not data.
114 Meaningful only on svr3. */
115 #define TARGET_SVR3_SHLIB (target_flags & MASK_SVR3_SHLIB)
116
117 /* Use IEEE floating point comparisons. These handle correctly the cases
118 where the result of a comparison is unordered. Normally SIGFPE is
119 generated in such cases, in which case this isn't needed. */
120 #define TARGET_IEEE_FP (target_flags & MASK_IEEE_FP)
121
122 /* Functions that return a floating point value may return that value
123 in the 387 FPU or in 386 integer registers. If set, this flag causes
124 the 387 to be used, which is compatible with most calling conventions. */
125 #define TARGET_FLOAT_RETURNS_IN_80387 (target_flags & MASK_FLOAT_RETURNS)
126
127 /* Disable generation of FP sin, cos and sqrt operations for 387.
128 This is because FreeBSD lacks these in the math-emulator-code */
129 #define TARGET_NO_FANCY_MATH_387 (target_flags & MASK_NO_FANCY_MATH_387)
130
131 /* Don't create frame pointers for leaf functions */
132 #define TARGET_OMIT_LEAF_FRAME_POINTER (target_flags & MASK_OMIT_LEAF_FRAME_POINTER)
133
134 /* Temporary switches for tuning code generation */
135
136 /* Disable 32x32->64 bit multiplies that are used for long long multiplies
137 and division by constants, but sometimes cause reload problems. */
138 #define TARGET_NO_WIDE_MULTIPLY (target_flags & MASK_NO_WIDE_MULTIPLY)
139 #define TARGET_WIDE_MULTIPLY (!TARGET_NO_WIDE_MULTIPLY)
140
141 /* Emit/Don't emit prologue as rtl */
142 #define TARGET_SCHEDULE_PROLOGUE (target_flags & MASK_SCHEDULE_PROLOGUE)
143
144 /* Debug GO_IF_LEGITIMATE_ADDRESS */
145 #define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)
146
147 /* Debug FUNCTION_ARG macros */
148 #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
149
150 /* Hack macros for tuning code generation */
151 #define TARGET_MOVE ((target_flags & MASK_NO_MOVE) == 0) /* Don't generate memory->memory */
152 #define TARGET_PSEUDO ((target_flags & MASK_NO_PSEUDO) == 0) /* Move op's args into pseudos */
153
154 #define TARGET_386 (ix86_cpu == PROCESSOR_I386)
155 #define TARGET_486 (ix86_cpu == PROCESSOR_I486)
156 #define TARGET_PENTIUM (ix86_cpu == PROCESSOR_PENTIUM)
157 #define TARGET_PENTIUMPRO (ix86_cpu == PROCESSOR_PENTIUMPRO)
158 #define TARGET_USE_LEAVE (ix86_cpu == PROCESSOR_I386)
159 #define TARGET_PUSH_MEMORY (ix86_cpu == PROCESSOR_I386)
160 #define TARGET_ZERO_EXTEND_WITH_AND (ix86_cpu != PROCESSOR_I386 \
161 && ix86_cpu != PROCESSOR_PENTIUMPRO)
162 #define TARGET_DOUBLE_WITH_ADD (ix86_cpu != PROCESSOR_I386)
163 #define TARGET_USE_BIT_TEST (ix86_cpu == PROCESSOR_I386)
164 #define TARGET_UNROLL_STRLEN (ix86_cpu != PROCESSOR_I386)
165 #define TARGET_USE_Q_REG (ix86_cpu == PROCESSOR_PENTIUM \
166 || ix86_cpu == PROCESSOR_PENTIUMPRO)
167 #define TARGET_USE_ANY_REG (ix86_cpu == PROCESSOR_I486)
168 #define TARGET_CMOVE (ix86_arch == PROCESSOR_PENTIUMPRO)
169 #define TARGET_DEEP_BRANCH_PREDICTION (ix86_cpu == PROCESSOR_PENTIUMPRO)
170 #define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
171
172 #define TARGET_SWITCHES \
173 { { "80387", MASK_80387 }, \
174 { "no-80387", -MASK_80387 }, \
175 { "hard-float", MASK_80387 }, \
176 { "soft-float", -MASK_80387 }, \
177 { "no-soft-float", MASK_80387 }, \
178 { "386", 0 }, \
179 { "no-386", 0 }, \
180 { "486", 0 }, \
181 { "no-486", 0 }, \
182 { "pentium", 0 }, \
183 { "pentiumpro", 0 }, \
184 { "rtd", MASK_RTD }, \
185 { "no-rtd", -MASK_RTD }, \
186 { "align-double", MASK_ALIGN_DOUBLE }, \
187 { "no-align-double", -MASK_ALIGN_DOUBLE }, \
188 { "svr3-shlib", MASK_SVR3_SHLIB }, \
189 { "no-svr3-shlib", -MASK_SVR3_SHLIB }, \
190 { "ieee-fp", MASK_IEEE_FP }, \
191 { "no-ieee-fp", -MASK_IEEE_FP }, \
192 { "fp-ret-in-387", MASK_FLOAT_RETURNS }, \
193 { "no-fp-ret-in-387", -MASK_FLOAT_RETURNS }, \
194 { "no-fancy-math-387", MASK_NO_FANCY_MATH_387 }, \
195 { "fancy-math-387", -MASK_NO_FANCY_MATH_387 }, \
196 { "omit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER }, \
197 { "no-omit-leaf-frame-pointer",-MASK_OMIT_LEAF_FRAME_POINTER }, \
198 { "no-wide-multiply", MASK_NO_WIDE_MULTIPLY }, \
199 { "wide-multiply", -MASK_NO_WIDE_MULTIPLY }, \
200 { "schedule-prologue", MASK_SCHEDULE_PROLOGUE }, \
201 { "no-schedule-prologue", -MASK_SCHEDULE_PROLOGUE }, \
202 { "debug-addr", MASK_DEBUG_ADDR }, \
203 { "no-debug-addr", -MASK_DEBUG_ADDR }, \
204 { "move", -MASK_NO_MOVE }, \
205 { "no-move", MASK_NO_MOVE }, \
206 { "debug-arg", MASK_DEBUG_ARG }, \
207 { "no-debug-arg", -MASK_DEBUG_ARG }, \
208 { "stack-arg-probe", MASK_STACK_PROBE }, \
209 { "no-stack-arg-probe", -MASK_STACK_PROBE }, \
210 { "windows", 0 }, \
211 { "dll", 0 }, \
212 SUBTARGET_SWITCHES \
213 { "", MASK_SCHEDULE_PROLOGUE | TARGET_DEFAULT}}
214
215 /* Which processor to schedule for. The cpu attribute defines a list that
216 mirrors this list, so changes to i386.md must be made at the same time. */
217
218 enum processor_type
219 {PROCESSOR_I386, /* 80386 */
220 PROCESSOR_I486, /* 80486DX, 80486SX, 80486DX[24] */
221 PROCESSOR_PENTIUM,
222 PROCESSOR_PENTIUMPRO};
223
224 #define PROCESSOR_I386_STRING "i386"
225 #define PROCESSOR_I486_STRING "i486"
226 #define PROCESSOR_I586_STRING "i586"
227 #define PROCESSOR_PENTIUM_STRING "pentium"
228 #define PROCESSOR_I686_STRING "i686"
229 #define PROCESSOR_PENTIUMPRO_STRING "pentiumpro"
230
231 extern enum processor_type ix86_cpu;
232
233 extern int ix86_arch;
234
235 /* Define the default processor. This is overridden by other tm.h files. */
236 #define PROCESSOR_DEFAULT \
237 ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_I486) \
238 ? PROCESSOR_I486 \
239 : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUM) \
240 ? PROCESSOR_PENTIUM \
241 : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUMPRO) \
242 ? PROCESSOR_PENTIUMPRO \
243 : PROCESSOR_I386
244 #define PROCESSOR_DEFAULT_STRING \
245 ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_I486) \
246 ? PROCESSOR_I486_STRING \
247 : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUM) \
248 ? PROCESSOR_PENTIUM_STRING \
249 : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUMPRO) \
250 ? PROCESSOR_PENTIUMPRO_STRING \
251 : PROCESSOR_I386_STRING
252
253 /* This macro is similar to `TARGET_SWITCHES' but defines names of
254 command options that have values. Its definition is an
255 initializer with a subgrouping for each command option.
256
257 Each subgrouping contains a string constant, that defines the
258 fixed part of the option name, and the address of a variable. The
259 variable, type `char *', is set to the variable part of the given
260 option if the fixed part matches. The actual option name is made
261 by appending `-m' to the specified name. */
262 #define TARGET_OPTIONS \
263 { { "cpu=", &ix86_cpu_string}, \
264 { "arch=", &ix86_arch_string}, \
265 { "reg-alloc=", &i386_reg_alloc_order }, \
266 { "regparm=", &i386_regparm_string }, \
267 { "align-loops=", &i386_align_loops_string }, \
268 { "align-jumps=", &i386_align_jumps_string }, \
269 { "align-functions=", &i386_align_funcs_string }, \
270 { "branch-cost=", &i386_branch_cost_string }, \
271 SUBTARGET_OPTIONS \
272 }
273
274 /* Sometimes certain combinations of command options do not make
275 sense on a particular target machine. You can define a macro
276 `OVERRIDE_OPTIONS' to take account of this. This macro, if
277 defined, is executed once just after all the command options have
278 been parsed.
279
280 Don't use this macro to turn on various extra optimizations for
281 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
282
283 #define OVERRIDE_OPTIONS override_options ()
284
285 /* These are meant to be redefined in the host dependent files */
286 #define SUBTARGET_SWITCHES
287 #define SUBTARGET_OPTIONS
288
289 /* Define this to change the optimizations performed by default. */
290 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
291
292 /* Specs for the compiler proper */
293
294 #ifndef CC1_CPU_SPEC
295 #define CC1_CPU_SPEC "\
296 %{!mcpu*: \
297 %{m386:-mcpu=i386 -march=i386} \
298 %{mno-486:-mcpu=i386 -march=i386} \
299 %{m486:-mcpu=i486 -march=i486} \
300 %{mno-386:-mcpu=i486 -march=i486} \
301 %{mno-pentium:-mcpu=i486 -march=i486} \
302 %{mpentium:-mcpu=pentium} \
303 %{mno-pentiumpro:-mcpu=pentium} \
304 %{mpentiumpro:-mcpu=pentiumpro}}"
305 #endif
306 \f
307 #ifndef CPP_CPU_DEFAULT_SPEC
308 #if TARGET_CPU_DEFAULT == 1
309 #define CPP_CPU_DEFAULT_SPEC "-Di486"
310 #else
311 #if TARGET_CPU_DEFAULT == 2
312 #define CPP_CPU_DEFAULT_SPEC "-Dpentium -Di586"
313 #else
314 #if TARGET_CPU_DEFAULT == 3
315 #define CPP_CPU_DEFAULT_SPEC "-Dpentiumpro -Di686"
316 #else
317 #define CPP_CPU_DEFAULT_SPEC ""
318 #endif
319 #endif
320 #endif
321 #endif /* CPP_CPU_DEFAULT_SPEC */
322
323 #ifndef CPP_CPU_SPEC
324 #define CPP_CPU_SPEC "\
325 -Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386) \
326 %{mcpu=i486:-Di486} %{m486:-Di486} \
327 %{mpentium:-Dpentium -Di586} %{mcpu=pentium:-Dpentium -Di586} \
328 %{mpentiumpro:-Dpentiumpro -Di686} %{mcpu=pentiumpro:-Dpentiumpro -Di686} \
329 %{!mcpu*:%{!m486:%{!mpentium*: %[cpp_cpu_default]}}}"
330 #endif
331
332 #ifndef CC1_SPEC
333 #define CC1_SPEC "%(cc1_spec) "
334 #endif
335
336 /* This macro defines names of additional specifications to put in the
337 specs that can be used in various specifications like CC1_SPEC. Its
338 definition is an initializer with a subgrouping for each command option.
339
340 Each subgrouping contains a string constant, that defines the
341 specification name, and a string constant that used by the GNU CC driver
342 program.
343
344 Do not define this macro if it does not need to do anything. */
345
346 #ifndef SUBTARGET_EXTRA_SPECS
347 #define SUBTARGET_EXTRA_SPECS
348 #endif
349
350 #define EXTRA_SPECS \
351 { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
352 { "cpp_cpu", CPP_CPU_SPEC }, \
353 { "cc1_cpu", CC1_CPU_SPEC }, \
354 SUBTARGET_EXTRA_SPECS
355 \f
356 /* target machine storage layout */
357
358 /* Define for XFmode extended real floating point support.
359 This will automatically cause REAL_ARITHMETIC to be defined. */
360 #define LONG_DOUBLE_TYPE_SIZE 96
361
362 /* Define if you don't want extended real, but do want to use the
363 software floating point emulator for REAL_ARITHMETIC and
364 decimal <-> binary conversion. */
365 /* #define REAL_ARITHMETIC */
366
367 /* Define this if most significant byte of a word is the lowest numbered. */
368 /* That is true on the 80386. */
369
370 #define BITS_BIG_ENDIAN 0
371
372 /* Define this if most significant byte of a word is the lowest numbered. */
373 /* That is not true on the 80386. */
374 #define BYTES_BIG_ENDIAN 0
375
376 /* Define this if most significant word of a multiword number is the lowest
377 numbered. */
378 /* Not true for 80386 */
379 #define WORDS_BIG_ENDIAN 0
380
381 /* number of bits in an addressable storage unit */
382 #define BITS_PER_UNIT 8
383
384 /* Width in bits of a "word", which is the contents of a machine register.
385 Note that this is not necessarily the width of data type `int';
386 if using 16-bit ints on a 80386, this would still be 32.
387 But on a machine with 16-bit registers, this would be 16. */
388 #define BITS_PER_WORD 32
389
390 /* Width of a word, in units (bytes). */
391 #define UNITS_PER_WORD 4
392
393 /* Width in bits of a pointer.
394 See also the macro `Pmode' defined below. */
395 #define POINTER_SIZE 32
396
397 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
398 #define PARM_BOUNDARY 32
399
400 /* Boundary (in *bits*) on which stack pointer should be aligned. */
401 #define STACK_BOUNDARY 32
402
403 /* Allocation boundary (in *bits*) for the code of a function.
404 For i486, we get better performance by aligning to a cache
405 line (i.e. 16 byte) boundary. */
406 #define FUNCTION_BOUNDARY (1 << (i386_align_funcs + 3))
407
408 /* Alignment of field after `int : 0' in a structure. */
409
410 #define EMPTY_FIELD_BOUNDARY 32
411
412 /* Minimum size in bits of the largest boundary to which any
413 and all fundamental data types supported by the hardware
414 might need to be aligned. No data type wants to be aligned
415 rounder than this. The i386 supports 64-bit floating point
416 quantities, but these can be aligned on any 32-bit boundary.
417 The published ABIs say that doubles should be aligned on word
418 boundaries, but the Pentium gets better performance with them
419 aligned on 64 bit boundaries. */
420 #define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
421
422 /* align DFmode constants and nonaggregates */
423 #define ALIGN_DFmode (!TARGET_386)
424
425 /* Set this non-zero if move instructions will actually fail to work
426 when given unaligned data. */
427 #define STRICT_ALIGNMENT 0
428
429 /* If bit field type is int, don't let it cross an int,
430 and give entire struct the alignment of an int. */
431 /* Required on the 386 since it doesn't have bitfield insns. */
432 #define PCC_BITFIELD_TYPE_MATTERS 1
433
434 /* Maximum power of 2 that code can be aligned to. */
435 #define MAX_CODE_ALIGN 6 /* 64 byte alignment */
436
437 /* Align loop starts for optimal branching. */
438 #define LOOP_ALIGN(LABEL) (i386_align_loops)
439
440 /* This is how to align an instruction for optimal branching.
441 On i486 we'll get better performance by aligning on a
442 cache line (i.e. 16 byte) boundary. */
443 #define LABEL_ALIGN_AFTER_BARRIER(LABEL) (i386_align_jumps)
444
445 \f
446 /* Standard register usage. */
447
448 /* This processor has special stack-like registers. See reg-stack.c
449 for details. */
450
451 #define STACK_REGS
452 #define IS_STACK_MODE(mode) (mode==DFmode || mode==SFmode || mode==XFmode)
453
454 /* Number of actual hardware registers.
455 The hardware registers are assigned numbers for the compiler
456 from 0 to just below FIRST_PSEUDO_REGISTER.
457 All registers that the compiler knows about must be given numbers,
458 even those that are not normally considered general registers.
459
460 In the 80386 we give the 8 general purpose registers the numbers 0-7.
461 We number the floating point registers 8-15.
462 Note that registers 0-7 can be accessed as a short or int,
463 while only 0-3 may be used with byte `mov' instructions.
464
465 Reg 16 does not correspond to any hardware register, but instead
466 appears in the RTL as an argument pointer prior to reload, and is
467 eliminated during reloading in favor of either the stack or frame
468 pointer. */
469
470 #define FIRST_PSEUDO_REGISTER 17
471
472 /* 1 for registers that have pervasive standard uses
473 and are not available for the register allocator.
474 On the 80386, the stack pointer is such, as is the arg pointer. */
475 #define FIXED_REGISTERS \
476 /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \
477 { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
478
479 /* 1 for registers not available across function calls.
480 These must include the FIXED_REGISTERS and also any
481 registers that can be used without being saved.
482 The latter must include the registers where values are returned
483 and the register where structure-value addresses are passed.
484 Aside from that, you can include as many other registers as you like. */
485
486 #define CALL_USED_REGISTERS \
487 /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \
488 { 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
489
490 /* Order in which to allocate registers. Each register must be
491 listed once, even those in FIXED_REGISTERS. List frame pointer
492 late and fixed registers last. Note that, in general, we prefer
493 registers listed in CALL_USED_REGISTERS, keeping the others
494 available for storage of persistent values.
495
496 Three different versions of REG_ALLOC_ORDER have been tried:
497
498 If the order is edx, ecx, eax, ... it produces a slightly faster compiler,
499 but slower code on simple functions returning values in eax.
500
501 If the order is eax, ecx, edx, ... it causes reload to abort when compiling
502 perl 4.036 due to not being able to create a DImode register (to hold a 2
503 word union).
504
505 If the order is eax, edx, ecx, ... it produces better code for simple
506 functions, and a slightly slower compiler. Users complained about the code
507 generated by allocating edx first, so restore the 'natural' order of things. */
508
509 #define REG_ALLOC_ORDER \
510 /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \
511 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
512
513 /* A C statement (sans semicolon) to choose the order in which to
514 allocate hard registers for pseudo-registers local to a basic
515 block.
516
517 Store the desired register order in the array `reg_alloc_order'.
518 Element 0 should be the register to allocate first; element 1, the
519 next register; and so on.
520
521 The macro body should not assume anything about the contents of
522 `reg_alloc_order' before execution of the macro.
523
524 On most machines, it is not necessary to define this macro. */
525
526 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
527
528 /* Macro to conditionally modify fixed_regs/call_used_regs. */
529 #define CONDITIONAL_REGISTER_USAGE \
530 { \
531 if (flag_pic) \
532 { \
533 fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
534 call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
535 } \
536 if (! TARGET_80387 && ! TARGET_FLOAT_RETURNS_IN_80387) \
537 { \
538 int i; \
539 HARD_REG_SET x; \
540 COPY_HARD_REG_SET (x, reg_class_contents[(int)FLOAT_REGS]); \
541 for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \
542 if (TEST_HARD_REG_BIT (x, i)) \
543 fixed_regs[i] = call_used_regs[i] = 1; \
544 } \
545 }
546
547 /* Return number of consecutive hard regs needed starting at reg REGNO
548 to hold something of mode MODE.
549 This is ordinarily the length in words of a value of mode MODE
550 but can be less for certain modes in special long registers.
551
552 Actually there are no two word move instructions for consecutive
553 registers. And only registers 0-3 may have mov byte instructions
554 applied to them.
555 */
556
557 #define HARD_REGNO_NREGS(REGNO, MODE) \
558 (FP_REGNO_P (REGNO) ? 1 \
559 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
560
561 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
562 On the 80386, the first 4 cpu registers can hold any mode
563 while the floating point registers may hold only floating point.
564 Make it clear that the fp regs could not hold a 16-byte float. */
565
566 /* The casts to int placate a compiler on a microvax,
567 for cross-compiler testing. */
568
569 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
570 ((REGNO) < 2 ? 1 \
571 : (REGNO) < 4 ? 1 \
572 : FP_REGNO_P (REGNO) \
573 ? (((int) GET_MODE_CLASS (MODE) == (int) MODE_FLOAT \
574 || (int) GET_MODE_CLASS (MODE) == (int) MODE_COMPLEX_FLOAT) \
575 && GET_MODE_UNIT_SIZE (MODE) <= (LONG_DOUBLE_TYPE_SIZE == 96 ? 12 : 8))\
576 : (int) (MODE) != (int) QImode ? 1 \
577 : (reload_in_progress | reload_completed) == 1)
578
579 /* Value is 1 if it is a good idea to tie two pseudo registers
580 when one has mode MODE1 and one has mode MODE2.
581 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
582 for any hard reg, then this must be 0 for correct output. */
583
584 #define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) == (MODE2))
585
586 /* Specify the registers used for certain standard purposes.
587 The values of these macros are register numbers. */
588
589 /* on the 386 the pc register is %eip, and is not usable as a general
590 register. The ordinary mov instructions won't work */
591 /* #define PC_REGNUM */
592
593 /* Register to use for pushing function arguments. */
594 #define STACK_POINTER_REGNUM 7
595
596 /* Base register for access to local variables of the function. */
597 #define FRAME_POINTER_REGNUM 6
598
599 /* First floating point reg */
600 #define FIRST_FLOAT_REG 8
601
602 /* First & last stack-like regs */
603 #define FIRST_STACK_REG FIRST_FLOAT_REG
604 #define LAST_STACK_REG (FIRST_FLOAT_REG + 7)
605
606 /* Value should be nonzero if functions must have frame pointers.
607 Zero means the frame pointer need not be set up (and parms
608 may be accessed via the stack pointer) in functions that seem suitable.
609 This is computed in `reload', in reload1.c. */
610 #define FRAME_POINTER_REQUIRED (TARGET_OMIT_LEAF_FRAME_POINTER && !leaf_function_p ())
611
612 /* Base register for access to arguments of the function. */
613 #define ARG_POINTER_REGNUM 16
614
615 /* Register in which static-chain is passed to a function. */
616 #define STATIC_CHAIN_REGNUM 2
617
618 /* Register to hold the addressing base for position independent
619 code access to data items. */
620 #define PIC_OFFSET_TABLE_REGNUM 3
621
622 /* Register in which address to store a structure value
623 arrives in the function. On the 386, the prologue
624 copies this from the stack to register %eax. */
625 #define STRUCT_VALUE_INCOMING 0
626
627 /* Place in which caller passes the structure value address.
628 0 means push the value on the stack like an argument. */
629 #define STRUCT_VALUE 0
630
631 /* A C expression which can inhibit the returning of certain function
632 values in registers, based on the type of value. A nonzero value
633 says to return the function value in memory, just as large
634 structures are always returned. Here TYPE will be a C expression
635 of type `tree', representing the data type of the value.
636
637 Note that values of mode `BLKmode' must be explicitly handled by
638 this macro. Also, the option `-fpcc-struct-return' takes effect
639 regardless of this macro. On most systems, it is possible to
640 leave the macro undefined; this causes a default definition to be
641 used, whose value is the constant 1 for `BLKmode' values, and 0
642 otherwise.
643
644 Do not use this macro to indicate that structures and unions
645 should always be returned in memory. You should instead use
646 `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
647
648 #define RETURN_IN_MEMORY(TYPE) \
649 ((TYPE_MODE (TYPE) == BLKmode) || int_size_in_bytes (TYPE) > 12)
650
651 \f
652 /* Define the classes of registers for register constraints in the
653 machine description. Also define ranges of constants.
654
655 One of the classes must always be named ALL_REGS and include all hard regs.
656 If there is more than one class, another class must be named NO_REGS
657 and contain no registers.
658
659 The name GENERAL_REGS must be the name of a class (or an alias for
660 another name such as ALL_REGS). This is the class of registers
661 that is allowed by "g" or "r" in a register constraint.
662 Also, registers outside this class are allocated only when
663 instructions express preferences for them.
664
665 The classes must be numbered in nondecreasing order; that is,
666 a larger-numbered class must never be contained completely
667 in a smaller-numbered class.
668
669 For any two classes, it is very desirable that there be another
670 class that represents their union.
671
672 It might seem that class BREG is unnecessary, since no useful 386
673 opcode needs reg %ebx. But some systems pass args to the OS in ebx,
674 and the "b" register constraint is useful in asms for syscalls. */
675
676 enum reg_class
677 {
678 NO_REGS,
679 AREG, DREG, CREG, BREG,
680 AD_REGS, /* %eax/%edx for DImode */
681 Q_REGS, /* %eax %ebx %ecx %edx */
682 SIREG, DIREG,
683 INDEX_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp */
684 GENERAL_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp %esp */
685 FP_TOP_REG, FP_SECOND_REG, /* %st(0) %st(1) */
686 FLOAT_REGS,
687 ALL_REGS, LIM_REG_CLASSES
688 };
689
690 #define N_REG_CLASSES (int) LIM_REG_CLASSES
691
692 #define FLOAT_CLASS_P(CLASS) (reg_class_subset_p (CLASS, FLOAT_REGS))
693
694 /* Give names of register classes as strings for dump file. */
695
696 #define REG_CLASS_NAMES \
697 { "NO_REGS", \
698 "AREG", "DREG", "CREG", "BREG", \
699 "AD_REGS", \
700 "Q_REGS", \
701 "SIREG", "DIREG", \
702 "INDEX_REGS", \
703 "GENERAL_REGS", \
704 "FP_TOP_REG", "FP_SECOND_REG", \
705 "FLOAT_REGS", \
706 "ALL_REGS" }
707
708 /* Define which registers fit in which classes.
709 This is an initializer for a vector of HARD_REG_SET
710 of length N_REG_CLASSES. */
711
712 #define REG_CLASS_CONTENTS \
713 { 0, \
714 0x1, 0x2, 0x4, 0x8, /* AREG, DREG, CREG, BREG */ \
715 0x3, /* AD_REGS */ \
716 0xf, /* Q_REGS */ \
717 0x10, 0x20, /* SIREG, DIREG */ \
718 0x7f, /* INDEX_REGS */ \
719 0x100ff, /* GENERAL_REGS */ \
720 0x0100, 0x0200, /* FP_TOP_REG, FP_SECOND_REG */ \
721 0xff00, /* FLOAT_REGS */ \
722 0x1ffff }
723
724 /* The same information, inverted:
725 Return the class number of the smallest class containing
726 reg number REGNO. This could be a conditional expression
727 or could index an array. */
728
729 #define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO])
730
731 /* When defined, the compiler allows registers explicitly used in the
732 rtl to be used as spill registers but prevents the compiler from
733 extending the lifetime of these registers. */
734
735 #define SMALL_REGISTER_CLASSES 1
736
737 #define QI_REG_P(X) \
738 (REG_P (X) && REGNO (X) < 4)
739 #define NON_QI_REG_P(X) \
740 (REG_P (X) && REGNO (X) >= 4 && REGNO (X) < FIRST_PSEUDO_REGISTER)
741
742 #define FP_REG_P(X) (REG_P (X) && FP_REGNO_P (REGNO (X)))
743 #define FP_REGNO_P(n) ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG)
744
745 #define STACK_REG_P(xop) (REG_P (xop) && \
746 REGNO (xop) >= FIRST_STACK_REG && \
747 REGNO (xop) <= LAST_STACK_REG)
748
749 #define NON_STACK_REG_P(xop) (REG_P (xop) && ! STACK_REG_P (xop))
750
751 #define STACK_TOP_P(xop) (REG_P (xop) && REGNO (xop) == FIRST_STACK_REG)
752
753 /* Try to maintain the accuracy of the death notes for regs satisfying the
754 following. Important for stack like regs, to know when to pop. */
755
756 /* #define PRESERVE_DEATH_INFO_REGNO_P(x) FP_REGNO_P(x) */
757
758 /* 1 if register REGNO can magically overlap other regs.
759 Note that nonzero values work only in very special circumstances. */
760
761 /* #define OVERLAPPING_REGNO_P(REGNO) FP_REGNO_P (REGNO) */
762
763 /* The class value for index registers, and the one for base regs. */
764
765 #define INDEX_REG_CLASS INDEX_REGS
766 #define BASE_REG_CLASS GENERAL_REGS
767
768 /* Get reg_class from a letter such as appears in the machine description. */
769
770 #define REG_CLASS_FROM_LETTER(C) \
771 ((C) == 'r' ? GENERAL_REGS : \
772 (C) == 'q' ? Q_REGS : \
773 (C) == 'f' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 \
774 ? FLOAT_REGS \
775 : NO_REGS) : \
776 (C) == 't' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 \
777 ? FP_TOP_REG \
778 : NO_REGS) : \
779 (C) == 'u' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 \
780 ? FP_SECOND_REG \
781 : NO_REGS) : \
782 (C) == 'a' ? AREG : \
783 (C) == 'b' ? BREG : \
784 (C) == 'c' ? CREG : \
785 (C) == 'd' ? DREG : \
786 (C) == 'A' ? AD_REGS : \
787 (C) == 'D' ? DIREG : \
788 (C) == 'S' ? SIREG : NO_REGS)
789
790 /* The letters I, J, K, L and M in a register constraint string
791 can be used to stand for particular ranges of immediate operands.
792 This macro defines what the ranges are.
793 C is the letter, and VALUE is a constant value.
794 Return 1 if VALUE is in the range specified by C.
795
796 I is for non-DImode shifts.
797 J is for DImode shifts.
798 K and L are for an `andsi' optimization.
799 M is for shifts that can be executed by the "lea" opcode.
800 */
801
802 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
803 ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 31 : \
804 (C) == 'J' ? (VALUE) >= 0 && (VALUE) <= 63 : \
805 (C) == 'K' ? (VALUE) == 0xff : \
806 (C) == 'L' ? (VALUE) == 0xffff : \
807 (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 3 : \
808 (C) == 'N' ? (VALUE) >= 0 && (VALUE) <= 255 :\
809 (C) == 'O' ? (VALUE) >= 0 && (VALUE) <= 32 : \
810 0)
811
812 /* Similar, but for floating constants, and defining letters G and H.
813 Here VALUE is the CONST_DOUBLE rtx itself. We allow constants even if
814 TARGET_387 isn't set, because the stack register converter may need to
815 load 0.0 into the function value register. */
816
817 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
818 ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0)
819
820 /* Place additional restrictions on the register class to use when it
821 is necessary to be able to hold a value of mode MODE in a reload
822 register for which class CLASS would ordinarily be used. */
823
824 #define LIMIT_RELOAD_CLASS(MODE, CLASS) \
825 ((MODE) == QImode && ((CLASS) == ALL_REGS || (CLASS) == GENERAL_REGS) \
826 ? Q_REGS : (CLASS))
827
828 /* Given an rtx X being reloaded into a reg required to be
829 in class CLASS, return the class of reg to actually use.
830 In general this is just CLASS; but on some machines
831 in some cases it is preferable to use a more restrictive class.
832 On the 80386 series, we prevent floating constants from being
833 reloaded into floating registers (since no move-insn can do that)
834 and we ensure that QImodes aren't reloaded into the esi or edi reg. */
835
836 /* Put float CONST_DOUBLE in the constant pool instead of fp regs.
837 QImode must go into class Q_REGS.
838 Narrow ALL_REGS to GENERAL_REGS. This supports allowing movsf and
839 movdf to do mem-to-mem moves through integer regs. */
840
841 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
842 (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode ? NO_REGS \
843 : GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \
844 : ((CLASS) == ALL_REGS \
845 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) ? GENERAL_REGS \
846 : (CLASS))
847
848 /* If we are copying between general and FP registers, we need a memory
849 location. */
850
851 #define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \
852 ((FLOAT_CLASS_P (CLASS1) && ! FLOAT_CLASS_P (CLASS2)) \
853 || (! FLOAT_CLASS_P (CLASS1) && FLOAT_CLASS_P (CLASS2)))
854
855 /* Return the maximum number of consecutive registers
856 needed to represent mode MODE in a register of class CLASS. */
857 /* On the 80386, this is the size of MODE in words,
858 except in the FP regs, where a single reg is always enough. */
859 #define CLASS_MAX_NREGS(CLASS, MODE) \
860 (FLOAT_CLASS_P (CLASS) ? 1 : \
861 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
862
863 /* A C expression whose value is nonzero if pseudos that have been
864 assigned to registers of class CLASS would likely be spilled
865 because registers of CLASS are needed for spill registers.
866
867 The default value of this macro returns 1 if CLASS has exactly one
868 register and zero otherwise. On most machines, this default
869 should be used. Only define this macro to some other expression
870 if pseudo allocated by `local-alloc.c' end up in memory because
871 their hard registers were needed for spill registers. If this
872 macro returns nonzero for those classes, those pseudos will only
873 be allocated by `global.c', which knows how to reallocate the
874 pseudo to another register. If there would not be another
875 register available for reallocation, you should not change the
876 definition of this macro since the only effect of such a
877 definition would be to slow down register allocation. */
878
879 #define CLASS_LIKELY_SPILLED_P(CLASS) \
880 (((CLASS) == AREG) \
881 || ((CLASS) == DREG) \
882 || ((CLASS) == CREG) \
883 || ((CLASS) == BREG) \
884 || ((CLASS) == AD_REGS) \
885 || ((CLASS) == SIREG) \
886 || ((CLASS) == DIREG))
887
888 \f
889 /* Stack layout; function entry, exit and calling. */
890
891 /* Define this if pushing a word on the stack
892 makes the stack pointer a smaller address. */
893 #define STACK_GROWS_DOWNWARD
894
895 /* Define this if the nominal address of the stack frame
896 is at the high-address end of the local variables;
897 that is, each additional local variable allocated
898 goes at a more negative offset in the frame. */
899 #define FRAME_GROWS_DOWNWARD
900
901 /* Offset within stack frame to start allocating local variables at.
902 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
903 first local allocated. Otherwise, it is the offset to the BEGINNING
904 of the first local allocated. */
905 #define STARTING_FRAME_OFFSET 0
906
907 /* If we generate an insn to push BYTES bytes,
908 this says how many the stack pointer really advances by.
909 On 386 pushw decrements by exactly 2 no matter what the position was.
910 On the 386 there is no pushb; we use pushw instead, and this
911 has the effect of rounding up to 2. */
912
913 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & (-2))
914
915 /* Offset of first parameter from the argument pointer register value. */
916 #define FIRST_PARM_OFFSET(FNDECL) 0
917
918 /* Value is the number of bytes of arguments automatically
919 popped when returning from a subroutine call.
920 FUNDECL is the declaration node of the function (as a tree),
921 FUNTYPE is the data type of the function (as a tree),
922 or for a library call it is an identifier node for the subroutine name.
923 SIZE is the number of bytes of arguments passed on the stack.
924
925 On the 80386, the RTD insn may be used to pop them if the number
926 of args is fixed, but if the number is variable then the caller
927 must pop them all. RTD can't be used for library calls now
928 because the library is compiled with the Unix compiler.
929 Use of RTD is a selectable option, since it is incompatible with
930 standard Unix calling sequences. If the option is not selected,
931 the caller must always pop the args.
932
933 The attribute stdcall is equivalent to RTD on a per module basis. */
934
935 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
936 (i386_return_pops_args (FUNDECL, FUNTYPE, SIZE))
937
938 /* Define how to find the value returned by a function.
939 VALTYPE is the data type of the value (as a tree).
940 If the precise function being called is known, FUNC is its FUNCTION_DECL;
941 otherwise, FUNC is 0. */
942 #define FUNCTION_VALUE(VALTYPE, FUNC) \
943 gen_rtx_REG (TYPE_MODE (VALTYPE), \
944 VALUE_REGNO (TYPE_MODE (VALTYPE)))
945
946 /* Define how to find the value returned by a library function
947 assuming the value has mode MODE. */
948
949 #define LIBCALL_VALUE(MODE) \
950 gen_rtx_REG (MODE, VALUE_REGNO (MODE))
951
952 /* Define the size of the result block used for communication between
953 untyped_call and untyped_return. The block contains a DImode value
954 followed by the block used by fnsave and frstor. */
955
956 #define APPLY_RESULT_SIZE (8+108)
957
958 /* 1 if N is a possible register number for function argument passing. */
959 #define FUNCTION_ARG_REGNO_P(N) ((N) >= 0 && (N) < REGPARM_MAX)
960
961 /* Define a data type for recording info about an argument list
962 during the scan of that argument list. This data type should
963 hold all necessary information about the function itself
964 and about the args processed so far, enough to enable macros
965 such as FUNCTION_ARG to determine where the next arg should go. */
966
967 typedef struct i386_args {
968 int words; /* # words passed so far */
969 int nregs; /* # registers available for passing */
970 int regno; /* next available register number */
971 } CUMULATIVE_ARGS;
972
973 /* Initialize a variable CUM of type CUMULATIVE_ARGS
974 for a call to a function whose data type is FNTYPE.
975 For a library call, FNTYPE is 0. */
976
977 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
978 (init_cumulative_args (&CUM, FNTYPE, LIBNAME))
979
980 /* Update the data in CUM to advance over an argument
981 of mode MODE and data type TYPE.
982 (TYPE is null for libcalls where that information may not be available.) */
983
984 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
985 (function_arg_advance (&CUM, MODE, TYPE, NAMED))
986
987 /* Define where to put the arguments to a function.
988 Value is zero to push the argument on the stack,
989 or a hard register in which to store the argument.
990
991 MODE is the argument's machine mode.
992 TYPE is the data type of the argument (as a tree).
993 This is null for libcalls where that information may
994 not be available.
995 CUM is a variable of type CUMULATIVE_ARGS which gives info about
996 the preceding args and about the function being called.
997 NAMED is nonzero if this argument is a named parameter
998 (otherwise it is an extra parameter matching an ellipsis). */
999
1000 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1001 (function_arg (&CUM, MODE, TYPE, NAMED))
1002
1003 /* For an arg passed partly in registers and partly in memory,
1004 this is the number of registers used.
1005 For args passed entirely in registers or entirely in memory, zero. */
1006
1007 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1008 (function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED))
1009
1010 /* This macro is invoked just before the start of a function.
1011 It is used here to output code for -fpic that will load the
1012 return address into %ebx. */
1013
1014 #undef ASM_OUTPUT_FUNCTION_PREFIX
1015 #define ASM_OUTPUT_FUNCTION_PREFIX(FILE, FNNAME) \
1016 asm_output_function_prefix (FILE, FNNAME)
1017
1018 /* This macro generates the assembly code for function entry.
1019 FILE is a stdio stream to output the code to.
1020 SIZE is an int: how many units of temporary storage to allocate.
1021 Refer to the array `regs_ever_live' to determine which registers
1022 to save; `regs_ever_live[I]' is nonzero if register number I
1023 is ever used in the function. This macro is responsible for
1024 knowing which registers should not be saved even if used. */
1025
1026 #define FUNCTION_PROLOGUE(FILE, SIZE) \
1027 function_prologue (FILE, SIZE)
1028
1029 /* Output assembler code to FILE to increment profiler label # LABELNO
1030 for profiling a function entry. */
1031
1032 #define FUNCTION_PROFILER(FILE, LABELNO) \
1033 { \
1034 if (flag_pic) \
1035 { \
1036 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
1037 LPREFIX, (LABELNO)); \
1038 fprintf (FILE, "\tcall *_mcount@GOT(%%ebx)\n"); \
1039 } \
1040 else \
1041 { \
1042 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
1043 fprintf (FILE, "\tcall _mcount\n"); \
1044 } \
1045 }
1046
1047
1048 /* There are three profiling modes for basic blocks available.
1049 The modes are selected at compile time by using the options
1050 -a or -ax of the gnu compiler.
1051 The variable `profile_block_flag' will be set according to the
1052 selected option.
1053
1054 profile_block_flag == 0, no option used:
1055
1056 No profiling done.
1057
1058 profile_block_flag == 1, -a option used.
1059
1060 Count frequency of execution of every basic block.
1061
1062 profile_block_flag == 2, -ax option used.
1063
1064 Generate code to allow several different profiling modes at run time.
1065 Available modes are:
1066 Produce a trace of all basic blocks.
1067 Count frequency of jump instructions executed.
1068 In every mode it is possible to start profiling upon entering
1069 certain functions and to disable profiling of some other functions.
1070
1071 The result of basic-block profiling will be written to a file `bb.out'.
1072 If the -ax option is used parameters for the profiling will be read
1073 from file `bb.in'.
1074
1075 */
1076
1077 /* The following macro shall output assembler code to FILE
1078 to initialize basic-block profiling.
1079
1080 If profile_block_flag == 2
1081
1082 Output code to call the subroutine `__bb_init_trace_func'
1083 and pass two parameters to it. The first parameter is
1084 the address of a block allocated in the object module.
1085 The second parameter is the number of the first basic block
1086 of the function.
1087
1088 The name of the block is a local symbol made with this statement:
1089
1090 ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0);
1091
1092 Of course, since you are writing the definition of
1093 `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
1094 can take a short cut in the definition of this macro and use the
1095 name that you know will result.
1096
1097 The number of the first basic block of the function is
1098 passed to the macro in BLOCK_OR_LABEL.
1099
1100 If described in a virtual assembler language the code to be
1101 output looks like:
1102
1103 parameter1 <- LPBX0
1104 parameter2 <- BLOCK_OR_LABEL
1105 call __bb_init_trace_func
1106
1107 else if profile_block_flag != 0
1108
1109 Output code to call the subroutine `__bb_init_func'
1110 and pass one single parameter to it, which is the same
1111 as the first parameter to `__bb_init_trace_func'.
1112
1113 The first word of this parameter is a flag which will be nonzero if
1114 the object module has already been initialized. So test this word
1115 first, and do not call `__bb_init_func' if the flag is nonzero.
1116 Note: When profile_block_flag == 2 the test need not be done
1117 but `__bb_init_trace_func' *must* be called.
1118
1119 BLOCK_OR_LABEL may be used to generate a label number as a
1120 branch destination in case `__bb_init_func' will not be called.
1121
1122 If described in a virtual assembler language the code to be
1123 output looks like:
1124
1125 cmp (LPBX0),0
1126 jne local_label
1127 parameter1 <- LPBX0
1128 call __bb_init_func
1129 local_label:
1130
1131 */
1132
1133 #undef FUNCTION_BLOCK_PROFILER
1134 #define FUNCTION_BLOCK_PROFILER(FILE, BLOCK_OR_LABEL) \
1135 do \
1136 { \
1137 static int num_func = 0; \
1138 rtx xops[8]; \
1139 char block_table[80], false_label[80]; \
1140 \
1141 ASM_GENERATE_INTERNAL_LABEL (block_table, "LPBX", 0); \
1142 \
1143 xops[1] = gen_rtx_SYMBOL_REF (VOIDmode, block_table); \
1144 xops[5] = stack_pointer_rtx; \
1145 xops[7] = gen_rtx_REG (Pmode, 0); /* eax */ \
1146 \
1147 CONSTANT_POOL_ADDRESS_P (xops[1]) = TRUE; \
1148 \
1149 switch (profile_block_flag) \
1150 { \
1151 \
1152 case 2: \
1153 \
1154 xops[2] = GEN_INT ((BLOCK_OR_LABEL)); \
1155 xops[3] = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (VOIDmode, "__bb_init_trace_func")); \
1156 xops[6] = GEN_INT (8); \
1157 \
1158 output_asm_insn (AS1(push%L2,%2), xops); \
1159 if (!flag_pic) \
1160 output_asm_insn (AS1(push%L1,%1), xops); \
1161 else \
1162 { \
1163 output_asm_insn (AS2 (lea%L7,%a1,%7), xops); \
1164 output_asm_insn (AS1 (push%L7,%7), xops); \
1165 } \
1166 \
1167 output_asm_insn (AS1(call,%P3), xops); \
1168 output_asm_insn (AS2(add%L0,%6,%5), xops); \
1169 \
1170 break; \
1171 \
1172 default: \
1173 \
1174 ASM_GENERATE_INTERNAL_LABEL (false_label, "LPBZ", num_func); \
1175 \
1176 xops[0] = const0_rtx; \
1177 xops[2] = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (VOIDmode, false_label)); \
1178 xops[3] = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (VOIDmode, "__bb_init_func")); \
1179 xops[4] = gen_rtx_MEM (Pmode, xops[1]); \
1180 xops[6] = GEN_INT (4); \
1181 \
1182 CONSTANT_POOL_ADDRESS_P (xops[2]) = TRUE; \
1183 \
1184 output_asm_insn (AS2(cmp%L4,%0,%4), xops); \
1185 output_asm_insn (AS1(jne,%2), xops); \
1186 \
1187 if (!flag_pic) \
1188 output_asm_insn (AS1(push%L1,%1), xops); \
1189 else \
1190 { \
1191 output_asm_insn (AS2 (lea%L7,%a1,%7), xops); \
1192 output_asm_insn (AS1 (push%L7,%7), xops); \
1193 } \
1194 \
1195 output_asm_insn (AS1(call,%P3), xops); \
1196 output_asm_insn (AS2(add%L0,%6,%5), xops); \
1197 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LPBZ", num_func); \
1198 num_func++; \
1199 \
1200 break; \
1201 \
1202 } \
1203 } \
1204 while (0)
1205
1206 /* The following macro shall output assembler code to FILE
1207 to increment a counter associated with basic block number BLOCKNO.
1208
1209 If profile_block_flag == 2
1210
1211 Output code to initialize the global structure `__bb' and
1212 call the function `__bb_trace_func' which will increment the
1213 counter.
1214
1215 `__bb' consists of two words. In the first word the number
1216 of the basic block has to be stored. In the second word
1217 the address of a block allocated in the object module
1218 has to be stored.
1219
1220 The basic block number is given by BLOCKNO.
1221
1222 The address of the block is given by the label created with
1223
1224 ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0);
1225
1226 by FUNCTION_BLOCK_PROFILER.
1227
1228 Of course, since you are writing the definition of
1229 `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
1230 can take a short cut in the definition of this macro and use the
1231 name that you know will result.
1232
1233 If described in a virtual assembler language the code to be
1234 output looks like:
1235
1236 move BLOCKNO -> (__bb)
1237 move LPBX0 -> (__bb+4)
1238 call __bb_trace_func
1239
1240 Note that function `__bb_trace_func' must not change the
1241 machine state, especially the flag register. To grant
1242 this, you must output code to save and restore registers
1243 either in this macro or in the macros MACHINE_STATE_SAVE
1244 and MACHINE_STATE_RESTORE. The last two macros will be
1245 used in the function `__bb_trace_func', so you must make
1246 sure that the function prologue does not change any
1247 register prior to saving it with MACHINE_STATE_SAVE.
1248
1249 else if profile_block_flag != 0
1250
1251 Output code to increment the counter directly.
1252 Basic blocks are numbered separately from zero within each
1253 compiled object module. The count associated with block number
1254 BLOCKNO is at index BLOCKNO in an array of words; the name of
1255 this array is a local symbol made with this statement:
1256
1257 ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 2);
1258
1259 Of course, since you are writing the definition of
1260 `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
1261 can take a short cut in the definition of this macro and use the
1262 name that you know will result.
1263
1264 If described in a virtual assembler language the code to be
1265 output looks like:
1266
1267 inc (LPBX2+4*BLOCKNO)
1268
1269 */
1270
1271 #define BLOCK_PROFILER(FILE, BLOCKNO) \
1272 do \
1273 { \
1274 rtx xops[8], cnt_rtx; \
1275 char counts[80]; \
1276 char *block_table = counts; \
1277 \
1278 switch (profile_block_flag) \
1279 { \
1280 \
1281 case 2: \
1282 \
1283 ASM_GENERATE_INTERNAL_LABEL (block_table, "LPBX", 0); \
1284 \
1285 xops[1] = gen_rtx_SYMBOL_REF (VOIDmode, block_table); \
1286 xops[2] = GEN_INT ((BLOCKNO)); \
1287 xops[3] = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (VOIDmode, "__bb_trace_func")); \
1288 xops[4] = gen_rtx_SYMBOL_REF (VOIDmode, "__bb"); \
1289 xops[5] = plus_constant (xops[4], 4); \
1290 xops[0] = gen_rtx_MEM (SImode, xops[4]); \
1291 xops[6] = gen_rtx_MEM (SImode, xops[5]); \
1292 \
1293 CONSTANT_POOL_ADDRESS_P (xops[1]) = TRUE; \
1294 \
1295 fprintf(FILE, "\tpushf\n"); \
1296 output_asm_insn (AS2(mov%L0,%2,%0), xops); \
1297 if (flag_pic) \
1298 { \
1299 xops[7] = gen_rtx_REG (Pmode, 0); /* eax */ \
1300 output_asm_insn (AS1(push%L7,%7), xops); \
1301 output_asm_insn (AS2(lea%L7,%a1,%7), xops); \
1302 output_asm_insn (AS2(mov%L6,%7,%6), xops); \
1303 output_asm_insn (AS1(pop%L7,%7), xops); \
1304 } \
1305 else \
1306 output_asm_insn (AS2(mov%L6,%1,%6), xops); \
1307 output_asm_insn (AS1(call,%P3), xops); \
1308 fprintf(FILE, "\tpopf\n"); \
1309 \
1310 break; \
1311 \
1312 default: \
1313 \
1314 ASM_GENERATE_INTERNAL_LABEL (counts, "LPBX", 2); \
1315 cnt_rtx = gen_rtx_SYMBOL_REF (VOIDmode, counts); \
1316 SYMBOL_REF_FLAG (cnt_rtx) = TRUE; \
1317 \
1318 if (BLOCKNO) \
1319 cnt_rtx = plus_constant (cnt_rtx, (BLOCKNO)*4); \
1320 \
1321 if (flag_pic) \
1322 cnt_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, cnt_rtx); \
1323 \
1324 xops[0] = gen_rtx_MEM (SImode, cnt_rtx); \
1325 output_asm_insn (AS1(inc%L0,%0), xops); \
1326 \
1327 break; \
1328 \
1329 } \
1330 } \
1331 while (0)
1332
1333 /* The following macro shall output assembler code to FILE
1334 to indicate a return from function during basic-block profiling.
1335
1336 If profiling_block_flag == 2:
1337
1338 Output assembler code to call function `__bb_trace_ret'.
1339
1340 Note that function `__bb_trace_ret' must not change the
1341 machine state, especially the flag register. To grant
1342 this, you must output code to save and restore registers
1343 either in this macro or in the macros MACHINE_STATE_SAVE_RET
1344 and MACHINE_STATE_RESTORE_RET. The last two macros will be
1345 used in the function `__bb_trace_ret', so you must make
1346 sure that the function prologue does not change any
1347 register prior to saving it with MACHINE_STATE_SAVE_RET.
1348
1349 else if profiling_block_flag != 0:
1350
1351 The macro will not be used, so it need not distinguish
1352 these cases.
1353 */
1354
1355 #define FUNCTION_BLOCK_PROFILER_EXIT(FILE) \
1356 do \
1357 { \
1358 rtx xops[1]; \
1359 \
1360 xops[0] = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (VOIDmode, "__bb_trace_ret")); \
1361 \
1362 output_asm_insn (AS1(call,%P0), xops); \
1363 \
1364 } \
1365 while (0)
1366
1367 /* The function `__bb_trace_func' is called in every basic block
1368 and is not allowed to change the machine state. Saving (restoring)
1369 the state can either be done in the BLOCK_PROFILER macro,
1370 before calling function (rsp. after returning from function)
1371 `__bb_trace_func', or it can be done inside the function by
1372 defining the macros:
1373
1374 MACHINE_STATE_SAVE(ID)
1375 MACHINE_STATE_RESTORE(ID)
1376
1377 In the latter case care must be taken, that the prologue code
1378 of function `__bb_trace_func' does not already change the
1379 state prior to saving it with MACHINE_STATE_SAVE.
1380
1381 The parameter `ID' is a string identifying a unique macro use.
1382
1383 On the i386 the initialization code at the begin of
1384 function `__bb_trace_func' contains a `sub' instruction
1385 therefore we handle save and restore of the flag register
1386 in the BLOCK_PROFILER macro. */
1387
1388 #define MACHINE_STATE_SAVE(ID) \
1389 asm (" pushl %eax"); \
1390 asm (" pushl %ecx"); \
1391 asm (" pushl %edx"); \
1392 asm (" pushl %esi");
1393
1394 #define MACHINE_STATE_RESTORE(ID) \
1395 asm (" popl %esi"); \
1396 asm (" popl %edx"); \
1397 asm (" popl %ecx"); \
1398 asm (" popl %eax");
1399
1400 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1401 the stack pointer does not matter. The value is tested only in
1402 functions that have frame pointers.
1403 No definition is equivalent to always zero. */
1404 /* Note on the 386 it might be more efficient not to define this since
1405 we have to restore it ourselves from the frame pointer, in order to
1406 use pop */
1407
1408 #define EXIT_IGNORE_STACK 1
1409
1410 /* This macro generates the assembly code for function exit,
1411 on machines that need it. If FUNCTION_EPILOGUE is not defined
1412 then individual return instructions are generated for each
1413 return statement. Args are same as for FUNCTION_PROLOGUE.
1414
1415 The function epilogue should not depend on the current stack pointer!
1416 It should use the frame pointer only. This is mandatory because
1417 of alloca; we also take advantage of it to omit stack adjustments
1418 before returning.
1419
1420 If the last non-note insn in the function is a BARRIER, then there
1421 is no need to emit a function prologue, because control does not fall
1422 off the end. This happens if the function ends in an "exit" call, or
1423 if a `return' insn is emitted directly into the function. */
1424
1425 #if 0
1426 #define FUNCTION_BEGIN_EPILOGUE(FILE) \
1427 do { \
1428 rtx last = get_last_insn (); \
1429 if (last && GET_CODE (last) == NOTE) \
1430 last = prev_nonnote_insn (last); \
1431 /* if (! last || GET_CODE (last) != BARRIER) \
1432 function_epilogue (FILE, SIZE);*/ \
1433 } while (0)
1434 #endif
1435
1436 #define FUNCTION_EPILOGUE(FILE, SIZE) \
1437 function_epilogue (FILE, SIZE)
1438
1439 /* Output assembler code for a block containing the constant parts
1440 of a trampoline, leaving space for the variable parts. */
1441
1442 /* On the 386, the trampoline contains three instructions:
1443 mov #STATIC,ecx
1444 mov #FUNCTION,eax
1445 jmp @eax */
1446 #define TRAMPOLINE_TEMPLATE(FILE) \
1447 { \
1448 ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb9)); \
1449 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
1450 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
1451 ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb8)); \
1452 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
1453 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
1454 ASM_OUTPUT_CHAR (FILE, GEN_INT (0xff)); \
1455 ASM_OUTPUT_CHAR (FILE, GEN_INT (0xe0)); \
1456 }
1457
1458 /* Length in units of the trampoline for entering a nested function. */
1459
1460 #define TRAMPOLINE_SIZE 12
1461
1462 /* Emit RTL insns to initialize the variable parts of a trampoline.
1463 FNADDR is an RTX for the address of the function's pure code.
1464 CXT is an RTX for the static chain value for the function. */
1465
1466 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
1467 { \
1468 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 1)), CXT); \
1469 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 6)), FNADDR); \
1470 }
1471 \f
1472 /* Definitions for register eliminations.
1473
1474 This is an array of structures. Each structure initializes one pair
1475 of eliminable registers. The "from" register number is given first,
1476 followed by "to". Eliminations of the same "from" register are listed
1477 in order of preference.
1478
1479 We have two registers that can be eliminated on the i386. First, the
1480 frame pointer register can often be eliminated in favor of the stack
1481 pointer register. Secondly, the argument pointer register can always be
1482 eliminated; it is replaced with either the stack or frame pointer. */
1483
1484 #define ELIMINABLE_REGS \
1485 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1486 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1487 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1488
1489 /* Given FROM and TO register numbers, say whether this elimination is allowed.
1490 Frame pointer elimination is automatically handled.
1491
1492 For the i386, if frame pointer elimination is being done, we would like to
1493 convert ap into sp, not fp.
1494
1495 All other eliminations are valid. */
1496
1497 #define CAN_ELIMINATE(FROM, TO) \
1498 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
1499 ? ! frame_pointer_needed \
1500 : 1)
1501
1502 /* Define the offset between two registers, one to be eliminated, and the other
1503 its replacement, at the start of a routine. */
1504
1505 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1506 { \
1507 if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \
1508 (OFFSET) = 8; /* Skip saved PC and previous frame pointer */ \
1509 else \
1510 { \
1511 int regno; \
1512 int offset = 0; \
1513 \
1514 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
1515 if ((regs_ever_live[regno] && ! call_used_regs[regno]) \
1516 || ((current_function_uses_pic_offset_table \
1517 || current_function_uses_const_pool) \
1518 && flag_pic && regno == PIC_OFFSET_TABLE_REGNUM)) \
1519 offset += 4; \
1520 \
1521 (OFFSET) = offset + get_frame_size (); \
1522 \
1523 if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
1524 (OFFSET) += 4; /* Skip saved PC */ \
1525 } \
1526 }
1527 \f
1528 /* Addressing modes, and classification of registers for them. */
1529
1530 /* #define HAVE_POST_INCREMENT */
1531 /* #define HAVE_POST_DECREMENT */
1532
1533 /* #define HAVE_PRE_DECREMENT */
1534 /* #define HAVE_PRE_INCREMENT */
1535
1536 /* Macros to check register numbers against specific register classes. */
1537
1538 /* These assume that REGNO is a hard or pseudo reg number.
1539 They give nonzero only if REGNO is a hard reg of the suitable class
1540 or a pseudo reg currently allocated to a suitable hard reg.
1541 Since they use reg_renumber, they are safe only once reg_renumber
1542 has been allocated, which happens in local-alloc.c. */
1543
1544 #define REGNO_OK_FOR_INDEX_P(REGNO) \
1545 ((REGNO) < STACK_POINTER_REGNUM \
1546 || (unsigned) reg_renumber[REGNO] < STACK_POINTER_REGNUM)
1547
1548 #define REGNO_OK_FOR_BASE_P(REGNO) \
1549 ((REGNO) <= STACK_POINTER_REGNUM \
1550 || (REGNO) == ARG_POINTER_REGNUM \
1551 || (unsigned) reg_renumber[REGNO] <= STACK_POINTER_REGNUM)
1552
1553 #define REGNO_OK_FOR_SIREG_P(REGNO) ((REGNO) == 4 || reg_renumber[REGNO] == 4)
1554 #define REGNO_OK_FOR_DIREG_P(REGNO) ((REGNO) == 5 || reg_renumber[REGNO] == 5)
1555
1556 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
1557 and check its validity for a certain class.
1558 We have two alternate definitions for each of them.
1559 The usual definition accepts all pseudo regs; the other rejects
1560 them unless they have been allocated suitable hard regs.
1561 The symbol REG_OK_STRICT causes the latter definition to be used.
1562
1563 Most source files want to accept pseudo regs in the hope that
1564 they will get allocated to the class that the insn wants them to be in.
1565 Source files for reload pass need to be strict.
1566 After reload, it makes no difference, since pseudo regs have
1567 been eliminated by then. */
1568
1569
1570 /* Non strict versions, pseudos are ok */
1571 #define REG_OK_FOR_INDEX_NONSTRICT_P(X) \
1572 (REGNO (X) < STACK_POINTER_REGNUM \
1573 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
1574
1575 #define REG_OK_FOR_BASE_NONSTRICT_P(X) \
1576 (REGNO (X) <= STACK_POINTER_REGNUM \
1577 || REGNO (X) == ARG_POINTER_REGNUM \
1578 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
1579
1580 #define REG_OK_FOR_STRREG_NONSTRICT_P(X) \
1581 (REGNO (X) == 4 || REGNO (X) == 5 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
1582
1583 /* Strict versions, hard registers only */
1584 #define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
1585 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1586 #define REG_OK_FOR_STRREG_STRICT_P(X) \
1587 (REGNO_OK_FOR_DIREG_P (REGNO (X)) || REGNO_OK_FOR_SIREG_P (REGNO (X)))
1588
1589 #ifndef REG_OK_STRICT
1590 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P(X)
1591 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P(X)
1592 #define REG_OK_FOR_STRREG_P(X) REG_OK_FOR_STRREG_NONSTRICT_P(X)
1593
1594 #else
1595 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P(X)
1596 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P(X)
1597 #define REG_OK_FOR_STRREG_P(X) REG_OK_FOR_STRREG_STRICT_P(X)
1598 #endif
1599
1600 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
1601 that is a valid memory address for an instruction.
1602 The MODE argument is the machine mode for the MEM expression
1603 that wants to use this address.
1604
1605 The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
1606 except for CONSTANT_ADDRESS_P which is usually machine-independent.
1607
1608 See legitimize_pic_address in i386.c for details as to what
1609 constitutes a legitimate address when -fpic is used. */
1610
1611 #define MAX_REGS_PER_ADDRESS 2
1612
1613 #define CONSTANT_ADDRESS_P(X) \
1614 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
1615 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
1616 || GET_CODE (X) == HIGH)
1617
1618 /* Nonzero if the constant value X is a legitimate general operand.
1619 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
1620
1621 #define LEGITIMATE_CONSTANT_P(X) 1
1622
1623 #ifdef REG_OK_STRICT
1624 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
1625 { \
1626 if (legitimate_address_p (MODE, X, 1)) \
1627 goto ADDR; \
1628 }
1629
1630 #else
1631 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
1632 { \
1633 if (legitimate_address_p (MODE, X, 0)) \
1634 goto ADDR; \
1635 }
1636
1637 #endif
1638
1639 /* Try machine-dependent ways of modifying an illegitimate address
1640 to be legitimate. If we find one, return the new, valid address.
1641 This macro is used in only one place: `memory_address' in explow.c.
1642
1643 OLDX is the address as it was before break_out_memory_refs was called.
1644 In some cases it is useful to look at this to decide what needs to be done.
1645
1646 MODE and WIN are passed so that this macro can use
1647 GO_IF_LEGITIMATE_ADDRESS.
1648
1649 It is always safe for this macro to do nothing. It exists to recognize
1650 opportunities to optimize the output.
1651
1652 For the 80386, we handle X+REG by loading X into a register R and
1653 using R+REG. R will go in a general reg and indexing will be used.
1654 However, if REG is a broken-out memory address or multiplication,
1655 nothing needs to be done because REG can certainly go in a general reg.
1656
1657 When -fpic is used, special handling is needed for symbolic references.
1658 See comments by legitimize_pic_address in i386.c for details. */
1659
1660 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
1661 { \
1662 (X) = legitimize_address (X, OLDX, MODE); \
1663 if (memory_address_p (MODE, X)) \
1664 goto WIN; \
1665 }
1666
1667 #define REWRITE_ADDRESS(x) rewrite_address(x)
1668
1669 /* Nonzero if the constant value X is a legitimate general operand
1670 when generating PIC code. It is given that flag_pic is on and
1671 that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
1672
1673 #define LEGITIMATE_PIC_OPERAND_P(X) \
1674 (! SYMBOLIC_CONST (X) \
1675 || (GET_CODE (X) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (X)))
1676
1677 #define SYMBOLIC_CONST(X) \
1678 (GET_CODE (X) == SYMBOL_REF \
1679 || GET_CODE (X) == LABEL_REF \
1680 || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
1681
1682 /* Go to LABEL if ADDR (a legitimate address expression)
1683 has an effect that depends on the machine mode it is used for.
1684 On the 80386, only postdecrement and postincrement address depend thus
1685 (the amount of decrement or increment being the length of the operand). */
1686 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1687 if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == POST_DEC) goto LABEL
1688 \f
1689 /* Define this macro if references to a symbol must be treated
1690 differently depending on something about the variable or
1691 function named by the symbol (such as what section it is in).
1692
1693 On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol
1694 so that we may access it directly in the GOT. */
1695
1696 #define ENCODE_SECTION_INFO(DECL) \
1697 do \
1698 { \
1699 if (flag_pic) \
1700 { \
1701 rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
1702 ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
1703 \
1704 if (TARGET_DEBUG_ADDR \
1705 && TREE_CODE_CLASS (TREE_CODE (DECL)) == 'd') \
1706 { \
1707 fprintf (stderr, "Encode %s, public = %d\n", \
1708 IDENTIFIER_POINTER (DECL_NAME (DECL)), \
1709 TREE_PUBLIC (DECL)); \
1710 } \
1711 \
1712 SYMBOL_REF_FLAG (XEXP (rtl, 0)) \
1713 = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
1714 || ! TREE_PUBLIC (DECL)); \
1715 } \
1716 } \
1717 while (0)
1718
1719 /* Initialize data used by insn expanders. This is called from
1720 init_emit, once for each function, before code is generated.
1721 For 386, clear stack slot assignments remembered from previous
1722 functions. */
1723
1724 #define INIT_EXPANDERS clear_386_stack_locals ()
1725
1726 /* The `FINALIZE_PIC' macro serves as a hook to emit these special
1727 codes once the function is being compiled into assembly code, but
1728 not before. (It is not done before, because in the case of
1729 compiling an inline function, it would lead to multiple PIC
1730 prologues being included in functions which used inline functions
1731 and were compiled to assembly language.) */
1732
1733 #define FINALIZE_PIC \
1734 do \
1735 { \
1736 extern int current_function_uses_pic_offset_table; \
1737 \
1738 current_function_uses_pic_offset_table |= profile_flag | profile_block_flag; \
1739 } \
1740 while (0)
1741
1742 \f
1743 /* If defined, a C expression whose value is nonzero if IDENTIFIER
1744 with arguments ARGS is a valid machine specific attribute for DECL.
1745 The attributes in ATTRIBUTES have previously been assigned to DECL. */
1746
1747 #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
1748 (i386_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
1749
1750 /* If defined, a C expression whose value is nonzero if IDENTIFIER
1751 with arguments ARGS is a valid machine specific attribute for TYPE.
1752 The attributes in ATTRIBUTES have previously been assigned to TYPE. */
1753
1754 #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
1755 (i386_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
1756
1757 /* If defined, a C expression whose value is zero if the attributes on
1758 TYPE1 and TYPE2 are incompatible, one if they are compatible, and
1759 two if they are nearly compatible (which causes a warning to be
1760 generated). */
1761
1762 #define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
1763 (i386_comp_type_attributes (TYPE1, TYPE2))
1764
1765 /* If defined, a C statement that assigns default attributes to newly
1766 defined TYPE. */
1767
1768 /* #define SET_DEFAULT_TYPE_ATTRIBUTES (TYPE) */
1769
1770 /* Max number of args passed in registers. If this is more than 3, we will
1771 have problems with ebx (register #4), since it is a caller save register and
1772 is also used as the pic register in ELF. So for now, don't allow more than
1773 3 registers to be passed in registers. */
1774
1775 #define REGPARM_MAX 3
1776
1777 \f
1778 /* Specify the machine mode that this machine uses
1779 for the index in the tablejump instruction. */
1780 #define CASE_VECTOR_MODE Pmode
1781
1782 /* Define as C expression which evaluates to nonzero if the tablejump
1783 instruction expects the table to contain offsets from the address of the
1784 table.
1785 Do not define this if the table should contain absolute addresses. */
1786 /* #define CASE_VECTOR_PC_RELATIVE 1 */
1787
1788 /* Specify the tree operation to be used to convert reals to integers.
1789 This should be changed to take advantage of fist --wfs ??
1790 */
1791 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
1792
1793 /* This is the kind of divide that is easiest to do in the general case. */
1794 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
1795
1796 /* Define this as 1 if `char' should by default be signed; else as 0. */
1797 #define DEFAULT_SIGNED_CHAR 1
1798
1799 /* Max number of bytes we can move from memory to memory
1800 in one reasonably fast instruction. */
1801 #define MOVE_MAX 4
1802
1803 /* The number of scalar move insns which should be generated instead
1804 of a string move insn or a library call. Increasing the value
1805 will always make code faster, but eventually incurs high cost in
1806 increased code size.
1807
1808 If you don't define this, a reasonable default is used.
1809
1810 Make this large on i386, since the block move is very inefficient with small
1811 blocks, and the hard register needs of the block move require much reload
1812 work. */
1813
1814 #define MOVE_RATIO 5
1815
1816 /* Define if shifts truncate the shift count
1817 which implies one can omit a sign-extension or zero-extension
1818 of a shift count. */
1819 /* On i386, shifts do truncate the count. But bit opcodes don't. */
1820
1821 /* #define SHIFT_COUNT_TRUNCATED */
1822
1823 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1824 is done just by pretending it is already truncated. */
1825 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1826
1827 /* We assume that the store-condition-codes instructions store 0 for false
1828 and some other value for true. This is the value stored for true. */
1829
1830 #define STORE_FLAG_VALUE 1
1831
1832 /* When a prototype says `char' or `short', really pass an `int'.
1833 (The 386 can't easily push less than an int.) */
1834
1835 #define PROMOTE_PROTOTYPES
1836
1837 /* Specify the machine mode that pointers have.
1838 After generation of rtl, the compiler makes no further distinction
1839 between pointers and any other objects of this machine mode. */
1840 #define Pmode SImode
1841
1842 /* A function address in a call instruction
1843 is a byte address (for indexing purposes)
1844 so give the MEM rtx a byte's mode. */
1845 #define FUNCTION_MODE QImode
1846 \f
1847 /* A part of a C `switch' statement that describes the relative costs
1848 of constant RTL expressions. It must contain `case' labels for
1849 expression codes `const_int', `const', `symbol_ref', `label_ref'
1850 and `const_double'. Each case must ultimately reach a `return'
1851 statement to return the relative cost of the use of that kind of
1852 constant value in an expression. The cost may depend on the
1853 precise value of the constant, which is available for examination
1854 in X, and the rtx code of the expression in which it is contained,
1855 found in OUTER_CODE.
1856
1857 CODE is the expression code--redundant, since it can be obtained
1858 with `GET_CODE (X)'. */
1859
1860 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
1861 case CONST_INT: \
1862 return (unsigned) INTVAL (RTX) < 256 ? 0 : 1; \
1863 case CONST: \
1864 case LABEL_REF: \
1865 case SYMBOL_REF: \
1866 return flag_pic && SYMBOLIC_CONST (RTX) ? 2 : 1; \
1867 \
1868 case CONST_DOUBLE: \
1869 { \
1870 int code; \
1871 if (GET_MODE (RTX) == VOIDmode) \
1872 return 2; \
1873 \
1874 code = standard_80387_constant_p (RTX); \
1875 return code == 1 ? 0 : \
1876 code == 2 ? 1 : \
1877 2; \
1878 }
1879
1880 /* Delete the definition here when TOPLEVEL_COSTS_N_INSNS gets added to cse.c */
1881 #define TOPLEVEL_COSTS_N_INSNS(N) {total = COSTS_N_INSNS (N); break;}
1882
1883 /* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
1884 This can be used, for example, to indicate how costly a multiply
1885 instruction is. In writing this macro, you can use the construct
1886 `COSTS_N_INSNS (N)' to specify a cost equal to N fast
1887 instructions. OUTER_CODE is the code of the expression in which X
1888 is contained.
1889
1890 This macro is optional; do not define it if the default cost
1891 assumptions are adequate for the target machine. */
1892
1893 #define RTX_COSTS(X,CODE,OUTER_CODE) \
1894 case ASHIFT: \
1895 if (GET_CODE (XEXP (X, 1)) == CONST_INT \
1896 && GET_MODE (XEXP (X, 0)) == SImode) \
1897 { \
1898 HOST_WIDE_INT value = INTVAL (XEXP (X, 1)); \
1899 \
1900 if (value == 1) \
1901 return COSTS_N_INSNS (ix86_cost->add) \
1902 + rtx_cost(XEXP (X, 0), OUTER_CODE); \
1903 \
1904 if (value == 2 || value == 3) \
1905 return COSTS_N_INSNS (ix86_cost->lea) \
1906 + rtx_cost(XEXP (X, 0), OUTER_CODE); \
1907 } \
1908 /* fall through */ \
1909 \
1910 case ROTATE: \
1911 case ASHIFTRT: \
1912 case LSHIFTRT: \
1913 case ROTATERT: \
1914 if (GET_MODE (XEXP (X, 0)) == DImode) \
1915 { \
1916 if (GET_CODE (XEXP (X, 1)) == CONST_INT) \
1917 { \
1918 if (INTVAL (XEXP (X, 1)) > 32) \
1919 return COSTS_N_INSNS(ix86_cost->shift_const + 2); \
1920 return COSTS_N_INSNS(ix86_cost->shift_const * 2); \
1921 } \
1922 return ((GET_CODE (XEXP (X, 1)) == AND \
1923 ? COSTS_N_INSNS(ix86_cost->shift_var * 2) \
1924 : COSTS_N_INSNS(ix86_cost->shift_var * 6 + 2)) \
1925 + rtx_cost(XEXP (X, 0), OUTER_CODE)); \
1926 } \
1927 return COSTS_N_INSNS (GET_CODE (XEXP (X, 1)) == CONST_INT \
1928 ? ix86_cost->shift_const \
1929 : ix86_cost->shift_var) \
1930 + rtx_cost(XEXP (X, 0), OUTER_CODE); \
1931 \
1932 case MULT: \
1933 if (GET_CODE (XEXP (X, 1)) == CONST_INT) \
1934 { \
1935 unsigned HOST_WIDE_INT value = INTVAL (XEXP (X, 1)); \
1936 int nbits = 0; \
1937 \
1938 if (value == 2) \
1939 return COSTS_N_INSNS (ix86_cost->add) \
1940 + rtx_cost(XEXP (X, 0), OUTER_CODE); \
1941 if (value == 4 || value == 8) \
1942 return COSTS_N_INSNS (ix86_cost->lea) \
1943 + rtx_cost(XEXP (X, 0), OUTER_CODE); \
1944 \
1945 while (value != 0) \
1946 { \
1947 nbits++; \
1948 value >>= 1; \
1949 } \
1950 \
1951 if (nbits == 1) \
1952 return COSTS_N_INSNS (ix86_cost->shift_const) \
1953 + rtx_cost(XEXP (X, 0), OUTER_CODE); \
1954 \
1955 return COSTS_N_INSNS (ix86_cost->mult_init \
1956 + nbits * ix86_cost->mult_bit) \
1957 + rtx_cost(XEXP (X, 0), OUTER_CODE); \
1958 } \
1959 \
1960 else /* This is arbitrary */ \
1961 TOPLEVEL_COSTS_N_INSNS (ix86_cost->mult_init \
1962 + 7 * ix86_cost->mult_bit); \
1963 \
1964 case DIV: \
1965 case UDIV: \
1966 case MOD: \
1967 case UMOD: \
1968 TOPLEVEL_COSTS_N_INSNS (ix86_cost->divide); \
1969 \
1970 case PLUS: \
1971 if (GET_CODE (XEXP (X, 0)) == REG \
1972 && GET_MODE (XEXP (X, 0)) == SImode \
1973 && GET_CODE (XEXP (X, 1)) == PLUS) \
1974 return COSTS_N_INSNS (ix86_cost->lea); \
1975 \
1976 /* fall through */ \
1977 case AND: \
1978 case IOR: \
1979 case XOR: \
1980 case MINUS: \
1981 if (GET_MODE (X) == DImode) \
1982 return COSTS_N_INSNS (ix86_cost->add) * 2 \
1983 + (rtx_cost (XEXP (X, 0), OUTER_CODE) \
1984 << (GET_MODE (XEXP (X, 0)) != DImode)) \
1985 + (rtx_cost (XEXP (X, 1), OUTER_CODE) \
1986 << (GET_MODE (XEXP (X, 1)) != DImode)); \
1987 case NEG: \
1988 case NOT: \
1989 if (GET_MODE (X) == DImode) \
1990 TOPLEVEL_COSTS_N_INSNS (ix86_cost->add * 2) \
1991 TOPLEVEL_COSTS_N_INSNS (ix86_cost->add)
1992
1993
1994 /* An expression giving the cost of an addressing mode that contains
1995 ADDRESS. If not defined, the cost is computed from the ADDRESS
1996 expression and the `CONST_COSTS' values.
1997
1998 For most CISC machines, the default cost is a good approximation
1999 of the true cost of the addressing mode. However, on RISC
2000 machines, all instructions normally have the same length and
2001 execution time. Hence all addresses will have equal costs.
2002
2003 In cases where more than one form of an address is known, the form
2004 with the lowest cost will be used. If multiple forms have the
2005 same, lowest, cost, the one that is the most complex will be used.
2006
2007 For example, suppose an address that is equal to the sum of a
2008 register and a constant is used twice in the same basic block.
2009 When this macro is not defined, the address will be computed in a
2010 register and memory references will be indirect through that
2011 register. On machines where the cost of the addressing mode
2012 containing the sum is no higher than that of a simple indirect
2013 reference, this will produce an additional instruction and
2014 possibly require an additional register. Proper specification of
2015 this macro eliminates this overhead for such machines.
2016
2017 Similar use of this macro is made in strength reduction of loops.
2018
2019 ADDRESS need not be valid as an address. In such a case, the cost
2020 is not relevant and can be any value; invalid addresses need not be
2021 assigned a different cost.
2022
2023 On machines where an address involving more than one register is as
2024 cheap as an address computation involving only one register,
2025 defining `ADDRESS_COST' to reflect this can cause two registers to
2026 be live over a region of code where only one would have been if
2027 `ADDRESS_COST' were not defined in that manner. This effect should
2028 be considered in the definition of this macro. Equivalent costs
2029 should probably only be given to addresses with different numbers
2030 of registers on machines with lots of registers.
2031
2032 This macro will normally either not be defined or be defined as a
2033 constant.
2034
2035 For i386, it is better to use a complex address than let gcc copy
2036 the address into a reg and make a new pseudo. But not if the address
2037 requires to two regs - that would mean more pseudos with longer
2038 lifetimes. */
2039
2040 #define ADDRESS_COST(RTX) \
2041 ((CONSTANT_P (RTX) \
2042 || (GET_CODE (RTX) == PLUS && CONSTANT_P (XEXP (RTX, 1)) \
2043 && REG_P (XEXP (RTX, 0)))) ? 0 \
2044 : REG_P (RTX) ? 1 \
2045 : 2)
2046
2047 /* A C expression for the cost of moving data of mode M between a
2048 register and memory. A value of 2 is the default; this cost is
2049 relative to those in `REGISTER_MOVE_COST'.
2050
2051 If moving between registers and memory is more expensive than
2052 between two registers, you should define this macro to express the
2053 relative cost.
2054
2055 On the i386, copying between floating-point and fixed-point
2056 registers is expensive. */
2057
2058 #define REGISTER_MOVE_COST(CLASS1, CLASS2) \
2059 (((FLOAT_CLASS_P (CLASS1) && ! FLOAT_CLASS_P (CLASS2)) \
2060 || (! FLOAT_CLASS_P (CLASS1) && FLOAT_CLASS_P (CLASS2))) ? 10 \
2061 : 2)
2062
2063
2064 /* A C expression for the cost of moving data of mode M between a
2065 register and memory. A value of 2 is the default; this cost is
2066 relative to those in `REGISTER_MOVE_COST'.
2067
2068 If moving between registers and memory is more expensive than
2069 between two registers, you should define this macro to express the
2070 relative cost. */
2071
2072 /* #define MEMORY_MOVE_COST(M,C,I) 2 */
2073
2074 /* A C expression for the cost of a branch instruction. A value of 1
2075 is the default; other values are interpreted relative to that. */
2076
2077 #define BRANCH_COST i386_branch_cost
2078
2079 /* Define this macro as a C expression which is nonzero if accessing
2080 less than a word of memory (i.e. a `char' or a `short') is no
2081 faster than accessing a word of memory, i.e., if such access
2082 require more than one instruction or if there is no difference in
2083 cost between byte and (aligned) word loads.
2084
2085 When this macro is not defined, the compiler will access a field by
2086 finding the smallest containing object; when it is defined, a
2087 fullword load will be used if alignment permits. Unless bytes
2088 accesses are faster than word accesses, using word accesses is
2089 preferable since it may eliminate subsequent memory access if
2090 subsequent accesses occur to other fields in the same word of the
2091 structure, but to different bytes. */
2092
2093 #define SLOW_BYTE_ACCESS 0
2094
2095 /* Nonzero if access to memory by shorts is slow and undesirable. */
2096 #define SLOW_SHORT_ACCESS 0
2097
2098 /* Define this macro if zero-extension (of a `char' or `short' to an
2099 `int') can be done faster if the destination is a register that is
2100 known to be zero.
2101
2102 If you define this macro, you must have instruction patterns that
2103 recognize RTL structures like this:
2104
2105 (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
2106
2107 and likewise for `HImode'. */
2108
2109 /* #define SLOW_ZERO_EXTEND */
2110
2111 /* Define this macro to be the value 1 if unaligned accesses have a
2112 cost many times greater than aligned accesses, for example if they
2113 are emulated in a trap handler.
2114
2115 When this macro is non-zero, the compiler will act as if
2116 `STRICT_ALIGNMENT' were non-zero when generating code for block
2117 moves. This can cause significantly more instructions to be
2118 produced. Therefore, do not set this macro non-zero if unaligned
2119 accesses only add a cycle or two to the time for a memory access.
2120
2121 If the value of this macro is always zero, it need not be defined. */
2122
2123 /* #define SLOW_UNALIGNED_ACCESS 0 */
2124
2125 /* Define this macro to inhibit strength reduction of memory
2126 addresses. (On some machines, such strength reduction seems to do
2127 harm rather than good.) */
2128
2129 /* #define DONT_REDUCE_ADDR */
2130
2131 /* Define this macro if it is as good or better to call a constant
2132 function address than to call an address kept in a register.
2133
2134 Desirable on the 386 because a CALL with a constant address is
2135 faster than one with a register address. */
2136
2137 #define NO_FUNCTION_CSE
2138
2139 /* Define this macro if it is as good or better for a function to call
2140 itself with an explicit address than to call an address kept in a
2141 register. */
2142
2143 #define NO_RECURSIVE_FUNCTION_CSE
2144
2145 /* A C statement (sans semicolon) to update the integer variable COST
2146 based on the relationship between INSN that is dependent on
2147 DEP_INSN through the dependence LINK. The default is to make no
2148 adjustment to COST. This can be used for example to specify to
2149 the scheduler that an output- or anti-dependence does not incur
2150 the same cost as a data-dependence. */
2151
2152 #define ADJUST_COST(insn,link,dep_insn,cost) \
2153 { \
2154 rtx next_inst; \
2155 if (GET_CODE (dep_insn) == CALL_INSN) \
2156 (cost) = 0; \
2157 \
2158 else if (GET_CODE (dep_insn) == INSN \
2159 && GET_CODE (PATTERN (dep_insn)) == SET \
2160 && GET_CODE (SET_DEST (PATTERN (dep_insn))) == REG \
2161 && GET_CODE (insn) == INSN \
2162 && GET_CODE (PATTERN (insn)) == SET \
2163 && !reg_overlap_mentioned_p (SET_DEST (PATTERN (dep_insn)), \
2164 SET_SRC (PATTERN (insn)))) \
2165 { \
2166 (cost) = 0; \
2167 } \
2168 \
2169 else if (GET_CODE (insn) == JUMP_INSN) \
2170 { \
2171 (cost) = 0; \
2172 } \
2173 \
2174 if (TARGET_PENTIUM) \
2175 { \
2176 if (cost !=0 && is_fp_insn (insn) && is_fp_insn (dep_insn) \
2177 && !is_fp_dest (dep_insn)) \
2178 { \
2179 (cost) = 0; \
2180 } \
2181 \
2182 if (agi_dependent (insn, dep_insn)) \
2183 { \
2184 (cost) = 3; \
2185 } \
2186 else if (GET_CODE (insn) == INSN \
2187 && GET_CODE (PATTERN (insn)) == SET \
2188 && SET_DEST (PATTERN (insn)) == cc0_rtx \
2189 && (next_inst = next_nonnote_insn (insn)) \
2190 && GET_CODE (next_inst) == JUMP_INSN) \
2191 { /* compare probably paired with jump */ \
2192 (cost) = 0; \
2193 } \
2194 } \
2195 else \
2196 if (!is_fp_dest (dep_insn)) \
2197 { \
2198 if(!agi_dependent (insn, dep_insn)) \
2199 (cost) = 0; \
2200 else if (TARGET_486) \
2201 (cost) = 2; \
2202 } \
2203 else \
2204 if (is_fp_store (insn) && is_fp_insn (dep_insn) \
2205 && NEXT_INSN (insn) && NEXT_INSN (NEXT_INSN (insn)) \
2206 && NEXT_INSN (NEXT_INSN (NEXT_INSN (insn))) \
2207 && (GET_CODE (NEXT_INSN (insn)) == INSN) \
2208 && (GET_CODE (NEXT_INSN (NEXT_INSN (insn))) == JUMP_INSN) \
2209 && (GET_CODE (NEXT_INSN (NEXT_INSN (NEXT_INSN (insn)))) == NOTE) \
2210 && (NOTE_LINE_NUMBER (NEXT_INSN (NEXT_INSN (NEXT_INSN (insn)))) \
2211 == NOTE_INSN_LOOP_END)) \
2212 { \
2213 (cost) = 3; \
2214 } \
2215 }
2216
2217
2218 #define ADJUST_BLOCKAGE(last_insn,insn,blockage) \
2219 { \
2220 if (is_fp_store (last_insn) && is_fp_insn (insn) \
2221 && NEXT_INSN (last_insn) && NEXT_INSN (NEXT_INSN (last_insn)) \
2222 && NEXT_INSN (NEXT_INSN (NEXT_INSN (last_insn))) \
2223 && (GET_CODE (NEXT_INSN (last_insn)) == INSN) \
2224 && (GET_CODE (NEXT_INSN (NEXT_INSN (last_insn))) == JUMP_INSN) \
2225 && (GET_CODE (NEXT_INSN (NEXT_INSN (NEXT_INSN (last_insn)))) == NOTE) \
2226 && (NOTE_LINE_NUMBER (NEXT_INSN (NEXT_INSN (NEXT_INSN (last_insn)))) \
2227 == NOTE_INSN_LOOP_END)) \
2228 { \
2229 (blockage) = 3; \
2230 } \
2231 }
2232
2233 \f
2234 /* Add any extra modes needed to represent the condition code.
2235
2236 For the i386, we need separate modes when floating-point equality
2237 comparisons are being done. */
2238
2239 #define EXTRA_CC_MODES CCFPEQmode
2240
2241 /* Define the names for the modes specified above. */
2242 #define EXTRA_CC_NAMES "CCFPEQ"
2243
2244 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
2245 return the mode to be used for the comparison.
2246
2247 For floating-point equality comparisons, CCFPEQmode should be used.
2248 VOIDmode should be used in all other cases. */
2249
2250 #define SELECT_CC_MODE(OP,X,Y) \
2251 (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
2252 && ((OP) == EQ || (OP) == NE) ? CCFPEQmode : VOIDmode)
2253
2254 /* Define the information needed to generate branch and scc insns. This is
2255 stored from the compare operation. Note that we can't use "rtx" here
2256 since it hasn't been defined! */
2257
2258 extern struct rtx_def *(*i386_compare_gen)(), *(*i386_compare_gen_eq)();
2259
2260 /* Tell final.c how to eliminate redundant test instructions. */
2261
2262 /* Here we define machine-dependent flags and fields in cc_status
2263 (see `conditions.h'). */
2264
2265 /* Set if the cc value was actually from the 80387 and
2266 we are testing eax directly (i.e. no sahf) */
2267 #define CC_TEST_AX 020000
2268
2269 /* Set if the cc value is actually in the 80387, so a floating point
2270 conditional branch must be output. */
2271 #define CC_IN_80387 04000
2272
2273 /* Set if the CC value was stored in a nonstandard way, so that
2274 the state of equality is indicated by zero in the carry bit. */
2275 #define CC_Z_IN_NOT_C 010000
2276
2277 /* Set if the CC value was actually from the 80387 and loaded directly
2278 into the eflags instead of via eax/sahf. */
2279 #define CC_FCOMI 040000
2280
2281 /* Store in cc_status the expressions
2282 that the condition codes will describe
2283 after execution of an instruction whose pattern is EXP.
2284 Do not alter them if the instruction would not alter the cc's. */
2285
2286 #define NOTICE_UPDATE_CC(EXP, INSN) \
2287 notice_update_cc((EXP))
2288
2289 /* Output a signed jump insn. Use template NORMAL ordinarily, or
2290 FLOAT following a floating point comparison.
2291 Use NO_OV following an arithmetic insn that set the cc's
2292 before a test insn that was deleted.
2293 NO_OV may be zero, meaning final should reinsert the test insn
2294 because the jump cannot be handled properly without it. */
2295
2296 #define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \
2297 { \
2298 if (cc_prev_status.flags & CC_IN_80387) \
2299 return FLOAT; \
2300 if (cc_prev_status.flags & CC_NO_OVERFLOW) \
2301 return NO_OV; \
2302 return NORMAL; \
2303 }
2304 \f
2305 /* Control the assembler format that we output, to the extent
2306 this does not vary between assemblers. */
2307
2308 /* How to refer to registers in assembler output.
2309 This sequence is indexed by compiler's hard-register-number (see above). */
2310
2311 /* In order to refer to the first 8 regs as 32 bit regs prefix an "e"
2312 For non floating point regs, the following are the HImode names.
2313
2314 For float regs, the stack top is sometimes referred to as "%st(0)"
2315 instead of just "%st". PRINT_REG handles this with the "y" code. */
2316
2317 #define HI_REGISTER_NAMES \
2318 {"ax","dx","cx","bx","si","di","bp","sp", \
2319 "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)","" }
2320
2321 #define REGISTER_NAMES HI_REGISTER_NAMES
2322
2323 /* Table of additional register names to use in user input. */
2324
2325 #define ADDITIONAL_REGISTER_NAMES \
2326 { { "eax", 0 }, { "edx", 1 }, { "ecx", 2 }, { "ebx", 3 }, \
2327 { "esi", 4 }, { "edi", 5 }, { "ebp", 6 }, { "esp", 7 }, \
2328 { "al", 0 }, { "dl", 1 }, { "cl", 2 }, { "bl", 3 }, \
2329 { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh", 3 } }
2330
2331 /* Note we are omitting these since currently I don't know how
2332 to get gcc to use these, since they want the same but different
2333 number as al, and ax.
2334 */
2335
2336 /* note the last four are not really qi_registers, but
2337 the md will have to never output movb into one of them
2338 only a movw . There is no movb into the last four regs */
2339
2340 #define QI_REGISTER_NAMES \
2341 {"al", "dl", "cl", "bl", "si", "di", "bp", "sp",}
2342
2343 /* These parallel the array above, and can be used to access bits 8:15
2344 of regs 0 through 3. */
2345
2346 #define QI_HIGH_REGISTER_NAMES \
2347 {"ah", "dh", "ch", "bh", }
2348
2349 /* How to renumber registers for dbx and gdb. */
2350
2351 /* {0,2,1,3,6,7,4,5,12,13,14,15,16,17} */
2352 #define DBX_REGISTER_NUMBER(n) \
2353 ((n) == 0 ? 0 : \
2354 (n) == 1 ? 2 : \
2355 (n) == 2 ? 1 : \
2356 (n) == 3 ? 3 : \
2357 (n) == 4 ? 6 : \
2358 (n) == 5 ? 7 : \
2359 (n) == 6 ? 4 : \
2360 (n) == 7 ? 5 : \
2361 (n) + 4)
2362
2363 /* Before the prologue, RA is at 0(%esp). */
2364 #define INCOMING_RETURN_ADDR_RTX \
2365 gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM))
2366
2367 /* After the prologue, RA is at -4(AP) in the current frame. */
2368 #define RETURN_ADDR_RTX(COUNT, FRAME) \
2369 ((COUNT) == 0 \
2370 ? gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, arg_pointer_rtx, GEN_INT(-4)))\
2371 : gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, (FRAME), GEN_INT(4))))
2372
2373 /* PC is dbx register 8; let's use that column for RA. */
2374 #define DWARF_FRAME_RETURN_COLUMN 8
2375
2376 /* Before the prologue, the top of the frame is at 4(%esp). */
2377 #define INCOMING_FRAME_SP_OFFSET 4
2378
2379 /* This is how to output the definition of a user-level label named NAME,
2380 such as the label on a static function or variable NAME. */
2381
2382 #define ASM_OUTPUT_LABEL(FILE,NAME) \
2383 (assemble_name (FILE, NAME), fputs (":\n", FILE))
2384
2385 /* This is how to output an assembler line defining a `double' constant. */
2386
2387 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
2388 do { long l[2]; \
2389 REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l); \
2390 fprintf (FILE, "%s 0x%lx,0x%lx\n", ASM_LONG, l[0], l[1]); \
2391 } while (0)
2392
2393 /* This is how to output a `long double' extended real constant. */
2394
2395 #undef ASM_OUTPUT_LONG_DOUBLE
2396 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
2397 do { long l[3]; \
2398 REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \
2399 fprintf (FILE, "%s 0x%lx,0x%lx,0x%lx\n", ASM_LONG, l[0], l[1], l[2]); \
2400 } while (0)
2401
2402 /* This is how to output an assembler line defining a `float' constant. */
2403
2404 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
2405 do { long l; \
2406 REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
2407 fprintf ((FILE), "%s 0x%lx\n", ASM_LONG, l); \
2408 } while (0)
2409
2410 /* Store in OUTPUT a string (made with alloca) containing
2411 an assembler-name for a local static variable named NAME.
2412 LABELNO is an integer which is different for each call. */
2413
2414 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
2415 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
2416 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
2417
2418
2419
2420 /* This is how to output an assembler line defining an `int' constant. */
2421
2422 #define ASM_OUTPUT_INT(FILE,VALUE) \
2423 ( fprintf (FILE, "%s ", ASM_LONG), \
2424 output_addr_const (FILE,(VALUE)), \
2425 putc('\n',FILE))
2426
2427 /* Likewise for `char' and `short' constants. */
2428 /* is this supposed to do align too?? */
2429
2430 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
2431 ( fprintf (FILE, "%s ", ASM_SHORT), \
2432 output_addr_const (FILE,(VALUE)), \
2433 putc('\n',FILE))
2434
2435 /*
2436 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
2437 ( fprintf (FILE, "%s ", ASM_BYTE_OP), \
2438 output_addr_const (FILE,(VALUE)), \
2439 fputs (",", FILE), \
2440 output_addr_const (FILE,(VALUE)), \
2441 fputs (" >> 8\n",FILE))
2442 */
2443
2444
2445 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
2446 ( fprintf (FILE, "%s ", ASM_BYTE_OP), \
2447 output_addr_const (FILE, (VALUE)), \
2448 putc ('\n', FILE))
2449
2450 /* This is how to output an assembler line for a numeric constant byte. */
2451
2452 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
2453 fprintf ((FILE), "%s 0x%x\n", ASM_BYTE_OP, (VALUE))
2454
2455 /* This is how to output an insn to push a register on the stack.
2456 It need not be very fast code. */
2457
2458 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
2459 fprintf (FILE, "\tpushl %%e%s\n", reg_names[REGNO])
2460
2461 /* This is how to output an insn to pop a register from the stack.
2462 It need not be very fast code. */
2463
2464 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
2465 fprintf (FILE, "\tpopl %%e%s\n", reg_names[REGNO])
2466
2467 /* This is how to output an element of a case-vector that is absolute.
2468 */
2469
2470 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
2471 fprintf (FILE, "%s %s%d\n", ASM_LONG, LPREFIX, VALUE)
2472
2473 /* This is how to output an element of a case-vector that is relative.
2474 We don't use these on the 386 yet, because the ATT assembler can't do
2475 forward reference the differences.
2476 */
2477
2478 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
2479 fprintf (FILE, "\t.word %s%d-%s%d\n",LPREFIX, VALUE,LPREFIX, REL)
2480
2481 /* Define the parentheses used to group arithmetic operations
2482 in assembler code. */
2483
2484 #define ASM_OPEN_PAREN ""
2485 #define ASM_CLOSE_PAREN ""
2486
2487 /* Define results of standard character escape sequences. */
2488 #define TARGET_BELL 007
2489 #define TARGET_BS 010
2490 #define TARGET_TAB 011
2491 #define TARGET_NEWLINE 012
2492 #define TARGET_VT 013
2493 #define TARGET_FF 014
2494 #define TARGET_CR 015
2495 \f
2496 /* Print operand X (an rtx) in assembler syntax to file FILE.
2497 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
2498 The CODE z takes the size of operand from the following digit, and
2499 outputs b,w,or l respectively.
2500
2501 On the 80386, we use several such letters:
2502 f -- float insn (print a CONST_DOUBLE as a float rather than in hex).
2503 L,W,B,Q,S,T -- print the opcode suffix for specified size of operand.
2504 R -- print the prefix for register names.
2505 z -- print the opcode suffix for the size of the current operand.
2506 * -- print a star (in certain assembler syntax)
2507 P -- if PIC, print an @PLT suffix.
2508 X -- don't print any sort of PIC '@' suffix for a symbol.
2509 J -- print jump insn for arithmetic_comparison_operator.
2510 s -- ??? something to do with double shifts. not actually used, afaik.
2511 C -- print a conditional move suffix corresponding to the op code.
2512 c -- likewise, but reverse the condition.
2513 F,f -- likewise, but for floating-point. */
2514
2515 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
2516 ((CODE) == '*')
2517
2518 /* Print the name of a register based on its machine mode and number.
2519 If CODE is 'w', pretend the mode is HImode.
2520 If CODE is 'b', pretend the mode is QImode.
2521 If CODE is 'k', pretend the mode is SImode.
2522 If CODE is 'h', pretend the reg is the `high' byte register.
2523 If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */
2524
2525 extern char *hi_reg_name[];
2526 extern char *qi_reg_name[];
2527 extern char *qi_high_reg_name[];
2528
2529 #define PRINT_REG(X, CODE, FILE) \
2530 do { if (REGNO (X) == ARG_POINTER_REGNUM) \
2531 abort (); \
2532 fprintf (FILE, "%s", RP); \
2533 switch ((CODE == 'w' ? 2 \
2534 : CODE == 'b' ? 1 \
2535 : CODE == 'k' ? 4 \
2536 : CODE == 'y' ? 3 \
2537 : CODE == 'h' ? 0 \
2538 : GET_MODE_SIZE (GET_MODE (X)))) \
2539 { \
2540 case 3: \
2541 if (STACK_TOP_P (X)) \
2542 { \
2543 fputs ("st(0)", FILE); \
2544 break; \
2545 } \
2546 case 4: \
2547 case 8: \
2548 case 12: \
2549 if (! FP_REG_P (X)) fputs ("e", FILE); \
2550 case 2: \
2551 fputs (hi_reg_name[REGNO (X)], FILE); \
2552 break; \
2553 case 1: \
2554 fputs (qi_reg_name[REGNO (X)], FILE); \
2555 break; \
2556 case 0: \
2557 fputs (qi_high_reg_name[REGNO (X)], FILE); \
2558 break; \
2559 } \
2560 } while (0)
2561
2562 #define PRINT_OPERAND(FILE, X, CODE) \
2563 print_operand (FILE, X, CODE)
2564
2565 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
2566 print_operand_address (FILE, ADDR)
2567
2568 /* Print the name of a register for based on its machine mode and number.
2569 This macro is used to print debugging output.
2570 This macro is different from PRINT_REG in that it may be used in
2571 programs that are not linked with aux-output.o. */
2572
2573 #define DEBUG_PRINT_REG(X, CODE, FILE) \
2574 do { static char *hi_name[] = HI_REGISTER_NAMES; \
2575 static char *qi_name[] = QI_REGISTER_NAMES; \
2576 fprintf (FILE, "%d %s", REGNO (X), RP); \
2577 if (REGNO (X) == ARG_POINTER_REGNUM) \
2578 { fputs ("argp", FILE); break; } \
2579 if (STACK_TOP_P (X)) \
2580 { fputs ("st(0)", FILE); break; } \
2581 if (FP_REG_P (X)) \
2582 { fputs (hi_name[REGNO(X)], FILE); break; } \
2583 switch (GET_MODE_SIZE (GET_MODE (X))) \
2584 { \
2585 default: \
2586 fputs ("e", FILE); \
2587 case 2: \
2588 fputs (hi_name[REGNO (X)], FILE); \
2589 break; \
2590 case 1: \
2591 fputs (qi_name[REGNO (X)], FILE); \
2592 break; \
2593 } \
2594 } while (0)
2595
2596 /* Output the prefix for an immediate operand, or for an offset operand. */
2597 #define PRINT_IMMED_PREFIX(FILE) fputs (IP, (FILE))
2598 #define PRINT_OFFSET_PREFIX(FILE) fputs (IP, (FILE))
2599
2600 /* Routines in libgcc that return floats must return them in an fp reg,
2601 just as other functions do which return such values.
2602 These macros make that happen. */
2603
2604 #define FLOAT_VALUE_TYPE float
2605 #define INTIFY(FLOATVAL) FLOATVAL
2606
2607 /* Nonzero if INSN magically clobbers register REGNO. */
2608
2609 /* #define INSN_CLOBBERS_REGNO_P(INSN, REGNO) \
2610 (FP_REGNO_P (REGNO) \
2611 && (GET_CODE (INSN) == JUMP_INSN || GET_CODE (INSN) == BARRIER))
2612 */
2613
2614 /* a letter which is not needed by the normal asm syntax, which
2615 we can use for operand syntax in the extended asm */
2616
2617 #define ASM_OPERAND_LETTER '#'
2618 #define RET return ""
2619 #define AT_SP(mode) (gen_rtx_MEM ((mode), stack_pointer_rtx))
2620 \f
2621 /* Helper macros to expand a binary/unary operator if needed */
2622 #define IX86_EXPAND_BINARY_OPERATOR(OP, MODE, OPERANDS) \
2623 do { \
2624 if (!ix86_expand_binary_operator (OP, MODE, OPERANDS)) \
2625 FAIL; \
2626 } while (0)
2627
2628 #define IX86_EXPAND_UNARY_OPERATOR(OP, MODE, OPERANDS) \
2629 do { \
2630 if (!ix86_expand_unary_operator (OP, MODE, OPERANDS,)) \
2631 FAIL; \
2632 } while (0)
2633
2634 \f
2635 /* Functions in i386.c */
2636 extern void override_options ();
2637 extern void order_regs_for_local_alloc ();
2638 extern char *output_strlen_unroll ();
2639 extern struct rtx_def *i386_sext16_if_const ();
2640 extern int i386_aligned_p ();
2641 extern int i386_cc_probably_useless_p ();
2642 extern int i386_valid_decl_attribute_p ();
2643 extern int i386_valid_type_attribute_p ();
2644 extern int i386_return_pops_args ();
2645 extern int i386_comp_type_attributes ();
2646 extern void init_cumulative_args ();
2647 extern void function_arg_advance ();
2648 extern struct rtx_def *function_arg ();
2649 extern int function_arg_partial_nregs ();
2650 extern char *output_strlen_unroll ();
2651 extern void output_op_from_reg ();
2652 extern void output_to_reg ();
2653 extern char *singlemove_string ();
2654 extern char *output_move_double ();
2655 extern char *output_move_memory ();
2656 extern char *output_move_pushmem ();
2657 extern int standard_80387_constant_p ();
2658 extern char *output_move_const_single ();
2659 extern int symbolic_operand ();
2660 extern int call_insn_operand ();
2661 extern int expander_call_insn_operand ();
2662 extern int symbolic_reference_mentioned_p ();
2663 extern int ix86_expand_binary_operator ();
2664 extern int ix86_binary_operator_ok ();
2665 extern int ix86_expand_unary_operator ();
2666 extern int ix86_unary_operator_ok ();
2667 extern void emit_pic_move ();
2668 extern void function_prologue ();
2669 extern int simple_386_epilogue ();
2670 extern void function_epilogue ();
2671 extern int legitimate_address_p ();
2672 extern struct rtx_def *legitimize_pic_address ();
2673 extern struct rtx_def *legitimize_address ();
2674 extern void print_operand ();
2675 extern void print_operand_address ();
2676 extern void notice_update_cc ();
2677 extern void split_di ();
2678 extern int binary_387_op ();
2679 extern int shift_op ();
2680 extern int VOIDmode_compare_op ();
2681 extern char *output_387_binary_op ();
2682 extern char *output_fix_trunc ();
2683 extern char *output_float_compare ();
2684 extern char *output_fp_cc0_set ();
2685 extern void save_386_machine_status ();
2686 extern void restore_386_machine_status ();
2687 extern void clear_386_stack_locals ();
2688 extern struct rtx_def *assign_386_stack_local ();
2689 extern int is_mul ();
2690 extern int is_div ();
2691 extern int last_to_set_cc ();
2692 extern int doesnt_set_condition_code ();
2693 extern int sets_condition_code ();
2694 extern int str_immediate_operand ();
2695 extern int is_fp_insn ();
2696 extern int is_fp_dest ();
2697 extern int is_fp_store ();
2698 extern int agi_dependent ();
2699 extern int reg_mentioned_in_mem ();
2700
2701 #ifdef NOTYET
2702 extern struct rtx_def *copy_all_rtx ();
2703 extern void rewrite_address ();
2704 #endif
2705
2706 /* Variables in i386.c */
2707 extern char *ix86_cpu_string; /* for -mcpu=<xxx> */
2708 extern char *ix86_arch_string; /* for -march=<xxx> */
2709 extern char *i386_reg_alloc_order; /* register allocation order */
2710 extern char *i386_regparm_string; /* # registers to use to pass args */
2711 extern char *i386_align_loops_string; /* power of two alignment for loops */
2712 extern char *i386_align_jumps_string; /* power of two alignment for non-loop jumps */
2713 extern char *i386_align_funcs_string; /* power of two alignment for functions */
2714 extern char *i386_branch_cost_string; /* values 1-5: see jump.c */
2715 extern int i386_regparm; /* i386_regparm_string as a number */
2716 extern int i386_align_loops; /* power of two alignment for loops */
2717 extern int i386_align_jumps; /* power of two alignment for non-loop jumps */
2718 extern int i386_align_funcs; /* power of two alignment for functions */
2719 extern int i386_branch_cost; /* values 1-5: see jump.c */
2720 extern char *hi_reg_name[]; /* names for 16 bit regs */
2721 extern char *qi_reg_name[]; /* names for 8 bit regs (low) */
2722 extern char *qi_high_reg_name[]; /* names for 8 bit regs (high) */
2723 extern enum reg_class regclass_map[]; /* smalled class containing REGNO */
2724 extern struct rtx_def *i386_compare_op0; /* operand 0 for comparisons */
2725 extern struct rtx_def *i386_compare_op1; /* operand 1 for comparisons */
2726
2727 /* External variables used */
2728 extern int optimize; /* optimization level */
2729 extern int obey_regdecls; /* TRUE if stupid register allocation */
2730
2731 /* External functions used */
2732 extern struct rtx_def *force_operand ();
2733
2734 \f
2735 /*
2736 Local variables:
2737 version-control: t
2738 End:
2739 */
This page took 0.172905 seconds and 6 git commands to generate.