OSDN Git Service

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