]>
Commit | Line | Data |
---|---|---|
e8bbfc4e | 1 | /* Definitions for code generation pass of GNU compiler. |
ad83f537 | 2 | Copyright (C) 1987, 91-98, 1999 Free Software Foundation, Inc. |
e8bbfc4e RK |
3 | |
4 | This file is part of GNU CC. | |
5 | ||
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) | |
9 | any later version. | |
10 | ||
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. | |
15 | ||
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 | |
940d9d63 RK |
18 | the Free Software Foundation, 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. */ | |
e8bbfc4e | 20 | |
e8bbfc4e RK |
21 | /* The default branch cost is 1. */ |
22 | #ifndef BRANCH_COST | |
23 | #define BRANCH_COST 1 | |
24 | #endif | |
25 | ||
26 | /* Macros to access the slots of a QUEUED rtx. | |
27 | Here rather than in rtl.h because only the expansion pass | |
28 | should ever encounter a QUEUED. */ | |
29 | ||
30 | /* The variable for which an increment is queued. */ | |
31 | #define QUEUED_VAR(P) XEXP (P, 0) | |
32 | /* If the increment has been emitted, this is the insn | |
41b083c4 R |
33 | that does the increment. It is zero before the increment is emitted. |
34 | If more than one insn is emitted, this is the first insn. */ | |
e8bbfc4e RK |
35 | #define QUEUED_INSN(P) XEXP (P, 1) |
36 | /* If a pre-increment copy has been generated, this is the copy | |
37 | (it is a temporary reg). Zero if no copy made yet. */ | |
38 | #define QUEUED_COPY(P) XEXP (P, 2) | |
39 | /* This is the body to use for the insn to do the increment. | |
40 | It is used to emit the increment. */ | |
41 | #define QUEUED_BODY(P) XEXP (P, 3) | |
42 | /* Next QUEUED in the queue. */ | |
43 | #define QUEUED_NEXT(P) XEXP (P, 4) | |
44 | ||
45 | /* This is the 4th arg to `expand_expr'. | |
46 | EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx. | |
47 | EXPAND_INITIALIZER is similar but also record any labels on forced_labels. | |
48 | EXPAND_CONST_ADDRESS means it is ok to return a MEM whose address | |
99b5da08 RK |
49 | is a constant that is not a legitimate address. |
50 | EXPAND_MEMORY_USE_* are explained below. */ | |
e8bbfc4e | 51 | enum expand_modifier {EXPAND_NORMAL, EXPAND_SUM, |
99b5da08 RK |
52 | EXPAND_CONST_ADDRESS, EXPAND_INITIALIZER, |
53 | EXPAND_MEMORY_USE_WO, EXPAND_MEMORY_USE_RW, | |
54 | EXPAND_MEMORY_USE_BAD, EXPAND_MEMORY_USE_DONT}; | |
55 | ||
56 | /* Argument for chkr_* functions. | |
57 | MEMORY_USE_RO: the pointer reads memory. | |
58 | MEMORY_USE_WO: the pointer writes to memory. | |
59 | MEMORY_USE_RW: the pointer modifies memory (ie it reads and writes). An | |
60 | example is (*ptr)++ | |
61 | MEMORY_USE_BAD: use this if you don't know the behavior of the pointer, or | |
62 | if you know there are no pointers. Using an INDIRECT_REF | |
63 | with MEMORY_USE_BAD will abort. | |
64 | MEMORY_USE_TW: just test for writing, without update. Special. | |
65 | MEMORY_USE_DONT: the memory is neither read nor written. This is used by | |
66 | '->' and '.'. */ | |
67 | enum memory_use_mode {MEMORY_USE_BAD = 0, MEMORY_USE_RO = 1, | |
68 | MEMORY_USE_WO = 2, MEMORY_USE_RW = 3, | |
69 | MEMORY_USE_TW = 6, MEMORY_USE_DONT = 99}; | |
e8bbfc4e | 70 | |
5c7a310f MM |
71 | /* Prevent the compiler from deferring stack pops. See |
72 | inhibit_defer_pop for more information. */ | |
73 | #define NO_DEFER_POP (inhibit_defer_pop += 1) | |
74 | ||
75 | /* Allow the compiler to defer stack pops. See inhibit_defer_pop for | |
76 | more information. */ | |
77 | #define OK_DEFER_POP (inhibit_defer_pop -= 1) | |
e8bbfc4e RK |
78 | \f |
79 | #ifdef TREE_CODE /* Don't lose if tree.h not included. */ | |
80 | /* Structure to record the size of a sequence of arguments | |
81 | as the sum of a tree-expression and a constant. */ | |
82 | ||
83 | struct args_size | |
84 | { | |
e5e809f4 | 85 | HOST_WIDE_INT constant; |
e8bbfc4e RK |
86 | tree var; |
87 | }; | |
88 | #endif | |
89 | ||
90 | /* Add the value of the tree INC to the `struct args_size' TO. */ | |
91 | ||
92 | #define ADD_PARM_SIZE(TO, INC) \ | |
93 | { tree inc = (INC); \ | |
94 | if (TREE_CODE (inc) == INTEGER_CST) \ | |
95 | (TO).constant += TREE_INT_CST_LOW (inc); \ | |
96 | else if ((TO).var == 0) \ | |
97 | (TO).var = inc; \ | |
98 | else \ | |
99 | (TO).var = size_binop (PLUS_EXPR, (TO).var, inc); } | |
100 | ||
101 | #define SUB_PARM_SIZE(TO, DEC) \ | |
102 | { tree dec = (DEC); \ | |
103 | if (TREE_CODE (dec) == INTEGER_CST) \ | |
104 | (TO).constant -= TREE_INT_CST_LOW (dec); \ | |
105 | else if ((TO).var == 0) \ | |
106 | (TO).var = size_binop (MINUS_EXPR, integer_zero_node, dec); \ | |
107 | else \ | |
108 | (TO).var = size_binop (MINUS_EXPR, (TO).var, dec); } | |
109 | ||
110 | /* Convert the implicit sum in a `struct args_size' into an rtx. */ | |
111 | #define ARGS_SIZE_RTX(SIZE) \ | |
3245eea0 | 112 | ((SIZE).var == 0 ? GEN_INT ((SIZE).constant) \ |
e8bbfc4e RK |
113 | : expand_expr (size_binop (PLUS_EXPR, (SIZE).var, \ |
114 | size_int ((SIZE).constant)), \ | |
99b5da08 | 115 | NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_BAD)) |
e8bbfc4e RK |
116 | |
117 | /* Convert the implicit sum in a `struct args_size' into a tree. */ | |
118 | #define ARGS_SIZE_TREE(SIZE) \ | |
119 | ((SIZE).var == 0 ? size_int ((SIZE).constant) \ | |
120 | : size_binop (PLUS_EXPR, (SIZE).var, size_int ((SIZE).constant))) | |
121 | ||
122 | /* Supply a default definition for FUNCTION_ARG_PADDING: | |
355b2097 | 123 | usually pad upward, but pad short args downward on |
e8bbfc4e RK |
124 | big-endian machines. */ |
125 | ||
126 | enum direction {none, upward, downward}; /* Value has this type. */ | |
127 | ||
128 | #ifndef FUNCTION_ARG_PADDING | |
e8bbfc4e | 129 | #define FUNCTION_ARG_PADDING(MODE, TYPE) \ |
f76b9db2 ILT |
130 | (! BYTES_BIG_ENDIAN \ |
131 | ? upward \ | |
132 | : (((MODE) == BLKmode \ | |
133 | ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ | |
134 | && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \ | |
135 | : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ | |
136 | ? downward : upward)) | |
e8bbfc4e RK |
137 | #endif |
138 | ||
139 | /* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let | |
140 | FUNCTION_ARG_PADDING, which also pads the length, handle any needed | |
141 | alignment. */ | |
142 | ||
143 | #ifndef FUNCTION_ARG_BOUNDARY | |
144 | #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) PARM_BOUNDARY | |
145 | #endif | |
146 | ||
e5e809f4 JL |
147 | /* Provide a default value for STRICT_ARGUMENT_NAMING. */ |
148 | #ifndef STRICT_ARGUMENT_NAMING | |
149 | #define STRICT_ARGUMENT_NAMING 0 | |
150 | #endif | |
151 | ||
9ab70a9b R |
152 | /* Provide a default value for PRETEND_OUTGOING_VARARGS_NAMED. */ |
153 | #ifdef SETUP_INCOMING_VARARGS | |
154 | #ifndef PRETEND_OUTGOING_VARARGS_NAMED | |
155 | #define PRETEND_OUTGOING_VARARGS_NAMED 1 | |
156 | #endif | |
157 | #else | |
158 | /* It is an error to define PRETEND_OUTGOING_VARARGS_NAMED without | |
159 | defining SETUP_INCOMING_VARARGS. */ | |
160 | #define PRETEND_OUTGOING_VARARGS_NAMED 0 | |
161 | #endif | |
162 | ||
e8bbfc4e RK |
163 | /* Nonzero if we do not know how to pass TYPE solely in registers. |
164 | We cannot do so in the following cases: | |
165 | ||
166 | - if the type has variable size | |
167 | - if the type is marked as addressable (it is required to be constructed | |
168 | into the stack) | |
169 | - if the padding and mode of the type is such that a copy into a register | |
e7cf2d7e RK |
170 | would put it into the wrong part of the register. |
171 | ||
14a8d078 | 172 | Which padding can't be supported depends on the byte endianness. |
e8bbfc4e | 173 | |
e7cf2d7e | 174 | A value in a register is implicitly padded at the most significant end. |
e8bbfc4e RK |
175 | On a big-endian machine, that is the lower end in memory. |
176 | So a value padded in memory at the upper end can't go in a register. | |
177 | For a little-endian machine, the reverse is true. */ | |
178 | ||
d9a4ee00 | 179 | #ifndef MUST_PASS_IN_STACK |
e8bbfc4e RK |
180 | #define MUST_PASS_IN_STACK(MODE,TYPE) \ |
181 | ((TYPE) != 0 \ | |
182 | && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ | |
183 | || TREE_ADDRESSABLE (TYPE) \ | |
184 | || ((MODE) == BLKmode \ | |
6fb713ce RK |
185 | && ! ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ |
186 | && 0 == (int_size_in_bytes (TYPE) \ | |
187 | % (PARM_BOUNDARY / BITS_PER_UNIT))) \ | |
e8bbfc4e | 188 | && (FUNCTION_ARG_PADDING (MODE, TYPE) \ |
f76b9db2 | 189 | == (BYTES_BIG_ENDIAN ? upward : downward))))) |
d9a4ee00 | 190 | #endif |
e8bbfc4e | 191 | |
e14fa9c4 | 192 | /* Nonzero if type TYPE should be returned in memory. |
e8bbfc4e RK |
193 | Most machines can use the following default definition. */ |
194 | ||
195 | #ifndef RETURN_IN_MEMORY | |
e14fa9c4 | 196 | #define RETURN_IN_MEMORY(TYPE) (TYPE_MODE (TYPE) == BLKmode) |
e8bbfc4e | 197 | #endif |
f7761c9a | 198 | |
a260abc9 DE |
199 | /* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save. |
200 | Normally move_insn, so Pmode stack pointer. */ | |
201 | ||
202 | #ifndef STACK_SAVEAREA_MODE | |
203 | #define STACK_SAVEAREA_MODE(LEVEL) Pmode | |
204 | #endif | |
205 | ||
39403d82 DE |
206 | /* Supply a default definition of STACK_SIZE_MODE for |
207 | allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */ | |
208 | ||
209 | #ifndef STACK_SIZE_MODE | |
210 | #define STACK_SIZE_MODE word_mode | |
211 | #endif | |
212 | ||
f7761c9a RK |
213 | /* Provide default values for the macros controlling stack checking. */ |
214 | ||
215 | #ifndef STACK_CHECK_BUILTIN | |
216 | #define STACK_CHECK_BUILTIN 0 | |
217 | #endif | |
218 | ||
219 | /* The default interval is one page. */ | |
220 | #ifndef STACK_CHECK_PROBE_INTERVAL | |
221 | #define STACK_CHECK_PROBE_INTERVAL 4096 | |
222 | #endif | |
223 | ||
224 | /* The default is to do a store into the stack. */ | |
225 | #ifndef STACK_CHECK_PROBE_LOAD | |
226 | #define STACK_CHECK_PROBE_LOAD 0 | |
227 | #endif | |
228 | ||
229 | /* This value is arbitrary, but should be sufficient for most machines. */ | |
230 | #ifndef STACK_CHECK_PROTECT | |
231 | #define STACK_CHECK_PROTECT (75 * UNITS_PER_WORD) | |
232 | #endif | |
233 | ||
234 | /* Make the maximum frame size be the largest we can and still only need | |
235 | one probe per function. */ | |
236 | #ifndef STACK_CHECK_MAX_FRAME_SIZE | |
237 | #define STACK_CHECK_MAX_FRAME_SIZE \ | |
238 | (STACK_CHECK_PROBE_INTERVAL - UNITS_PER_WORD) | |
239 | #endif | |
240 | ||
241 | /* This is arbitrary, but should be large enough everywhere. */ | |
242 | #ifndef STACK_CHECK_FIXED_FRAME_SIZE | |
243 | #define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD) | |
244 | #endif | |
245 | ||
246 | /* Provide a reasonable default for the maximum size of an object to | |
247 | allocate in the fixed frame. We may need to be able to make this | |
248 | controllable by the user at some point. */ | |
249 | #ifndef STACK_CHECK_MAX_VAR_SIZE | |
250 | #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100) | |
251 | #endif | |
e8bbfc4e RK |
252 | \f |
253 | /* Optabs are tables saying how to generate insn bodies | |
254 | for various machine modes and numbers of operands. | |
255 | Each optab applies to one operation. | |
256 | For example, add_optab applies to addition. | |
257 | ||
258 | The insn_code slot is the enum insn_code that says how to | |
259 | generate an insn for this operation on a particular machine mode. | |
260 | It is CODE_FOR_nothing if there is no such insn on the target machine. | |
261 | ||
262 | The `lib_call' slot is the name of the library function that | |
263 | can be used to perform the operation. | |
264 | ||
265 | A few optabs, such as move_optab and cmp_optab, are used | |
266 | by special code. */ | |
267 | ||
268 | /* Everything that uses expr.h needs to define enum insn_code | |
269 | but we don't list it in the Makefile dependencies just for that. */ | |
270 | #include "insn-codes.h" | |
271 | ||
272 | typedef struct optab | |
273 | { | |
274 | enum rtx_code code; | |
275 | struct { | |
276 | enum insn_code insn_code; | |
277 | rtx libfunc; | |
278 | } handlers [NUM_MACHINE_MODES]; | |
279 | } * optab; | |
280 | ||
281 | /* Given an enum insn_code, access the function to construct | |
282 | the body of that kind of insn. */ | |
283 | #ifdef FUNCTION_CONVERSION_BUG | |
284 | /* Some compilers fail to convert a function properly to a | |
285 | pointer-to-function when used as an argument. | |
286 | So produce the pointer-to-function directly. | |
287 | Luckily, these compilers seem to work properly when you | |
288 | call the pointer-to-function. */ | |
289 | #define GEN_FCN(CODE) (insn_gen_function[(int) (CODE)]) | |
290 | #else | |
291 | #define GEN_FCN(CODE) (*insn_gen_function[(int) (CODE)]) | |
292 | #endif | |
293 | ||
eae4b970 | 294 | extern rtx (*const insn_gen_function[]) PROTO ((rtx, ...)); |
e8bbfc4e | 295 | |
34220a12 BS |
296 | /* Enumeration of valid indexes into optab_table. */ |
297 | enum optab_index | |
298 | { | |
299 | OTI_add, | |
300 | OTI_sub, | |
301 | ||
302 | /* Signed and fp multiply */ | |
303 | OTI_smul, | |
304 | /* Signed multiply, return high word */ | |
305 | OTI_smul_highpart, | |
306 | OTI_umul_highpart, | |
307 | /* Signed multiply with result one machine mode wider than args */ | |
308 | OTI_smul_widen, | |
309 | OTI_umul_widen, | |
310 | ||
311 | /* Signed divide */ | |
312 | OTI_sdiv, | |
313 | /* Signed divide-and-remainder in one */ | |
314 | OTI_sdivmod, | |
315 | OTI_udiv, | |
316 | OTI_udivmod, | |
317 | /* Signed remainder */ | |
318 | OTI_smod, | |
319 | OTI_umod, | |
320 | /* Optab for floating divide. */ | |
321 | OTI_flodiv, | |
322 | /* Convert float to integer in float fmt */ | |
323 | OTI_ftrunc, | |
324 | ||
325 | /* Logical and */ | |
326 | OTI_and, | |
327 | /* Logical or */ | |
328 | OTI_ior, | |
329 | /* Logical xor */ | |
330 | OTI_xor, | |
331 | ||
332 | /* Arithmetic shift left */ | |
333 | OTI_ashl, | |
334 | /* Logical shift right */ | |
335 | OTI_lshr, | |
336 | /* Arithmetic shift right */ | |
337 | OTI_ashr, | |
338 | /* Rotate left */ | |
339 | OTI_rotl, | |
340 | /* Rotate right */ | |
341 | OTI_rotr, | |
342 | /* Signed and floating-point minimum value */ | |
343 | OTI_smin, | |
344 | /* Signed and floating-point maximum value */ | |
345 | OTI_smax, | |
346 | /* Unsigned minimum value */ | |
347 | OTI_umin, | |
348 | /* Unsigned maximum value */ | |
349 | OTI_umax, | |
350 | ||
351 | /* Move instruction. */ | |
352 | OTI_mov, | |
353 | /* Move, preserving high part of register. */ | |
354 | OTI_movstrict, | |
355 | ||
356 | /* Unary operations */ | |
357 | /* Negation */ | |
358 | OTI_neg, | |
359 | /* Abs value */ | |
360 | OTI_abs, | |
361 | /* Bitwise not */ | |
362 | OTI_one_cmpl, | |
363 | /* Find first bit set */ | |
364 | OTI_ffs, | |
365 | /* Square root */ | |
366 | OTI_sqrt, | |
367 | /* Sine */ | |
368 | OTI_sin, | |
369 | /* Cosine */ | |
370 | OTI_cos, | |
371 | ||
372 | /* Compare insn; two operands. */ | |
373 | OTI_cmp, | |
374 | /* Used only for libcalls for unsigned comparisons. */ | |
375 | OTI_ucmp, | |
376 | /* tst insn; compare one operand against 0 */ | |
377 | OTI_tst, | |
378 | ||
379 | /* String length */ | |
380 | OTI_strlen, | |
381 | ||
382 | OTI_MAX | |
383 | }; | |
384 | ||
385 | extern optab optab_table[OTI_MAX]; | |
386 | ||
387 | #define add_optab (optab_table[OTI_add]) | |
388 | #define sub_optab (optab_table[OTI_sub]) | |
389 | #define smul_optab (optab_table[OTI_smul]) | |
390 | #define smul_highpart_optab (optab_table[OTI_smul_highpart]) | |
391 | #define umul_highpart_optab (optab_table[OTI_umul_highpart]) | |
392 | #define smul_widen_optab (optab_table[OTI_smul_widen]) | |
393 | #define umul_widen_optab (optab_table[OTI_umul_widen]) | |
394 | #define sdiv_optab (optab_table[OTI_sdiv]) | |
395 | #define sdivmod_optab (optab_table[OTI_sdivmod]) | |
396 | #define udiv_optab (optab_table[OTI_udiv]) | |
397 | #define udivmod_optab (optab_table[OTI_udivmod]) | |
398 | #define smod_optab (optab_table[OTI_smod]) | |
399 | #define umod_optab (optab_table[OTI_umod]) | |
400 | #define flodiv_optab (optab_table[OTI_flodiv]) | |
401 | #define ftrunc_optab (optab_table[OTI_ftrunc]) | |
402 | #define and_optab (optab_table[OTI_and]) | |
403 | #define ior_optab (optab_table[OTI_ior]) | |
404 | #define xor_optab (optab_table[OTI_xor]) | |
405 | #define ashl_optab (optab_table[OTI_ashl]) | |
406 | #define lshr_optab (optab_table[OTI_lshr]) | |
407 | #define ashr_optab (optab_table[OTI_ashr]) | |
408 | #define rotl_optab (optab_table[OTI_rotl]) | |
409 | #define rotr_optab (optab_table[OTI_rotr]) | |
410 | #define smin_optab (optab_table[OTI_smin]) | |
411 | #define smax_optab (optab_table[OTI_smax]) | |
412 | #define umin_optab (optab_table[OTI_umin]) | |
413 | #define umax_optab (optab_table[OTI_umax]) | |
414 | ||
415 | #define mov_optab (optab_table[OTI_mov]) | |
416 | #define movstrict_optab (optab_table[OTI_movstrict]) | |
417 | ||
418 | #define neg_optab (optab_table[OTI_neg]) | |
419 | #define abs_optab (optab_table[OTI_abs]) | |
420 | #define one_cmpl_optab (optab_table[OTI_one_cmpl]) | |
421 | #define ffs_optab (optab_table[OTI_ffs]) | |
422 | #define sqrt_optab (optab_table[OTI_sqrt]) | |
423 | #define sin_optab (optab_table[OTI_sin]) | |
424 | #define cos_optab (optab_table[OTI_cos]) | |
425 | ||
426 | #define cmp_optab (optab_table[OTI_cmp]) | |
427 | #define ucmp_optab (optab_table[OTI_ucmp]) | |
428 | #define tst_optab (optab_table[OTI_tst]) | |
429 | ||
430 | #define strlen_optab (optab_table[OTI_strlen]) | |
e8bbfc4e | 431 | |
27b3f754 RK |
432 | /* Tables of patterns for extending one integer mode to another. */ |
433 | extern enum insn_code extendtab[MAX_MACHINE_MODE][MAX_MACHINE_MODE][2]; | |
434 | ||
435 | /* Tables of patterns for converting between fixed and floating point. */ | |
436 | extern enum insn_code fixtab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2]; | |
437 | extern enum insn_code fixtrunctab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2]; | |
438 | extern enum insn_code floattab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2]; | |
439 | ||
9c951f80 RK |
440 | /* Contains the optab used for each rtx code. */ |
441 | extern optab code_to_optab[NUM_RTX_CODE + 1]; | |
442 | ||
e8bbfc4e RK |
443 | /* Passed to expand_binop and expand_unop to say which options to try to use |
444 | if the requested operation can't be open-coded on the requisite mode. | |
445 | Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using a library call. | |
446 | Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try using a wider mode. | |
447 | OPTAB_MUST_WIDEN says try widening and don't try anything else. */ | |
448 | ||
449 | enum optab_methods | |
450 | { | |
451 | OPTAB_DIRECT, | |
452 | OPTAB_LIB, | |
453 | OPTAB_WIDEN, | |
454 | OPTAB_LIB_WIDEN, | |
455 | OPTAB_MUST_WIDEN | |
456 | }; | |
457 | ||
34220a12 BS |
458 | /* Enumeration of indexes into libfunc_table. */ |
459 | enum libfunc_index | |
460 | { | |
461 | LTI_extendsfdf2, | |
462 | LTI_extendsfxf2, | |
463 | LTI_extendsftf2, | |
464 | LTI_extenddfxf2, | |
465 | LTI_extenddftf2, | |
466 | ||
467 | LTI_truncdfsf2, | |
468 | LTI_truncxfsf2, | |
469 | LTI_trunctfsf2, | |
470 | LTI_truncxfdf2, | |
471 | LTI_trunctfdf2, | |
472 | ||
473 | LTI_memcpy, | |
474 | LTI_bcopy, | |
475 | LTI_memcmp, | |
476 | LTI_bcmp, | |
477 | LTI_memset, | |
478 | LTI_bzero, | |
479 | ||
480 | LTI_throw, | |
481 | LTI_rethrow, | |
482 | LTI_sjthrow, | |
483 | LTI_sjpopnthrow, | |
484 | LTI_terminate, | |
485 | LTI_setjmp, | |
486 | LTI_longjmp, | |
487 | LTI_eh_rtime_match, | |
488 | ||
489 | LTI_eqhf2, | |
490 | LTI_nehf2, | |
491 | LTI_gthf2, | |
492 | LTI_gehf2, | |
493 | LTI_lthf2, | |
494 | LTI_lehf2, | |
495 | ||
496 | LTI_eqsf2, | |
497 | LTI_nesf2, | |
498 | LTI_gtsf2, | |
499 | LTI_gesf2, | |
500 | LTI_ltsf2, | |
501 | LTI_lesf2, | |
502 | ||
503 | LTI_eqdf2, | |
504 | LTI_nedf2, | |
505 | LTI_gtdf2, | |
506 | LTI_gedf2, | |
507 | LTI_ltdf2, | |
508 | LTI_ledf2, | |
509 | ||
510 | LTI_eqxf2, | |
511 | LTI_nexf2, | |
512 | LTI_gtxf2, | |
513 | LTI_gexf2, | |
514 | LTI_ltxf2, | |
515 | LTI_lexf2, | |
516 | ||
517 | LTI_eqtf2, | |
518 | LTI_netf2, | |
519 | LTI_gttf2, | |
520 | LTI_getf2, | |
521 | LTI_lttf2, | |
522 | LTI_letf2, | |
523 | ||
524 | LTI_floatsisf, | |
525 | LTI_floatdisf, | |
526 | LTI_floattisf, | |
527 | ||
528 | LTI_floatsidf, | |
529 | LTI_floatdidf, | |
530 | LTI_floattidf, | |
531 | ||
532 | LTI_floatsixf, | |
533 | LTI_floatdixf, | |
534 | LTI_floattixf, | |
535 | ||
536 | LTI_floatsitf, | |
537 | LTI_floatditf, | |
538 | LTI_floattitf, | |
539 | ||
540 | LTI_fixsfsi, | |
541 | LTI_fixsfdi, | |
542 | LTI_fixsfti, | |
543 | ||
544 | LTI_fixdfsi, | |
545 | LTI_fixdfdi, | |
546 | LTI_fixdfti, | |
547 | ||
548 | LTI_fixxfsi, | |
549 | LTI_fixxfdi, | |
550 | LTI_fixxfti, | |
551 | ||
552 | LTI_fixtfsi, | |
553 | LTI_fixtfdi, | |
554 | LTI_fixtfti, | |
555 | ||
556 | LTI_fixunssfsi, | |
557 | LTI_fixunssfdi, | |
558 | LTI_fixunssfti, | |
559 | ||
560 | LTI_fixunsdfsi, | |
561 | LTI_fixunsdfdi, | |
562 | LTI_fixunsdfti, | |
563 | ||
564 | LTI_fixunsxfsi, | |
565 | LTI_fixunsxfdi, | |
566 | LTI_fixunsxfti, | |
567 | ||
568 | LTI_fixunstfsi, | |
569 | LTI_fixunstfdi, | |
570 | LTI_fixunstfti, | |
571 | ||
572 | LTI_chkr_check_addr, | |
573 | LTI_chkr_set_right, | |
574 | LTI_chkr_copy_bitmap, | |
575 | LTI_chkr_check_exec, | |
576 | LTI_chkr_check_str, | |
577 | ||
578 | LTI_profile_function_entry, | |
579 | LTI_profile_function_exit, | |
580 | ||
581 | LTI_MAX | |
582 | }; | |
583 | ||
e8bbfc4e RK |
584 | /* SYMBOL_REF rtx's for the library functions that are called |
585 | implicitly and not via optabs. */ | |
34220a12 BS |
586 | extern rtx libfunc_table[LTI_MAX]; |
587 | ||
588 | /* Accessor macros for libfunc_table. */ | |
589 | #define extendsfdf2_libfunc (libfunc_table[LTI_extendsfdf2]) | |
590 | #define extendsfxf2_libfunc (libfunc_table[LTI_extendsfxf2]) | |
591 | #define extendsftf2_libfunc (libfunc_table[LTI_extendsftf2]) | |
592 | #define extenddfxf2_libfunc (libfunc_table[LTI_extenddfxf2]) | |
593 | #define extenddftf2_libfunc (libfunc_table[LTI_extenddftf2]) | |
594 | ||
595 | #define truncdfsf2_libfunc (libfunc_table[LTI_truncdfsf2]) | |
596 | #define truncxfsf2_libfunc (libfunc_table[LTI_truncxfsf2]) | |
597 | #define trunctfsf2_libfunc (libfunc_table[LTI_trunctfsf2]) | |
598 | #define truncxfdf2_libfunc (libfunc_table[LTI_truncxfdf2]) | |
599 | #define trunctfdf2_libfunc (libfunc_table[LTI_trunctfdf2]) | |
600 | ||
601 | #define memcpy_libfunc (libfunc_table[LTI_memcpy]) | |
602 | #define bcopy_libfunc (libfunc_table[LTI_bcopy]) | |
603 | #define memcmp_libfunc (libfunc_table[LTI_memcmp]) | |
604 | #define bcmp_libfunc (libfunc_table[LTI_bcmp]) | |
605 | #define memset_libfunc (libfunc_table[LTI_memset]) | |
606 | #define bzero_libfunc (libfunc_table[LTI_bzero]) | |
607 | ||
608 | #define throw_libfunc (libfunc_table[LTI_throw]) | |
609 | #define rethrow_libfunc (libfunc_table[LTI_rethrow]) | |
610 | #define sjthrow_libfunc (libfunc_table[LTI_sjthrow]) | |
611 | #define sjpopnthrow_libfunc (libfunc_table[LTI_sjpopnthrow]) | |
612 | #define terminate_libfunc (libfunc_table[LTI_terminate]) | |
613 | #define setjmp_libfunc (libfunc_table[LTI_setjmp]) | |
614 | #define longjmp_libfunc (libfunc_table[LTI_longjmp]) | |
615 | #define eh_rtime_match_libfunc (libfunc_table[LTI_eh_rtime_match]) | |
616 | ||
617 | #define eqhf2_libfunc (libfunc_table[LTI_eqhf2]) | |
618 | #define nehf2_libfunc (libfunc_table[LTI_nehf2]) | |
619 | #define gthf2_libfunc (libfunc_table[LTI_gthf2]) | |
620 | #define gehf2_libfunc (libfunc_table[LTI_gehf2]) | |
621 | #define lthf2_libfunc (libfunc_table[LTI_lthf2]) | |
622 | #define lehf2_libfunc (libfunc_table[LTI_lehf2]) | |
623 | ||
624 | #define eqsf2_libfunc (libfunc_table[LTI_eqsf2]) | |
625 | #define nesf2_libfunc (libfunc_table[LTI_nesf2]) | |
626 | #define gtsf2_libfunc (libfunc_table[LTI_gtsf2]) | |
627 | #define gesf2_libfunc (libfunc_table[LTI_gesf2]) | |
628 | #define ltsf2_libfunc (libfunc_table[LTI_ltsf2]) | |
629 | #define lesf2_libfunc (libfunc_table[LTI_lesf2]) | |
630 | ||
631 | #define eqdf2_libfunc (libfunc_table[LTI_eqdf2]) | |
632 | #define nedf2_libfunc (libfunc_table[LTI_nedf2]) | |
633 | #define gtdf2_libfunc (libfunc_table[LTI_gtdf2]) | |
634 | #define gedf2_libfunc (libfunc_table[LTI_gedf2]) | |
635 | #define ltdf2_libfunc (libfunc_table[LTI_ltdf2]) | |
636 | #define ledf2_libfunc (libfunc_table[LTI_ledf2]) | |
637 | ||
638 | #define eqxf2_libfunc (libfunc_table[LTI_eqxf2]) | |
639 | #define nexf2_libfunc (libfunc_table[LTI_nexf2]) | |
640 | #define gtxf2_libfunc (libfunc_table[LTI_gtxf2]) | |
641 | #define gexf2_libfunc (libfunc_table[LTI_gexf2]) | |
642 | #define ltxf2_libfunc (libfunc_table[LTI_ltxf2]) | |
643 | #define lexf2_libfunc (libfunc_table[LTI_lexf2]) | |
644 | ||
645 | #define eqtf2_libfunc (libfunc_table[LTI_eqtf2]) | |
646 | #define netf2_libfunc (libfunc_table[LTI_netf2]) | |
647 | #define gttf2_libfunc (libfunc_table[LTI_gttf2]) | |
648 | #define getf2_libfunc (libfunc_table[LTI_getf2]) | |
649 | #define lttf2_libfunc (libfunc_table[LTI_lttf2]) | |
650 | #define letf2_libfunc (libfunc_table[LTI_letf2]) | |
651 | ||
652 | #define floatsisf_libfunc (libfunc_table[LTI_floatsisf]) | |
653 | #define floatdisf_libfunc (libfunc_table[LTI_floatdisf]) | |
654 | #define floattisf_libfunc (libfunc_table[LTI_floattisf]) | |
655 | ||
656 | #define floatsidf_libfunc (libfunc_table[LTI_floatsidf]) | |
657 | #define floatdidf_libfunc (libfunc_table[LTI_floatdidf]) | |
658 | #define floattidf_libfunc (libfunc_table[LTI_floattidf]) | |
659 | ||
660 | #define floatsixf_libfunc (libfunc_table[LTI_floatsixf]) | |
661 | #define floatdixf_libfunc (libfunc_table[LTI_floatdixf]) | |
662 | #define floattixf_libfunc (libfunc_table[LTI_floattixf]) | |
663 | ||
664 | #define floatsitf_libfunc (libfunc_table[LTI_floatsitf]) | |
665 | #define floatditf_libfunc (libfunc_table[LTI_floatditf]) | |
666 | #define floattitf_libfunc (libfunc_table[LTI_floattitf]) | |
667 | ||
668 | #define fixsfsi_libfunc (libfunc_table[LTI_fixsfsi]) | |
669 | #define fixsfdi_libfunc (libfunc_table[LTI_fixsfdi]) | |
670 | #define fixsfti_libfunc (libfunc_table[LTI_fixsfti]) | |
671 | ||
672 | #define fixdfsi_libfunc (libfunc_table[LTI_fixdfsi]) | |
673 | #define fixdfdi_libfunc (libfunc_table[LTI_fixdfdi]) | |
674 | #define fixdfti_libfunc (libfunc_table[LTI_fixdfti]) | |
675 | ||
676 | #define fixxfsi_libfunc (libfunc_table[LTI_fixxfsi]) | |
677 | #define fixxfdi_libfunc (libfunc_table[LTI_fixxfdi]) | |
678 | #define fixxfti_libfunc (libfunc_table[LTI_fixxfti]) | |
679 | ||
680 | #define fixtfsi_libfunc (libfunc_table[LTI_fixtfsi]) | |
681 | #define fixtfdi_libfunc (libfunc_table[LTI_fixtfdi]) | |
682 | #define fixtfti_libfunc (libfunc_table[LTI_fixtfti]) | |
683 | ||
684 | #define fixunssfsi_libfunc (libfunc_table[LTI_fixunssfsi]) | |
685 | #define fixunssfdi_libfunc (libfunc_table[LTI_fixunssfdi]) | |
686 | #define fixunssfti_libfunc (libfunc_table[LTI_fixunssfti]) | |
687 | ||
688 | #define fixunsdfsi_libfunc (libfunc_table[LTI_fixunsdfsi]) | |
689 | #define fixunsdfdi_libfunc (libfunc_table[LTI_fixunsdfdi]) | |
690 | #define fixunsdfti_libfunc (libfunc_table[LTI_fixunsdfti]) | |
691 | ||
692 | #define fixunsxfsi_libfunc (libfunc_table[LTI_fixunsxfsi]) | |
693 | #define fixunsxfdi_libfunc (libfunc_table[LTI_fixunsxfdi]) | |
694 | #define fixunsxfti_libfunc (libfunc_table[LTI_fixunsxfti]) | |
695 | ||
696 | #define fixunstfsi_libfunc (libfunc_table[LTI_fixunstfsi]) | |
697 | #define fixunstfdi_libfunc (libfunc_table[LTI_fixunstfdi]) | |
698 | #define fixunstfti_libfunc (libfunc_table[LTI_fixunstfti]) | |
699 | ||
700 | #define chkr_check_addr_libfunc (libfunc_table[LTI_chkr_check_addr]) | |
701 | #define chkr_set_right_libfunc (libfunc_table[LTI_chkr_set_right]) | |
702 | #define chkr_copy_bitmap_libfunc (libfunc_table[LTI_chkr_copy_bitmap]) | |
703 | #define chkr_check_exec_libfunc (libfunc_table[LTI_chkr_check_exec]) | |
704 | #define chkr_check_str_libfunc (libfunc_table[LTI_chkr_check_str]) | |
705 | ||
706 | #define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry]) | |
707 | #define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit]) | |
e8bbfc4e | 708 | \f |
e9576d2c | 709 | typedef rtx (*rtxfun) PROTO ((rtx)); |
e8bbfc4e RK |
710 | |
711 | /* Indexed by the rtx-code for a conditional (eg. EQ, LT,...) | |
712 | gives the gen_function to make a branch to test that condition. */ | |
713 | ||
714 | extern rtxfun bcc_gen_fctn[NUM_RTX_CODE]; | |
715 | ||
716 | /* Indexed by the rtx-code for a conditional (eg. EQ, LT,...) | |
717 | gives the insn code to make a store-condition insn | |
718 | to test that condition. */ | |
719 | ||
720 | extern enum insn_code setcc_gen_code[NUM_RTX_CODE]; | |
721 | ||
423933c2 | 722 | #ifdef HAVE_conditional_move |
38e01259 | 723 | /* Indexed by the machine mode, gives the insn code to make a conditional |
423933c2 DE |
724 | move insn. */ |
725 | ||
726 | extern enum insn_code movcc_gen_code[NUM_MACHINE_MODES]; | |
727 | #endif | |
728 | ||
27b3f754 RK |
729 | /* This array records the insn_code of insns to perform block moves. */ |
730 | extern enum insn_code movstr_optab[NUM_MACHINE_MODES]; | |
731 | ||
12079564 RK |
732 | /* This array records the insn_code of insns to perform block clears. */ |
733 | extern enum insn_code clrstr_optab[NUM_MACHINE_MODES]; | |
734 | ||
12e74c9e RK |
735 | /* Define functions given in optabs.c. */ |
736 | ||
e8bbfc4e | 737 | /* Expand a binary operation given optab and rtx operands. */ |
12e74c9e RK |
738 | extern rtx expand_binop PROTO((enum machine_mode, optab, rtx, rtx, rtx, |
739 | int, enum optab_methods)); | |
e8bbfc4e RK |
740 | |
741 | /* Expand a binary operation with both signed and unsigned forms. */ | |
12e74c9e RK |
742 | extern rtx sign_expand_binop PROTO((enum machine_mode, optab, optab, rtx, |
743 | rtx, rtx, int, enum optab_methods)); | |
744 | ||
745 | /* Generate code to perform an operation on two operands with two results. */ | |
746 | extern int expand_twoval_binop PROTO((optab, rtx, rtx, rtx, rtx, int)); | |
e8bbfc4e RK |
747 | |
748 | /* Expand a unary arithmetic operation given optab rtx operand. */ | |
cb411bd6 | 749 | extern rtx expand_unop PROTO((enum machine_mode, optab, rtx, rtx, int)); |
e8bbfc4e | 750 | |
e3149275 | 751 | /* Expand the absolute value operation. */ |
91813b28 | 752 | extern rtx expand_abs PROTO((enum machine_mode, rtx, rtx, int)); |
e3149275 | 753 | |
bf15a311 | 754 | /* Expand the complex absolute value operation. */ |
cb411bd6 | 755 | extern rtx expand_complex_abs PROTO((enum machine_mode, rtx, rtx, int)); |
bf15a311 | 756 | |
12e74c9e RK |
757 | /* Generate an instruction with a given INSN_CODE with an output and |
758 | an input. */ | |
759 | extern void emit_unop_insn PROTO((int, rtx, rtx, enum rtx_code)); | |
e8bbfc4e | 760 | |
12e74c9e RK |
761 | /* Emit code to perform a series of operations on a multi-word quantity, one |
762 | word at a time. */ | |
763 | extern rtx emit_no_conflict_block PROTO((rtx, rtx, rtx, rtx, rtx)); | |
e8bbfc4e | 764 | |
12e74c9e RK |
765 | /* Emit code to make a call to a constant function or a library call. */ |
766 | extern void emit_libcall_block PROTO((rtx, rtx, rtx, rtx)); | |
e8bbfc4e | 767 | |
12e74c9e RK |
768 | /* Emit one rtl instruction to store zero in specified rtx. */ |
769 | extern void emit_clr_insn PROTO((rtx)); | |
e8bbfc4e | 770 | |
12e74c9e RK |
771 | /* Emit one rtl insn to store 1 in specified rtx assuming it contains 0. */ |
772 | extern void emit_0_to_1_insn PROTO((rtx)); | |
773 | ||
774 | /* Emit one rtl insn to compare two rtx's. */ | |
775 | extern void emit_cmp_insn PROTO((rtx, rtx, enum rtx_code, rtx, | |
776 | enum machine_mode, int, int)); | |
777 | ||
362cc3d4 MH |
778 | /* Emit a pair of rtl insns to compare two rtx's and to jump |
779 | to a label if the comparison is true. */ | |
780 | extern void emit_cmp_and_jump_insns PROTO((rtx, rtx, enum rtx_code, rtx, | |
781 | enum machine_mode, int, int, rtx)); | |
782 | ||
12e74c9e RK |
783 | /* Nonzero if a compare of mode MODE can be done straightforwardly |
784 | (without splitting it into pieces). */ | |
785 | extern int can_compare_p PROTO((enum machine_mode)); | |
786 | ||
787 | /* Generate code to indirectly jump to a location given in the rtx LOC. */ | |
788 | extern void emit_indirect_jump PROTO((rtx)); | |
789 | ||
423933c2 DE |
790 | #ifdef HAVE_conditional_move |
791 | /* Emit a conditional move operation. */ | |
792 | rtx emit_conditional_move PROTO((rtx, enum rtx_code, rtx, rtx, | |
793 | enum machine_mode, rtx, rtx, | |
794 | enum machine_mode, int)); | |
795 | ||
796 | /* Return non-zero if the conditional move is supported. */ | |
797 | int can_conditionally_move_p PROTO((enum machine_mode mode)); | |
e9576d2c | 798 | |
423933c2 DE |
799 | #endif |
800 | ||
12e74c9e RK |
801 | /* Create but don't emit one rtl instruction to add one rtx into another. |
802 | Modes must match; operands must meet the operation's predicates. | |
803 | Likewise for subtraction and for just copying. | |
804 | These do not call protect_from_queue; caller must do so. */ | |
805 | extern rtx gen_add2_insn PROTO((rtx, rtx)); | |
806 | extern rtx gen_sub2_insn PROTO((rtx, rtx)); | |
807 | extern rtx gen_move_insn PROTO((rtx, rtx)); | |
808 | extern int have_add2_insn PROTO((enum machine_mode)); | |
809 | extern int have_sub2_insn PROTO((enum machine_mode)); | |
e8bbfc4e RK |
810 | |
811 | /* Return the INSN_CODE to use for an extend operation. */ | |
12e74c9e RK |
812 | extern enum insn_code can_extend_p PROTO((enum machine_mode, |
813 | enum machine_mode, int)); | |
814 | ||
815 | /* Generate the body of an insn to extend Y (with mode MFROM) | |
816 | into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */ | |
817 | extern rtx gen_extend_insn PROTO((rtx, rtx, enum machine_mode, | |
818 | enum machine_mode, int)); | |
e8bbfc4e RK |
819 | |
820 | /* Initialize the tables that control conversion between fixed and | |
821 | floating values. */ | |
cb411bd6 RS |
822 | extern void init_fixtab PROTO((void)); |
823 | extern void init_floattab PROTO((void)); | |
e8bbfc4e | 824 | |
12e74c9e RK |
825 | /* Generate code for a FLOAT_EXPR. */ |
826 | extern void expand_float PROTO((rtx, rtx, int)); | |
827 | ||
e8bbfc4e | 828 | /* Generate code for a FIX_EXPR. */ |
cb411bd6 | 829 | extern void expand_fix PROTO((rtx, rtx, int)); |
e8bbfc4e | 830 | |
12e74c9e RK |
831 | /* Call this once to initialize the contents of the optabs |
832 | appropriately for the current target machine. */ | |
833 | extern void init_optabs PROTO((void)); | |
834 | \f | |
bda63bf1 | 835 | /* Functions from expmed.c: */ |
e8bbfc4e | 836 | |
12e74c9e RK |
837 | /* Arguments MODE, RTX: return an rtx for the negation of that value. |
838 | May emit insns. */ | |
839 | extern rtx negate_rtx PROTO((enum machine_mode, rtx)); | |
e8bbfc4e | 840 | |
12e74c9e RK |
841 | /* Expand a logical AND operation. */ |
842 | extern rtx expand_and PROTO((rtx, rtx, rtx)); | |
e8bbfc4e | 843 | |
12e74c9e RK |
844 | /* Emit a store-flag operation. */ |
845 | extern rtx emit_store_flag PROTO((rtx, enum rtx_code, rtx, rtx, | |
846 | enum machine_mode, int, int)); | |
e8bbfc4e | 847 | |
c0eccde6 TG |
848 | /* Like emit_store_flag, but always succeeds. */ |
849 | extern rtx emit_store_flag_force PROTO((rtx, enum rtx_code, rtx, rtx, | |
850 | enum machine_mode, int, int)); | |
851 | ||
12e74c9e | 852 | /* Functions from loop.c: */ |
e8bbfc4e | 853 | |
12e74c9e RK |
854 | /* Given a JUMP_INSN, return a description of the test being made. */ |
855 | extern rtx get_condition PROTO((rtx, rtx *)); | |
e0cd0770 JC |
856 | |
857 | /* Generate a conditional trap instruction. */ | |
858 | extern rtx gen_cond_trap PROTO((enum rtx_code, rtx, rtx, rtx)); | |
12e74c9e | 859 | \f |
28f4ec01 BS |
860 | /* Functions from builtins.c: */ |
861 | #ifdef TREE_CODE | |
862 | extern rtx expand_builtin PROTO((tree, rtx, rtx, enum machine_mode, int)); | |
d3707adb RH |
863 | extern void std_expand_builtin_va_start PROTO((int, tree, rtx)); |
864 | extern rtx std_expand_builtin_va_arg PROTO((tree, tree)); | |
865 | extern rtx expand_builtin_va_arg PROTO((tree, tree)); | |
28f4ec01 BS |
866 | #endif |
867 | ||
868 | extern rtx expand_builtin_setjmp PROTO((rtx, rtx, rtx, rtx)); | |
d3707adb RH |
869 | extern rtx expand_builtin_saveregs PROTO((void)); |
870 | extern int get_varargs_alias_set PROTO((void)); | |
28f4ec01 | 871 | \f |
12e74c9e | 872 | /* Functions from expr.c: */ |
cb411bd6 | 873 | |
12e74c9e RK |
874 | /* This is run once per compilation to set up which modes can be used |
875 | directly in memory and to initialize the block move optab. */ | |
876 | extern void init_expr_once PROTO((void)); | |
877 | ||
878 | /* This is run at the start of compiling a function. */ | |
879 | extern void init_expr PROTO((void)); | |
880 | ||
d7db6646 RH |
881 | /* This function is run once to initialize stor-layout.c. */ |
882 | ||
883 | extern void init_stor_layout_once PROTO((void)); | |
884 | ||
49ad7cfa BS |
885 | /* This is run at the end of compiling a function. */ |
886 | extern void finish_expr_for_function PROTO((void)); | |
887 | ||
12e74c9e RK |
888 | /* Use protect_from_queue to convert a QUEUED expression |
889 | into something that you can put immediately into an instruction. */ | |
890 | extern rtx protect_from_queue PROTO((rtx, int)); | |
891 | ||
892 | /* Perform all the pending incrementations. */ | |
893 | extern void emit_queue PROTO((void)); | |
b4cb4994 | 894 | |
1f06ee8d RH |
895 | /* Tell if something has a queued subexpression. */ |
896 | extern int queued_subexp_p PROTO((rtx)); | |
897 | ||
e8bbfc4e RK |
898 | /* Emit some rtl insns to move data between rtx's, converting machine modes. |
899 | Both modes must be floating or both fixed. */ | |
cb411bd6 | 900 | extern void convert_move PROTO((rtx, rtx, int)); |
e8bbfc4e RK |
901 | |
902 | /* Convert an rtx to specified machine mode and return the result. */ | |
cb411bd6 | 903 | extern rtx convert_to_mode PROTO((enum machine_mode, rtx, int)); |
e8bbfc4e | 904 | |
3fad11c9 RS |
905 | /* Convert an rtx to MODE from OLDMODE and return the result. */ |
906 | extern rtx convert_modes PROTO((enum machine_mode, enum machine_mode, rtx, int)); | |
907 | ||
bda63bf1 | 908 | /* Emit code to move a block Y to a block X. */ |
e9a25f70 | 909 | extern rtx emit_block_move PROTO((rtx, rtx, rtx, int)); |
12e74c9e RK |
910 | |
911 | /* Copy all or part of a value X into registers starting at REGNO. | |
912 | The number of registers to be filled is NREGS. */ | |
913 | extern void move_block_to_reg PROTO((int, rtx, int, enum machine_mode)); | |
914 | ||
915 | /* Copy all or part of a BLKmode value X out of registers starting at REGNO. | |
916 | The number of registers to be filled is NREGS. */ | |
067a2933 | 917 | extern void move_block_from_reg PROTO((int, rtx, int, int)); |
12e74c9e | 918 | |
ae73d3be JW |
919 | /* Load a BLKmode value into non-consecutive registers represented by a |
920 | PARALLEL. */ | |
aac5cc16 | 921 | extern void emit_group_load PROTO((rtx, rtx, int, int)); |
ae73d3be JW |
922 | /* Store a BLKmode value from non-consecutive registers represented by a |
923 | PARALLEL. */ | |
aac5cc16 | 924 | extern void emit_group_store PROTO((rtx, rtx, int, int)); |
ae73d3be | 925 | |
c36fce9a GRK |
926 | #ifdef TREE_CODE |
927 | /* Copy BLKmode object from a set of registers. */ | |
928 | extern rtx copy_blkmode_from_reg PROTO((rtx,rtx,tree)); | |
929 | #endif | |
930 | ||
8c99eaf6 | 931 | /* Mark REG as holding a parameter for the next CALL_INSN. */ |
0f41302f | 932 | extern void use_reg PROTO((rtx *, rtx)); |
8c99eaf6 RK |
933 | /* Mark NREGS consecutive regs, starting at REGNO, as holding parameters |
934 | for the next CALL_INSN. */ | |
0f41302f | 935 | extern void use_regs PROTO((rtx *, int, int)); |
ae73d3be | 936 | /* Mark a PARALLEL as holding a parameter for the next CALL_INSN. */ |
0f41302f | 937 | extern void use_group_regs PROTO((rtx *, rtx)); |
12e74c9e RK |
938 | |
939 | /* Write zeros through the storage of OBJECT. | |
12079564 | 940 | If OBJECT has BLKmode, SIZE is its length in bytes and ALIGN is its |
2af1bac8 | 941 | alignment. */ |
e9a25f70 | 942 | extern rtx clear_storage PROTO((rtx, rtx, int)); |
12e74c9e RK |
943 | |
944 | /* Emit insns to set X from Y. */ | |
945 | extern rtx emit_move_insn PROTO((rtx, rtx)); | |
946 | ||
947 | /* Emit insns to set X from Y, with no frills. */ | |
c5c76735 | 948 | extern rtx emit_move_insn_1 PROTO((rtx, rtx)); |
12e74c9e RK |
949 | |
950 | /* Push a block of length SIZE (perhaps variable) | |
951 | and return an rtx to address the beginning of the block. */ | |
952 | extern rtx push_block PROTO((rtx, int, int)); | |
953 | ||
9faa82d8 | 954 | /* Make an operand to push something on the stack. */ |
12e74c9e RK |
955 | extern rtx gen_push_operand PROTO((void)); |
956 | ||
957 | #ifdef TREE_CODE | |
958 | /* Generate code to push something onto the stack, given its mode and type. */ | |
959 | extern void emit_push_insn PROTO((rtx, enum machine_mode, tree, rtx, int, | |
e5e809f4 | 960 | int, rtx, int, rtx, rtx, int)); |
12e74c9e | 961 | |
6c1e2493 | 962 | /* Emit library call. */ |
d18225c4 | 963 | extern void emit_library_call PVPROTO((rtx orgfun, int no_queue, |
6c1e2493 | 964 | enum machine_mode outmode, int nargs, ...)); |
d18225c4 | 965 | extern rtx emit_library_call_value PVPROTO((rtx orgfun, rtx value, int no_queue, |
6c1e2493 | 966 | enum machine_mode outmode, int nargs, ...)); |
12e74c9e RK |
967 | |
968 | /* Expand an assignment that stores the value of FROM into TO. */ | |
969 | extern rtx expand_assignment PROTO((tree, tree, int, int)); | |
970 | ||
971 | /* Generate code for computing expression EXP, | |
972 | and storing the value into TARGET. | |
973 | If SUGGEST_REG is nonzero, copy the value through a register | |
974 | and return that register, if that is possible. */ | |
975 | extern rtx store_expr PROTO((tree, rtx, int)); | |
976 | #endif | |
e8bbfc4e RK |
977 | |
978 | /* Given an rtx that may include add and multiply operations, | |
979 | generate them as insns and return a pseudo-reg containing the value. | |
980 | Useful after calling expand_expr with 1 as sum_ok. */ | |
cb411bd6 | 981 | extern rtx force_operand PROTO((rtx, rtx)); |
e8bbfc4e | 982 | |
12e74c9e RK |
983 | #ifdef TREE_CODE |
984 | /* Generate code for computing expression EXP. | |
985 | An rtx for the computed value is returned. The value is never null. | |
986 | In the case of a void EXP, const0_rtx is returned. */ | |
987 | extern rtx expand_expr PROTO((tree, rtx, enum machine_mode, | |
988 | enum expand_modifier)); | |
989 | #endif | |
990 | ||
991 | /* At the start of a function, record that we have no previously-pushed | |
992 | arguments waiting to be popped. */ | |
993 | extern void init_pending_stack_adjust PROTO((void)); | |
994 | ||
995 | /* When exiting from function, if safe, clear out any pending stack adjust | |
996 | so the adjustment won't get done. */ | |
997 | extern void clear_pending_stack_adjust PROTO((void)); | |
998 | ||
999 | /* Pop any previously-pushed arguments that have not been popped yet. */ | |
1000 | extern void do_pending_stack_adjust PROTO((void)); | |
1001 | ||
1002 | #ifdef TREE_CODE | |
28f4ec01 BS |
1003 | /* Return the tree node and offset if a given argument corresponds to |
1004 | a string constant. */ | |
1005 | extern tree string_constant PROTO((tree, tree *)); | |
1006 | ||
12e74c9e RK |
1007 | /* Generate code to evaluate EXP and jump to LABEL if the value is zero. */ |
1008 | extern void jumpifnot PROTO((tree, rtx)); | |
1009 | ||
1010 | /* Generate code to evaluate EXP and jump to LABEL if the value is nonzero. */ | |
1011 | extern void jumpif PROTO((tree, rtx)); | |
1012 | ||
1013 | /* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if | |
1014 | the result is zero, or IF_TRUE_LABEL if the result is one. */ | |
1015 | extern void do_jump PROTO((tree, rtx, rtx)); | |
1016 | #endif | |
1017 | ||
1018 | /* Generate rtl to compare two rtx's, will call emit_cmp_insn. */ | |
1019 | extern rtx compare_from_rtx PROTO((rtx, rtx, enum rtx_code, int, | |
1020 | enum machine_mode, rtx, int)); | |
b30f05db BS |
1021 | extern void do_compare_rtx_and_jump PROTO((rtx, rtx, enum rtx_code, int, |
1022 | enum machine_mode, rtx, int, | |
1023 | rtx, rtx)); | |
12e74c9e RK |
1024 | |
1025 | /* Generate a tablejump instruction (used for switch statements). */ | |
1026 | extern void do_tablejump PROTO((rtx, enum machine_mode, rtx, rtx, rtx)); | |
1027 | \f | |
cb411bd6 RS |
1028 | #ifdef TREE_CODE |
1029 | /* rtl.h and tree.h were included. */ | |
1030 | /* Return an rtx for the size in bytes of the value of an expr. */ | |
1031 | extern rtx expr_size PROTO((tree)); | |
1032 | ||
1033 | extern rtx lookup_static_chain PROTO((tree)); | |
1034 | ||
1035 | /* Convert a stack slot address ADDR valid in function FNDECL | |
1036 | into an address valid in this function (using a static chain). */ | |
1037 | extern rtx fix_lexical_addr PROTO((rtx, tree)); | |
1038 | ||
1039 | /* Return the address of the trampoline for entering nested fn FUNCTION. */ | |
1040 | extern rtx trampoline_address PROTO((tree)); | |
1041 | ||
1042 | /* Return an rtx that refers to the value returned by a function | |
1043 | in its original home. This becomes invalid if any more code is emitted. */ | |
1044 | extern rtx hard_function_value PROTO((tree, tree)); | |
1045 | ||
0aaf6c85 | 1046 | extern rtx prepare_call_address PROTO((rtx, tree, rtx *, int)); |
cb411bd6 | 1047 | |
cb411bd6 | 1048 | extern rtx expand_call PROTO((tree, rtx, int)); |
cb411bd6 | 1049 | |
cb411bd6 RS |
1050 | extern rtx expand_shift PROTO((enum tree_code, enum machine_mode, rtx, tree, rtx, int)); |
1051 | extern rtx expand_divmod PROTO((int, enum tree_code, enum machine_mode, rtx, rtx, rtx, int)); | |
cb411bd6 RS |
1052 | extern void locate_and_pad_parm PROTO((enum machine_mode, tree, int, tree, struct args_size *, struct args_size *, struct args_size *)); |
1053 | extern rtx expand_inline_function PROTO((tree, tree, rtx, int, tree, rtx)); | |
1054 | /* Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary. */ | |
1055 | extern rtx label_rtx PROTO((tree)); | |
cb411bd6 RS |
1056 | #endif |
1057 | ||
626043cf | 1058 | /* Indicate how an input argument register was promoted. */ |
acda9c8d | 1059 | extern rtx promoted_input_arg PROTO((int, enum machine_mode *, int *)); |
626043cf | 1060 | |
e8bbfc4e RK |
1061 | /* Return an rtx like arg but sans any constant terms. |
1062 | Returns the original rtx if it has no constant terms. | |
1063 | The constant terms are added and stored via a second arg. */ | |
cb411bd6 | 1064 | extern rtx eliminate_constant_term PROTO((rtx, rtx *)); |
e8bbfc4e RK |
1065 | |
1066 | /* Convert arg to a valid memory address for specified machine mode, | |
1067 | by emitting insns to perform arithmetic if nec. */ | |
cb411bd6 | 1068 | extern rtx memory_address PROTO((enum machine_mode, rtx)); |
e8bbfc4e RK |
1069 | |
1070 | /* Like `memory_address' but pretent `flag_force_addr' is 0. */ | |
cb411bd6 | 1071 | extern rtx memory_address_noforce PROTO((enum machine_mode, rtx)); |
e8bbfc4e RK |
1072 | |
1073 | /* Return a memory reference like MEMREF, but with its mode changed | |
1074 | to MODE and its address changed to ADDR. | |
1075 | (VOIDmode means don't change the mode. | |
1076 | NULL for ADDR means don't change the address.) */ | |
cb411bd6 | 1077 | extern rtx change_address PROTO((rtx, enum machine_mode, rtx)); |
e8bbfc4e RK |
1078 | |
1079 | /* Return a memory reference like MEMREF, but which is known to have a | |
1080 | valid address. */ | |
1081 | ||
cb411bd6 | 1082 | extern rtx validize_mem PROTO((rtx)); |
e8bbfc4e | 1083 | |
e8bbfc4e | 1084 | /* Assemble the static constant template for function entry trampolines. */ |
cb411bd6 | 1085 | extern rtx assemble_trampoline_template PROTO((void)); |
e8bbfc4e RK |
1086 | |
1087 | /* Return 1 if two rtx's are equivalent in structure and elements. */ | |
cb411bd6 | 1088 | extern int rtx_equal_p PROTO((rtx, rtx)); |
e8bbfc4e RK |
1089 | |
1090 | /* Given rtx, return new rtx whose address won't be affected by | |
1091 | any side effects. It has been copied to a new temporary reg. */ | |
cb411bd6 | 1092 | extern rtx stabilize PROTO((rtx)); |
e8bbfc4e RK |
1093 | |
1094 | /* Given an rtx, copy all regs it refers to into new temps | |
1095 | and return a modified copy that refers to the new temps. */ | |
cb411bd6 | 1096 | extern rtx copy_all_regs PROTO((rtx)); |
e8bbfc4e RK |
1097 | |
1098 | /* Copy given rtx to a new temp reg and return that. */ | |
cb411bd6 | 1099 | extern rtx copy_to_reg PROTO((rtx)); |
e8bbfc4e RK |
1100 | |
1101 | /* Like copy_to_reg but always make the reg Pmode. */ | |
cb411bd6 | 1102 | extern rtx copy_addr_to_reg PROTO((rtx)); |
e8bbfc4e RK |
1103 | |
1104 | /* Like copy_to_reg but always make the reg the specified mode MODE. */ | |
cb411bd6 | 1105 | extern rtx copy_to_mode_reg PROTO((enum machine_mode, rtx)); |
e8bbfc4e RK |
1106 | |
1107 | /* Copy given rtx to given temp reg and return that. */ | |
cb411bd6 | 1108 | extern rtx copy_to_suggested_reg PROTO((rtx, rtx, enum machine_mode)); |
e8bbfc4e RK |
1109 | |
1110 | /* Copy a value to a register if it isn't already a register. | |
1111 | Args are mode (in case value is a constant) and the value. */ | |
cb411bd6 | 1112 | extern rtx force_reg PROTO((enum machine_mode, rtx)); |
e8bbfc4e RK |
1113 | |
1114 | /* Return given rtx, copied into a new temp reg if it was in memory. */ | |
cb411bd6 | 1115 | extern rtx force_not_mem PROTO((rtx)); |
e8bbfc4e | 1116 | |
9d69b7c8 RK |
1117 | #ifdef TREE_CODE |
1118 | /* Return mode and signedness to use when object is promoted. */ | |
1119 | extern enum machine_mode promote_mode PROTO((tree, enum machine_mode, | |
1120 | int *, int)); | |
1121 | #endif | |
1122 | ||
e8bbfc4e | 1123 | /* Remove some bytes from the stack. An rtx says how many. */ |
cb411bd6 | 1124 | extern void adjust_stack PROTO((rtx)); |
e8bbfc4e RK |
1125 | |
1126 | /* Add some bytes to the stack. An rtx says how many. */ | |
cb411bd6 | 1127 | extern void anti_adjust_stack PROTO((rtx)); |
e8bbfc4e | 1128 | |
59257ff7 RK |
1129 | /* This enum is used for the following two functions. */ |
1130 | enum save_level {SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL}; | |
1131 | ||
1132 | /* Save the stack pointer at the specified level. */ | |
cb411bd6 | 1133 | extern void emit_stack_save PROTO((enum save_level, rtx *, rtx)); |
59257ff7 RK |
1134 | |
1135 | /* Restore the stack pointer from a save area of the specified level. */ | |
cb411bd6 | 1136 | extern void emit_stack_restore PROTO((enum save_level, rtx, rtx)); |
59257ff7 | 1137 | |
e8bbfc4e RK |
1138 | /* Allocate some space on the stack dynamically and return its address. An rtx |
1139 | says how many bytes. */ | |
cb411bd6 | 1140 | extern rtx allocate_dynamic_stack_space PROTO((rtx, rtx, int)); |
e8bbfc4e | 1141 | |
f7761c9a RK |
1142 | /* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive. |
1143 | FIRST is a constant and size is a Pmode RTX. These are offsets from the | |
1144 | current stack pointer. STACK_GROWS_DOWNWARD says whether to add or | |
1145 | subtract from the stack. If SIZE is constant, this is done | |
1146 | with a fixed number of probes. Otherwise, we must make a loop. */ | |
1147 | extern void probe_stack_range PROTO((HOST_WIDE_INT, rtx)); | |
1148 | ||
e8bbfc4e RK |
1149 | /* Return an rtx that refers to the value returned by a library call |
1150 | in its original home. This becomes invalid if any more code is emitted. */ | |
cb411bd6 | 1151 | extern rtx hard_libcall_value PROTO((enum machine_mode)); |
e8bbfc4e | 1152 | |
e8bbfc4e RK |
1153 | /* Given an rtx, return an rtx for a value rounded up to a multiple |
1154 | of STACK_BOUNDARY / BITS_PER_UNIT. */ | |
cb411bd6 | 1155 | extern rtx round_push PROTO((rtx)); |
e8bbfc4e | 1156 | |
cb411bd6 RS |
1157 | extern rtx store_bit_field PROTO((rtx, int, int, enum machine_mode, rtx, int, int)); |
1158 | extern rtx extract_bit_field PROTO((rtx, int, int, int, rtx, enum machine_mode, enum machine_mode, int, int)); | |
1159 | extern rtx expand_mult PROTO((enum machine_mode, rtx, rtx, rtx, int)); | |
1160 | extern rtx expand_mult_add PROTO((rtx, rtx, rtx, rtx,enum machine_mode, int)); | |
4b6ba2ba | 1161 | extern rtx expand_mult_highpart_adjust PROTO((enum machine_mode, rtx, rtx, rtx, rtx, int)); |
e8bbfc4e | 1162 | |
cb411bd6 | 1163 | extern rtx assemble_static_space PROTO((int)); |
e8bbfc4e RK |
1164 | |
1165 | /* Hook called by expand_expr for language-specific tree codes. | |
1166 | It is up to the language front end to install a hook | |
1167 | if it has any such codes that expand_expr needs to know about. */ | |
e9576d2c L |
1168 | extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx, |
1169 | enum machine_mode, | |
1170 | enum expand_modifier modifier)); | |
b0cb541b | 1171 | |
4d49638c | 1172 | #ifdef TREE_CODE |
e697e20a MM |
1173 | /* Hook called by output_constant for language-specific tree codes. |
1174 | It is up to the language front-end to install a hook if it has any | |
1175 | such codes that output_constant needs to know about. Returns a | |
1176 | language-independent constant equivalent to its input. */ | |
4d49638c MM |
1177 | extern tree (*lang_expand_constant) PROTO((tree)); |
1178 | #endif | |
e697e20a | 1179 | |
e9576d2c L |
1180 | extern void init_all_optabs PROTO ((void)); |
1181 | extern void init_mov_optab PROTO ((void)); | |
487a6e06 | 1182 | extern void do_jump_by_parts_equality_rtx PROTO((rtx, rtx, rtx)); |
e9576d2c L |
1183 | extern void do_jump_by_parts_greater_rtx PROTO ((enum machine_mode, int, |
1184 | rtx, rtx, rtx, rtx)); | |
df03cab5 | 1185 | |
0586a4ce | 1186 | #ifdef TREE_CODE /* Don't lose if tree.h not included. */ |
df03cab5 JL |
1187 | extern void mark_seen_cases PROTO ((tree, unsigned char *, |
1188 | long, int)); | |
0586a4ce | 1189 | #endif |