1 /* Communication between reload.c and reload1.c.
2 Copyright (C) 1987, 1991 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* Add prototype support. */
23 #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
24 #define PROTO(ARGS) ARGS
26 #define PROTO(ARGS) ()
30 /* If secondary reloads are the same for inputs and outputs, define those
33 #ifdef SECONDARY_RELOAD_CLASS
34 #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
35 SECONDARY_RELOAD_CLASS (CLASS, MODE, X)
36 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
37 SECONDARY_RELOAD_CLASS (CLASS, MODE, X)
40 /* If either macro is defined, show that we need secondary reloads. */
41 #if defined(SECONDARY_INPUT_RELOAD_CLASS) || defined(SECONDARY_OUTPUT_RELOAD_CLASS)
42 #define HAVE_SECONDARY_RELOADS
45 /* See reload.c and reload1.c for comments on these variables. */
47 /* Maximum number of reloads we can need. */
48 #define MAX_RELOADS (2 * MAX_RECOG_OPERANDS * (MAX_REGS_PER_ADDRESS + 1))
50 extern rtx reload_in
[MAX_RELOADS
];
51 extern rtx reload_out
[MAX_RELOADS
];
52 extern rtx reload_in_reg
[MAX_RELOADS
];
53 extern enum reg_class reload_reg_class
[MAX_RELOADS
];
54 extern enum machine_mode reload_inmode
[MAX_RELOADS
];
55 extern enum machine_mode reload_outmode
[MAX_RELOADS
];
56 extern char reload_strict_low
[MAX_RELOADS
];
57 extern char reload_optional
[MAX_RELOADS
];
58 extern int reload_inc
[MAX_RELOADS
];
59 extern int reload_needed_for_multiple
[MAX_RELOADS
];
60 extern rtx reload_needed_for
[MAX_RELOADS
];
61 extern int reload_secondary_reload
[MAX_RELOADS
];
62 extern int reload_secondary_p
[MAX_RELOADS
];
64 extern enum insn_code reload_secondary_icode
[MAX_RELOADS
];
68 extern rtx reload_reg_rtx
[MAX_RELOADS
];
70 enum reload_when_needed
72 RELOAD_FOR_INPUT_RELOAD_ADDRESS
,
73 RELOAD_FOR_OUTPUT_RELOAD_ADDRESS
,
74 RELOAD_FOR_OPERAND_ADDRESS
,
75 /* The following two are not fully implemented.
76 They are used in emitting insns, but they aren't distinguished from
77 RELOAD_OTHER when computing the number of spills. What they accomplish
78 is to avoid precluding inheritance of already loaded values
79 for input reloads when there are also output reloads. */
85 extern enum reload_when_needed reload_when_needed
[MAX_RELOADS
];
87 extern rtx
*reg_equiv_constant
;
88 extern rtx
*reg_equiv_memory_loc
;
89 extern rtx
*reg_equiv_address
;
90 extern rtx
*reg_equiv_mem
;
92 /* All the "earlyclobber" operands of the current insn
94 extern int n_earlyclobbers
;
95 extern rtx reload_earlyclobbers
[MAX_RECOG_OPERANDS
];
97 /* First uid used by insns created by reload in this function.
98 Used in find_equiv_reg. */
99 extern int reload_first_uid
;
101 /* Nonzero if indirect addressing is supported when the innermost MEM is
102 of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
103 which these are valid is the same as spill_indirect_levels, above. */
105 extern char indirect_symref_ok
;
107 /* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
108 extern char double_reg_address_ok
;
111 /* These arrays record the insn_code of insns that may be needed to
112 perform input and output reloads of special objects. They provide a
113 place to pass a scratch register. */
114 extern enum insn_code reload_in_optab
[];
115 extern enum insn_code reload_out_optab
[];
118 extern void init_reload
PROTO((void));
119 extern void find_reloads
PROTO((rtx
, int, int, int, short *));
120 extern void subst_reloads
PROTO((void));
121 extern rtx get_secondary_mem
PROTO((rtx
, enum machine_mode
));
122 extern rtx eliminate_regs
PROTO((rtx
, enum machine_mode
, rtx
));
123 extern rtx gen_input_reload
PROTO((rtx
, rtx
, rtx
));
124 extern rtx find_replacement
PROTO((rtx
*));