xref: /dflybsd-src/contrib/gcc-4.7/gcc/expr.h (revision 04febcfb30580676d3e95f58a16c5137ee478b32)
1*e4b17023SJohn Marino /* Definitions for code generation pass of GNU compiler.
2*e4b17023SJohn Marino    Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3*e4b17023SJohn Marino    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4*e4b17023SJohn Marino    Free Software Foundation, Inc.
5*e4b17023SJohn Marino 
6*e4b17023SJohn Marino This file is part of GCC.
7*e4b17023SJohn Marino 
8*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under
9*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free
10*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later
11*e4b17023SJohn Marino version.
12*e4b17023SJohn Marino 
13*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or
15*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16*e4b17023SJohn Marino for more details.
17*e4b17023SJohn Marino 
18*e4b17023SJohn Marino You should have received a copy of the GNU General Public License
19*e4b17023SJohn Marino along with GCC; see the file COPYING3.  If not see
20*e4b17023SJohn Marino <http://www.gnu.org/licenses/>.  */
21*e4b17023SJohn Marino 
22*e4b17023SJohn Marino #ifndef GCC_EXPR_H
23*e4b17023SJohn Marino #define GCC_EXPR_H
24*e4b17023SJohn Marino 
25*e4b17023SJohn Marino /* For inhibit_defer_pop */
26*e4b17023SJohn Marino #include "function.h"
27*e4b17023SJohn Marino /* For XEXP, GEN_INT, rtx_code */
28*e4b17023SJohn Marino #include "rtl.h"
29*e4b17023SJohn Marino /* For optimize_size */
30*e4b17023SJohn Marino #include "flags.h"
31*e4b17023SJohn Marino /* For host_integerp, tree_low_cst, fold_convert, size_binop, ssize_int,
32*e4b17023SJohn Marino    TREE_CODE, TYPE_SIZE, int_size_in_bytes,    */
33*e4b17023SJohn Marino #include "tree.h"
34*e4b17023SJohn Marino /* For GET_MODE_BITSIZE, word_mode */
35*e4b17023SJohn Marino #include "machmode.h"
36*e4b17023SJohn Marino 
37*e4b17023SJohn Marino /* This is the 4th arg to `expand_expr'.
38*e4b17023SJohn Marino    EXPAND_STACK_PARM means we are possibly expanding a call param onto
39*e4b17023SJohn Marino    the stack.
40*e4b17023SJohn Marino    EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx.
41*e4b17023SJohn Marino    EXPAND_INITIALIZER is similar but also record any labels on forced_labels.
42*e4b17023SJohn Marino    EXPAND_CONST_ADDRESS means it is ok to return a MEM whose address
43*e4b17023SJohn Marino     is a constant that is not a legitimate address.
44*e4b17023SJohn Marino    EXPAND_WRITE means we are only going to write to the resulting rtx.
45*e4b17023SJohn Marino    EXPAND_MEMORY means we are interested in a memory result, even if
46*e4b17023SJohn Marino     the memory is constant and we could have propagated a constant value.  */
47*e4b17023SJohn Marino enum expand_modifier {EXPAND_NORMAL = 0, EXPAND_STACK_PARM, EXPAND_SUM,
48*e4b17023SJohn Marino 		      EXPAND_CONST_ADDRESS, EXPAND_INITIALIZER, EXPAND_WRITE,
49*e4b17023SJohn Marino 		      EXPAND_MEMORY};
50*e4b17023SJohn Marino 
51*e4b17023SJohn Marino /* Prevent the compiler from deferring stack pops.  See
52*e4b17023SJohn Marino    inhibit_defer_pop for more information.  */
53*e4b17023SJohn Marino #define NO_DEFER_POP (inhibit_defer_pop += 1)
54*e4b17023SJohn Marino 
55*e4b17023SJohn Marino /* Allow the compiler to defer stack pops.  See inhibit_defer_pop for
56*e4b17023SJohn Marino    more information.  */
57*e4b17023SJohn Marino #define OK_DEFER_POP (inhibit_defer_pop -= 1)
58*e4b17023SJohn Marino 
59*e4b17023SJohn Marino enum direction {none, upward, downward};
60*e4b17023SJohn Marino 
61*e4b17023SJohn Marino /* Structure to record the size of a sequence of arguments
62*e4b17023SJohn Marino    as the sum of a tree-expression and a constant.  This structure is
63*e4b17023SJohn Marino    also used to store offsets from the stack, which might be negative,
64*e4b17023SJohn Marino    so the variable part must be ssizetype, not sizetype.  */
65*e4b17023SJohn Marino 
66*e4b17023SJohn Marino struct args_size
67*e4b17023SJohn Marino {
68*e4b17023SJohn Marino   HOST_WIDE_INT constant;
69*e4b17023SJohn Marino   tree var;
70*e4b17023SJohn Marino };
71*e4b17023SJohn Marino 
72*e4b17023SJohn Marino /* Package up various arg related fields of struct args for
73*e4b17023SJohn Marino    locate_and_pad_parm.  */
74*e4b17023SJohn Marino struct locate_and_pad_arg_data
75*e4b17023SJohn Marino {
76*e4b17023SJohn Marino   /* Size of this argument on the stack, rounded up for any padding it
77*e4b17023SJohn Marino      gets.  If REG_PARM_STACK_SPACE is defined, then register parms are
78*e4b17023SJohn Marino      counted here, otherwise they aren't.  */
79*e4b17023SJohn Marino   struct args_size size;
80*e4b17023SJohn Marino   /* Offset of this argument from beginning of stack-args.  */
81*e4b17023SJohn Marino   struct args_size offset;
82*e4b17023SJohn Marino   /* Offset to the start of the stack slot.  Different from OFFSET
83*e4b17023SJohn Marino      if this arg pads downward.  */
84*e4b17023SJohn Marino   struct args_size slot_offset;
85*e4b17023SJohn Marino   /* The amount that the stack pointer needs to be adjusted to
86*e4b17023SJohn Marino      force alignment for the next argument.  */
87*e4b17023SJohn Marino   struct args_size alignment_pad;
88*e4b17023SJohn Marino   /* Which way we should pad this arg.  */
89*e4b17023SJohn Marino   enum direction where_pad;
90*e4b17023SJohn Marino   /* slot_offset is at least this aligned.  */
91*e4b17023SJohn Marino   unsigned int boundary;
92*e4b17023SJohn Marino };
93*e4b17023SJohn Marino 
94*e4b17023SJohn Marino /* Add the value of the tree INC to the `struct args_size' TO.  */
95*e4b17023SJohn Marino 
96*e4b17023SJohn Marino #define ADD_PARM_SIZE(TO, INC)					\
97*e4b17023SJohn Marino do {								\
98*e4b17023SJohn Marino   tree inc = (INC);						\
99*e4b17023SJohn Marino   if (host_integerp (inc, 0))					\
100*e4b17023SJohn Marino     (TO).constant += tree_low_cst (inc, 0);			\
101*e4b17023SJohn Marino   else if ((TO).var == 0)					\
102*e4b17023SJohn Marino     (TO).var = fold_convert (ssizetype, inc);			\
103*e4b17023SJohn Marino   else								\
104*e4b17023SJohn Marino     (TO).var = size_binop (PLUS_EXPR, (TO).var,			\
105*e4b17023SJohn Marino 			   fold_convert (ssizetype, inc));	\
106*e4b17023SJohn Marino } while (0)
107*e4b17023SJohn Marino 
108*e4b17023SJohn Marino #define SUB_PARM_SIZE(TO, DEC)					\
109*e4b17023SJohn Marino do {								\
110*e4b17023SJohn Marino   tree dec = (DEC);						\
111*e4b17023SJohn Marino   if (host_integerp (dec, 0))					\
112*e4b17023SJohn Marino     (TO).constant -= tree_low_cst (dec, 0);			\
113*e4b17023SJohn Marino   else if ((TO).var == 0)					\
114*e4b17023SJohn Marino     (TO).var = size_binop (MINUS_EXPR, ssize_int (0),		\
115*e4b17023SJohn Marino 			   fold_convert (ssizetype, dec));	\
116*e4b17023SJohn Marino   else								\
117*e4b17023SJohn Marino     (TO).var = size_binop (MINUS_EXPR, (TO).var,		\
118*e4b17023SJohn Marino 			   fold_convert (ssizetype, dec));	\
119*e4b17023SJohn Marino } while (0)
120*e4b17023SJohn Marino 
121*e4b17023SJohn Marino /* Convert the implicit sum in a `struct args_size' into a tree
122*e4b17023SJohn Marino    of type ssizetype.  */
123*e4b17023SJohn Marino #define ARGS_SIZE_TREE(SIZE)					\
124*e4b17023SJohn Marino ((SIZE).var == 0 ? ssize_int ((SIZE).constant)			\
125*e4b17023SJohn Marino  : size_binop (PLUS_EXPR, fold_convert (ssizetype, (SIZE).var),	\
126*e4b17023SJohn Marino 	       ssize_int ((SIZE).constant)))
127*e4b17023SJohn Marino 
128*e4b17023SJohn Marino /* Convert the implicit sum in a `struct args_size' into an rtx.  */
129*e4b17023SJohn Marino #define ARGS_SIZE_RTX(SIZE)					\
130*e4b17023SJohn Marino ((SIZE).var == 0 ? GEN_INT ((SIZE).constant)			\
131*e4b17023SJohn Marino  : expand_normal (ARGS_SIZE_TREE (SIZE)))
132*e4b17023SJohn Marino 
133*e4b17023SJohn Marino 
134*e4b17023SJohn Marino /* This structure is used to pass around information about exploded
135*e4b17023SJohn Marino    unary, binary and trinary expressions between expand_expr_real_1 and
136*e4b17023SJohn Marino    friends.  */
137*e4b17023SJohn Marino typedef struct separate_ops
138*e4b17023SJohn Marino {
139*e4b17023SJohn Marino   enum tree_code code;
140*e4b17023SJohn Marino   location_t location;
141*e4b17023SJohn Marino   tree type;
142*e4b17023SJohn Marino   tree op0, op1, op2;
143*e4b17023SJohn Marino } *sepops;
144*e4b17023SJohn Marino 
145*e4b17023SJohn Marino /* Functions from optabs.c, commonly used, and without need for the optabs
146*e4b17023SJohn Marino    tables:  */
147*e4b17023SJohn Marino 
148*e4b17023SJohn Marino /* Passed to expand_simple_binop and expand_binop to say which options
149*e4b17023SJohn Marino    to try to use if the requested operation can't be open-coded on the
150*e4b17023SJohn Marino    requisite mode.  Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using
151*e4b17023SJohn Marino    a library call.  Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try
152*e4b17023SJohn Marino    using a wider mode.  OPTAB_MUST_WIDEN says try widening and don't
153*e4b17023SJohn Marino    try anything else.  */
154*e4b17023SJohn Marino 
155*e4b17023SJohn Marino enum optab_methods
156*e4b17023SJohn Marino {
157*e4b17023SJohn Marino   OPTAB_DIRECT,
158*e4b17023SJohn Marino   OPTAB_LIB,
159*e4b17023SJohn Marino   OPTAB_WIDEN,
160*e4b17023SJohn Marino   OPTAB_LIB_WIDEN,
161*e4b17023SJohn Marino   OPTAB_MUST_WIDEN
162*e4b17023SJohn Marino };
163*e4b17023SJohn Marino 
164*e4b17023SJohn Marino /* Generate code for a simple binary or unary operation.  "Simple" in
165*e4b17023SJohn Marino    this case means "can be unambiguously described by a (mode, code)
166*e4b17023SJohn Marino    pair and mapped to a single optab."  */
167*e4b17023SJohn Marino extern rtx expand_simple_binop (enum machine_mode, enum rtx_code, rtx,
168*e4b17023SJohn Marino 				rtx, rtx, int, enum optab_methods);
169*e4b17023SJohn Marino extern rtx expand_simple_unop (enum machine_mode, enum rtx_code, rtx, rtx,
170*e4b17023SJohn Marino 			       int);
171*e4b17023SJohn Marino 
172*e4b17023SJohn Marino /* Report whether the machine description contains an insn which can
173*e4b17023SJohn Marino    perform the operation described by CODE and MODE.  */
174*e4b17023SJohn Marino extern int have_insn_for (enum rtx_code, enum machine_mode);
175*e4b17023SJohn Marino 
176*e4b17023SJohn Marino /* Emit code to make a call to a constant function or a library call.  */
177*e4b17023SJohn Marino extern void emit_libcall_block (rtx, rtx, rtx, rtx);
178*e4b17023SJohn Marino 
179*e4b17023SJohn Marino /* Create but don't emit one rtl instruction to perform certain operations.
180*e4b17023SJohn Marino    Modes must match; operands must meet the operation's predicates.
181*e4b17023SJohn Marino    Likewise for subtraction and for just copying.  */
182*e4b17023SJohn Marino extern rtx gen_add2_insn (rtx, rtx);
183*e4b17023SJohn Marino extern rtx gen_add3_insn (rtx, rtx, rtx);
184*e4b17023SJohn Marino extern rtx gen_sub2_insn (rtx, rtx);
185*e4b17023SJohn Marino extern rtx gen_sub3_insn (rtx, rtx, rtx);
186*e4b17023SJohn Marino extern rtx gen_move_insn (rtx, rtx);
187*e4b17023SJohn Marino extern int have_add2_insn (rtx, rtx);
188*e4b17023SJohn Marino extern int have_sub2_insn (rtx, rtx);
189*e4b17023SJohn Marino 
190*e4b17023SJohn Marino /* Emit a pair of rtl insns to compare two rtx's and to jump
191*e4b17023SJohn Marino    to a label if the comparison is true.  */
192*e4b17023SJohn Marino extern void emit_cmp_and_jump_insns (rtx, rtx, enum rtx_code, rtx,
193*e4b17023SJohn Marino 				     enum machine_mode, int, rtx);
194*e4b17023SJohn Marino 
195*e4b17023SJohn Marino /* Generate code to indirectly jump to a location given in the rtx LOC.  */
196*e4b17023SJohn Marino extern void emit_indirect_jump (rtx);
197*e4b17023SJohn Marino 
198*e4b17023SJohn Marino /* Generate a conditional trap instruction.  */
199*e4b17023SJohn Marino extern rtx gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
200*e4b17023SJohn Marino 
201*e4b17023SJohn Marino #include "insn-config.h"
202*e4b17023SJohn Marino 
203*e4b17023SJohn Marino #ifdef HAVE_conditional_move
204*e4b17023SJohn Marino /* Emit a conditional move operation.  */
205*e4b17023SJohn Marino rtx emit_conditional_move (rtx, enum rtx_code, rtx, rtx, enum machine_mode,
206*e4b17023SJohn Marino 			   rtx, rtx, enum machine_mode, int);
207*e4b17023SJohn Marino 
208*e4b17023SJohn Marino /* Return nonzero if the conditional move is supported.  */
209*e4b17023SJohn Marino int can_conditionally_move_p (enum machine_mode mode);
210*e4b17023SJohn Marino 
211*e4b17023SJohn Marino #endif
212*e4b17023SJohn Marino rtx emit_conditional_add (rtx, enum rtx_code, rtx, rtx, enum machine_mode,
213*e4b17023SJohn Marino 			  rtx, rtx, enum machine_mode, int);
214*e4b17023SJohn Marino 
215*e4b17023SJohn Marino rtx expand_sync_operation (rtx, rtx, enum rtx_code);
216*e4b17023SJohn Marino rtx expand_sync_fetch_operation (rtx, rtx, enum rtx_code, bool, rtx);
217*e4b17023SJohn Marino rtx expand_sync_lock_test_and_set (rtx, rtx, rtx);
218*e4b17023SJohn Marino 
219*e4b17023SJohn Marino rtx expand_atomic_exchange (rtx, rtx, rtx, enum memmodel);
220*e4b17023SJohn Marino rtx expand_atomic_load (rtx, rtx, enum memmodel);
221*e4b17023SJohn Marino rtx expand_atomic_store (rtx, rtx, enum memmodel, bool);
222*e4b17023SJohn Marino rtx expand_atomic_fetch_op (rtx, rtx, rtx, enum rtx_code, enum memmodel,
223*e4b17023SJohn Marino 			      bool);
224*e4b17023SJohn Marino rtx expand_atomic_test_and_set (rtx, rtx, enum memmodel);
225*e4b17023SJohn Marino rtx expand_atomic_clear (rtx, enum memmodel);
226*e4b17023SJohn Marino void expand_atomic_thread_fence (enum memmodel);
227*e4b17023SJohn Marino void expand_atomic_signal_fence (enum memmodel);
228*e4b17023SJohn Marino 
229*e4b17023SJohn Marino 
230*e4b17023SJohn Marino /* Functions from expmed.c:  */
231*e4b17023SJohn Marino 
232*e4b17023SJohn Marino /* Arguments MODE, RTX: return an rtx for the negation of that value.
233*e4b17023SJohn Marino    May emit insns.  */
234*e4b17023SJohn Marino extern rtx negate_rtx (enum machine_mode, rtx);
235*e4b17023SJohn Marino 
236*e4b17023SJohn Marino /* Expand a logical AND operation.  */
237*e4b17023SJohn Marino extern rtx expand_and (enum machine_mode, rtx, rtx, rtx);
238*e4b17023SJohn Marino 
239*e4b17023SJohn Marino /* Emit a store-flag operation.  */
240*e4b17023SJohn Marino extern rtx emit_store_flag (rtx, enum rtx_code, rtx, rtx, enum machine_mode,
241*e4b17023SJohn Marino 			    int, int);
242*e4b17023SJohn Marino 
243*e4b17023SJohn Marino /* Like emit_store_flag, but always succeeds.  */
244*e4b17023SJohn Marino extern rtx emit_store_flag_force (rtx, enum rtx_code, rtx, rtx,
245*e4b17023SJohn Marino 				  enum machine_mode, int, int);
246*e4b17023SJohn Marino 
247*e4b17023SJohn Marino /* Functions from builtins.c:  */
248*e4b17023SJohn Marino extern rtx expand_builtin (tree, rtx, rtx, enum machine_mode, int);
249*e4b17023SJohn Marino extern tree std_build_builtin_va_list (void);
250*e4b17023SJohn Marino extern tree std_fn_abi_va_list (tree);
251*e4b17023SJohn Marino extern tree std_canonical_va_list_type (tree);
252*e4b17023SJohn Marino 
253*e4b17023SJohn Marino extern void std_expand_builtin_va_start (tree, rtx);
254*e4b17023SJohn Marino extern rtx default_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
255*e4b17023SJohn Marino extern void expand_builtin_setjmp_setup (rtx, rtx);
256*e4b17023SJohn Marino extern void expand_builtin_setjmp_receiver (rtx);
257*e4b17023SJohn Marino extern rtx expand_builtin_saveregs (void);
258*e4b17023SJohn Marino extern void expand_builtin_trap (void);
259*e4b17023SJohn Marino extern rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode);
260*e4b17023SJohn Marino 
261*e4b17023SJohn Marino /* Functions from expr.c:  */
262*e4b17023SJohn Marino 
263*e4b17023SJohn Marino /* This is run during target initialization to set up which modes can be
264*e4b17023SJohn Marino    used directly in memory and to initialize the block move optab.  */
265*e4b17023SJohn Marino extern void init_expr_target (void);
266*e4b17023SJohn Marino 
267*e4b17023SJohn Marino /* This is run at the start of compiling a function.  */
268*e4b17023SJohn Marino extern void init_expr (void);
269*e4b17023SJohn Marino 
270*e4b17023SJohn Marino /* Emit some rtl insns to move data between rtx's, converting machine modes.
271*e4b17023SJohn Marino    Both modes must be floating or both fixed.  */
272*e4b17023SJohn Marino extern void convert_move (rtx, rtx, int);
273*e4b17023SJohn Marino 
274*e4b17023SJohn Marino /* Convert an rtx to specified machine mode and return the result.  */
275*e4b17023SJohn Marino extern rtx convert_to_mode (enum machine_mode, rtx, int);
276*e4b17023SJohn Marino 
277*e4b17023SJohn Marino /* Convert an rtx to MODE from OLDMODE and return the result.  */
278*e4b17023SJohn Marino extern rtx convert_modes (enum machine_mode, enum machine_mode, rtx, int);
279*e4b17023SJohn Marino 
280*e4b17023SJohn Marino /* Emit code to move a block Y to a block X.  */
281*e4b17023SJohn Marino 
282*e4b17023SJohn Marino enum block_op_methods
283*e4b17023SJohn Marino {
284*e4b17023SJohn Marino   BLOCK_OP_NORMAL,
285*e4b17023SJohn Marino   BLOCK_OP_NO_LIBCALL,
286*e4b17023SJohn Marino   BLOCK_OP_CALL_PARM,
287*e4b17023SJohn Marino   /* Like BLOCK_OP_NORMAL, but the libcall can be tail call optimized.  */
288*e4b17023SJohn Marino   BLOCK_OP_TAILCALL
289*e4b17023SJohn Marino };
290*e4b17023SJohn Marino 
291*e4b17023SJohn Marino extern GTY(()) tree block_clear_fn;
292*e4b17023SJohn Marino extern void init_block_move_fn (const char *);
293*e4b17023SJohn Marino extern void init_block_clear_fn (const char *);
294*e4b17023SJohn Marino 
295*e4b17023SJohn Marino extern rtx emit_block_move (rtx, rtx, rtx, enum block_op_methods);
296*e4b17023SJohn Marino extern rtx emit_block_move_via_libcall (rtx, rtx, rtx, bool);
297*e4b17023SJohn Marino extern rtx emit_block_move_hints (rtx, rtx, rtx, enum block_op_methods,
298*e4b17023SJohn Marino 			          unsigned int, HOST_WIDE_INT);
299*e4b17023SJohn Marino extern bool emit_storent_insn (rtx to, rtx from);
300*e4b17023SJohn Marino 
301*e4b17023SJohn Marino /* Copy all or part of a value X into registers starting at REGNO.
302*e4b17023SJohn Marino    The number of registers to be filled is NREGS.  */
303*e4b17023SJohn Marino extern void move_block_to_reg (int, rtx, int, enum machine_mode);
304*e4b17023SJohn Marino 
305*e4b17023SJohn Marino /* Copy all or part of a BLKmode value X out of registers starting at REGNO.
306*e4b17023SJohn Marino    The number of registers to be filled is NREGS.  */
307*e4b17023SJohn Marino extern void move_block_from_reg (int, rtx, int);
308*e4b17023SJohn Marino 
309*e4b17023SJohn Marino /* Generate a non-consecutive group of registers represented by a PARALLEL.  */
310*e4b17023SJohn Marino extern rtx gen_group_rtx (rtx);
311*e4b17023SJohn Marino 
312*e4b17023SJohn Marino /* Load a BLKmode value into non-consecutive registers represented by a
313*e4b17023SJohn Marino    PARALLEL.  */
314*e4b17023SJohn Marino extern void emit_group_load (rtx, rtx, tree, int);
315*e4b17023SJohn Marino 
316*e4b17023SJohn Marino /* Similarly, but load into new temporaries.  */
317*e4b17023SJohn Marino extern rtx emit_group_load_into_temps (rtx, rtx, tree, int);
318*e4b17023SJohn Marino 
319*e4b17023SJohn Marino /* Move a non-consecutive group of registers represented by a PARALLEL into
320*e4b17023SJohn Marino    a non-consecutive group of registers represented by a PARALLEL.  */
321*e4b17023SJohn Marino extern void emit_group_move (rtx, rtx);
322*e4b17023SJohn Marino 
323*e4b17023SJohn Marino /* Move a group of registers represented by a PARALLEL into pseudos.  */
324*e4b17023SJohn Marino extern rtx emit_group_move_into_temps (rtx);
325*e4b17023SJohn Marino 
326*e4b17023SJohn Marino /* Store a BLKmode value from non-consecutive registers represented by a
327*e4b17023SJohn Marino    PARALLEL.  */
328*e4b17023SJohn Marino extern void emit_group_store (rtx, rtx, tree, int);
329*e4b17023SJohn Marino 
330*e4b17023SJohn Marino /* Copy BLKmode object from a set of registers.  */
331*e4b17023SJohn Marino extern rtx copy_blkmode_from_reg (rtx, rtx, tree);
332*e4b17023SJohn Marino 
333*e4b17023SJohn Marino /* Mark REG as holding a parameter for the next CALL_INSN.
334*e4b17023SJohn Marino    Mode is TYPE_MODE of the non-promoted parameter, or VOIDmode.  */
335*e4b17023SJohn Marino extern void use_reg_mode (rtx *, rtx, enum machine_mode);
336*e4b17023SJohn Marino 
337*e4b17023SJohn Marino extern rtx copy_blkmode_to_reg (enum machine_mode, tree);
338*e4b17023SJohn Marino 
339*e4b17023SJohn Marino /* Mark REG as holding a parameter for the next CALL_INSN.  */
340*e4b17023SJohn Marino static inline void
use_reg(rtx * fusage,rtx reg)341*e4b17023SJohn Marino use_reg (rtx *fusage, rtx reg)
342*e4b17023SJohn Marino {
343*e4b17023SJohn Marino   use_reg_mode (fusage, reg, VOIDmode);
344*e4b17023SJohn Marino }
345*e4b17023SJohn Marino 
346*e4b17023SJohn Marino /* Mark NREGS consecutive regs, starting at REGNO, as holding parameters
347*e4b17023SJohn Marino    for the next CALL_INSN.  */
348*e4b17023SJohn Marino extern void use_regs (rtx *, int, int);
349*e4b17023SJohn Marino 
350*e4b17023SJohn Marino /* Mark a PARALLEL as holding a parameter for the next CALL_INSN.  */
351*e4b17023SJohn Marino extern void use_group_regs (rtx *, rtx);
352*e4b17023SJohn Marino 
353*e4b17023SJohn Marino /* Write zeros through the storage of OBJECT.
354*e4b17023SJohn Marino    If OBJECT has BLKmode, SIZE is its length in bytes.  */
355*e4b17023SJohn Marino extern rtx clear_storage (rtx, rtx, enum block_op_methods);
356*e4b17023SJohn Marino extern rtx clear_storage_hints (rtx, rtx, enum block_op_methods,
357*e4b17023SJohn Marino 			        unsigned int, HOST_WIDE_INT);
358*e4b17023SJohn Marino /* The same, but always output an library call.  */
359*e4b17023SJohn Marino rtx set_storage_via_libcall (rtx, rtx, rtx, bool);
360*e4b17023SJohn Marino 
361*e4b17023SJohn Marino /* Expand a setmem pattern; return true if successful.  */
362*e4b17023SJohn Marino extern bool set_storage_via_setmem (rtx, rtx, rtx, unsigned int,
363*e4b17023SJohn Marino 				    unsigned int, HOST_WIDE_INT);
364*e4b17023SJohn Marino 
365*e4b17023SJohn Marino /* Determine whether the LEN bytes can be moved by using several move
366*e4b17023SJohn Marino    instructions.  Return nonzero if a call to move_by_pieces should
367*e4b17023SJohn Marino    succeed.  */
368*e4b17023SJohn Marino extern int can_move_by_pieces (unsigned HOST_WIDE_INT, unsigned int);
369*e4b17023SJohn Marino 
370*e4b17023SJohn Marino extern unsigned HOST_WIDE_INT move_by_pieces_ninsns (unsigned HOST_WIDE_INT,
371*e4b17023SJohn Marino 						     unsigned int,
372*e4b17023SJohn Marino 						     unsigned int);
373*e4b17023SJohn Marino 
374*e4b17023SJohn Marino /* Return nonzero if it is desirable to store LEN bytes generated by
375*e4b17023SJohn Marino    CONSTFUN with several move instructions by store_by_pieces
376*e4b17023SJohn Marino    function.  CONSTFUNDATA is a pointer which will be passed as argument
377*e4b17023SJohn Marino    in every CONSTFUN call.
378*e4b17023SJohn Marino    ALIGN is maximum alignment we can assume.
379*e4b17023SJohn Marino    MEMSETP is true if this is a real memset/bzero, not a copy
380*e4b17023SJohn Marino    of a const string.  */
381*e4b17023SJohn Marino extern int can_store_by_pieces (unsigned HOST_WIDE_INT,
382*e4b17023SJohn Marino 				rtx (*) (void *, HOST_WIDE_INT,
383*e4b17023SJohn Marino 					 enum machine_mode),
384*e4b17023SJohn Marino 				void *, unsigned int, bool);
385*e4b17023SJohn Marino 
386*e4b17023SJohn Marino /* Generate several move instructions to store LEN bytes generated by
387*e4b17023SJohn Marino    CONSTFUN to block TO.  (A MEM rtx with BLKmode).  CONSTFUNDATA is a
388*e4b17023SJohn Marino    pointer which will be passed as argument in every CONSTFUN call.
389*e4b17023SJohn Marino    ALIGN is maximum alignment we can assume.
390*e4b17023SJohn Marino    MEMSETP is true if this is a real memset/bzero, not a copy.
391*e4b17023SJohn Marino    Returns TO + LEN.  */
392*e4b17023SJohn Marino extern rtx store_by_pieces (rtx, unsigned HOST_WIDE_INT,
393*e4b17023SJohn Marino 			    rtx (*) (void *, HOST_WIDE_INT, enum machine_mode),
394*e4b17023SJohn Marino 			    void *, unsigned int, bool, int);
395*e4b17023SJohn Marino 
396*e4b17023SJohn Marino /* Emit insns to set X from Y.  */
397*e4b17023SJohn Marino extern rtx emit_move_insn (rtx, rtx);
398*e4b17023SJohn Marino 
399*e4b17023SJohn Marino /* Emit insns to set X from Y, with no frills.  */
400*e4b17023SJohn Marino extern rtx emit_move_insn_1 (rtx, rtx);
401*e4b17023SJohn Marino 
402*e4b17023SJohn Marino extern rtx emit_move_complex_push (enum machine_mode, rtx, rtx);
403*e4b17023SJohn Marino extern rtx emit_move_complex_parts (rtx, rtx);
404*e4b17023SJohn Marino 
405*e4b17023SJohn Marino /* Push a block of length SIZE (perhaps variable)
406*e4b17023SJohn Marino    and return an rtx to address the beginning of the block.  */
407*e4b17023SJohn Marino extern rtx push_block (rtx, int, int);
408*e4b17023SJohn Marino 
409*e4b17023SJohn Marino /* Generate code to push something onto the stack, given its mode and type.  */
410*e4b17023SJohn Marino extern void emit_push_insn (rtx, enum machine_mode, tree, rtx, unsigned int,
411*e4b17023SJohn Marino 			    int, rtx, int, rtx, rtx, int, rtx);
412*e4b17023SJohn Marino 
413*e4b17023SJohn Marino /* Expand an assignment that stores the value of FROM into TO.  */
414*e4b17023SJohn Marino extern void expand_assignment (tree, tree, bool);
415*e4b17023SJohn Marino 
416*e4b17023SJohn Marino /* Generate code for computing expression EXP,
417*e4b17023SJohn Marino    and storing the value into TARGET.
418*e4b17023SJohn Marino    If SUGGEST_REG is nonzero, copy the value through a register
419*e4b17023SJohn Marino    and return that register, if that is possible.  */
420*e4b17023SJohn Marino extern rtx store_expr (tree, rtx, int, bool);
421*e4b17023SJohn Marino 
422*e4b17023SJohn Marino /* Given an rtx that may include add and multiply operations,
423*e4b17023SJohn Marino    generate them as insns and return a pseudo-reg containing the value.
424*e4b17023SJohn Marino    Useful after calling expand_expr with 1 as sum_ok.  */
425*e4b17023SJohn Marino extern rtx force_operand (rtx, rtx);
426*e4b17023SJohn Marino 
427*e4b17023SJohn Marino /* Work horses for expand_expr.  */
428*e4b17023SJohn Marino extern rtx expand_expr_real (tree, rtx, enum machine_mode,
429*e4b17023SJohn Marino 			     enum expand_modifier, rtx *);
430*e4b17023SJohn Marino extern rtx expand_expr_real_1 (tree, rtx, enum machine_mode,
431*e4b17023SJohn Marino 			       enum expand_modifier, rtx *);
432*e4b17023SJohn Marino extern rtx expand_expr_real_2 (sepops, rtx, enum machine_mode,
433*e4b17023SJohn Marino 			       enum expand_modifier);
434*e4b17023SJohn Marino 
435*e4b17023SJohn Marino /* Generate code for computing expression EXP.
436*e4b17023SJohn Marino    An rtx for the computed value is returned.  The value is never null.
437*e4b17023SJohn Marino    In the case of a void EXP, const0_rtx is returned.  */
438*e4b17023SJohn Marino static inline rtx
expand_expr(tree exp,rtx target,enum machine_mode mode,enum expand_modifier modifier)439*e4b17023SJohn Marino expand_expr (tree exp, rtx target, enum machine_mode mode,
440*e4b17023SJohn Marino 	     enum expand_modifier modifier)
441*e4b17023SJohn Marino {
442*e4b17023SJohn Marino   return expand_expr_real (exp, target, mode, modifier, NULL);
443*e4b17023SJohn Marino }
444*e4b17023SJohn Marino 
445*e4b17023SJohn Marino static inline rtx
expand_normal(tree exp)446*e4b17023SJohn Marino expand_normal (tree exp)
447*e4b17023SJohn Marino {
448*e4b17023SJohn Marino   return expand_expr_real (exp, NULL_RTX, VOIDmode, EXPAND_NORMAL, NULL);
449*e4b17023SJohn Marino }
450*e4b17023SJohn Marino 
451*e4b17023SJohn Marino /* At the start of a function, record that we have no previously-pushed
452*e4b17023SJohn Marino    arguments waiting to be popped.  */
453*e4b17023SJohn Marino extern void init_pending_stack_adjust (void);
454*e4b17023SJohn Marino 
455*e4b17023SJohn Marino /* Discard any pending stack adjustment.  */
456*e4b17023SJohn Marino extern void discard_pending_stack_adjust (void);
457*e4b17023SJohn Marino 
458*e4b17023SJohn Marino /* When exiting from function, if safe, clear out any pending stack adjust
459*e4b17023SJohn Marino    so the adjustment won't get done.  */
460*e4b17023SJohn Marino extern void clear_pending_stack_adjust (void);
461*e4b17023SJohn Marino 
462*e4b17023SJohn Marino /* Pop any previously-pushed arguments that have not been popped yet.  */
463*e4b17023SJohn Marino extern void do_pending_stack_adjust (void);
464*e4b17023SJohn Marino 
465*e4b17023SJohn Marino /* Return the tree node and offset if a given argument corresponds to
466*e4b17023SJohn Marino    a string constant.  */
467*e4b17023SJohn Marino extern tree string_constant (tree, tree *);
468*e4b17023SJohn Marino 
469*e4b17023SJohn Marino /* Generate code to evaluate EXP and jump to LABEL if the value is zero.  */
470*e4b17023SJohn Marino extern void jumpifnot (tree, rtx, int);
471*e4b17023SJohn Marino extern void jumpifnot_1 (enum tree_code, tree, tree, rtx, int);
472*e4b17023SJohn Marino 
473*e4b17023SJohn Marino /* Generate code to evaluate EXP and jump to LABEL if the value is nonzero.  */
474*e4b17023SJohn Marino extern void jumpif (tree, rtx, int);
475*e4b17023SJohn Marino extern void jumpif_1 (enum tree_code, tree, tree, rtx, int);
476*e4b17023SJohn Marino 
477*e4b17023SJohn Marino /* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if
478*e4b17023SJohn Marino    the result is zero, or IF_TRUE_LABEL if the result is one.  */
479*e4b17023SJohn Marino extern void do_jump (tree, rtx, rtx, int);
480*e4b17023SJohn Marino extern void do_jump_1 (enum tree_code, tree, tree, rtx, rtx, int);
481*e4b17023SJohn Marino 
482*e4b17023SJohn Marino extern void do_compare_rtx_and_jump (rtx, rtx, enum rtx_code, int,
483*e4b17023SJohn Marino 				     enum machine_mode, rtx, rtx, rtx, int);
484*e4b17023SJohn Marino 
485*e4b17023SJohn Marino /* Two different ways of generating switch statements.  */
486*e4b17023SJohn Marino extern int try_casesi (tree, tree, tree, tree, rtx, rtx, rtx);
487*e4b17023SJohn Marino extern int try_tablejump (tree, tree, tree, tree, rtx, rtx);
488*e4b17023SJohn Marino 
489*e4b17023SJohn Marino /* Functions from alias.c */
490*e4b17023SJohn Marino #include "alias.h"
491*e4b17023SJohn Marino 
492*e4b17023SJohn Marino 
493*e4b17023SJohn Marino /* rtl.h and tree.h were included.  */
494*e4b17023SJohn Marino /* Return an rtx for the size in bytes of the value of an expr.  */
495*e4b17023SJohn Marino extern rtx expr_size (tree);
496*e4b17023SJohn Marino 
497*e4b17023SJohn Marino /* Return a wide integer for the size in bytes of the value of EXP, or -1
498*e4b17023SJohn Marino    if the size can vary or is larger than an integer.  */
499*e4b17023SJohn Marino extern HOST_WIDE_INT int_expr_size (tree);
500*e4b17023SJohn Marino 
501*e4b17023SJohn Marino /* Return an rtx that refers to the value returned by a function
502*e4b17023SJohn Marino    in its original home.  This becomes invalid if any more code is emitted.  */
503*e4b17023SJohn Marino extern rtx hard_function_value (const_tree, const_tree, const_tree, int);
504*e4b17023SJohn Marino 
505*e4b17023SJohn Marino extern rtx prepare_call_address (tree, rtx, rtx, rtx *, int, int);
506*e4b17023SJohn Marino 
507*e4b17023SJohn Marino extern bool shift_return_value (enum machine_mode, bool, rtx);
508*e4b17023SJohn Marino 
509*e4b17023SJohn Marino extern rtx expand_call (tree, rtx, int);
510*e4b17023SJohn Marino 
511*e4b17023SJohn Marino extern void fixup_tail_calls (void);
512*e4b17023SJohn Marino 
513*e4b17023SJohn Marino #ifdef TREE_CODE
514*e4b17023SJohn Marino extern rtx expand_variable_shift (enum tree_code, enum machine_mode,
515*e4b17023SJohn Marino 				  rtx, tree, rtx, int);
516*e4b17023SJohn Marino extern rtx expand_shift (enum tree_code, enum machine_mode, rtx, int, rtx,
517*e4b17023SJohn Marino 			     int);
518*e4b17023SJohn Marino extern rtx expand_divmod (int, enum tree_code, enum machine_mode, rtx, rtx,
519*e4b17023SJohn Marino 			  rtx, int);
520*e4b17023SJohn Marino #endif
521*e4b17023SJohn Marino 
522*e4b17023SJohn Marino extern void locate_and_pad_parm (enum machine_mode, tree, int, int, tree,
523*e4b17023SJohn Marino 				 struct args_size *,
524*e4b17023SJohn Marino 				 struct locate_and_pad_arg_data *);
525*e4b17023SJohn Marino 
526*e4b17023SJohn Marino /* Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary.  */
527*e4b17023SJohn Marino extern rtx label_rtx (tree);
528*e4b17023SJohn Marino 
529*e4b17023SJohn Marino /* As label_rtx, but additionally the label is placed on the forced label
530*e4b17023SJohn Marino    list of its containing function (i.e. it is treated as reachable even
531*e4b17023SJohn Marino    if how is not obvious).  */
532*e4b17023SJohn Marino extern rtx force_label_rtx (tree);
533*e4b17023SJohn Marino 
534*e4b17023SJohn Marino /* Return an rtx like arg but sans any constant terms.
535*e4b17023SJohn Marino    Returns the original rtx if it has no constant terms.
536*e4b17023SJohn Marino    The constant terms are added and stored via a second arg.  */
537*e4b17023SJohn Marino extern rtx eliminate_constant_term (rtx, rtx *);
538*e4b17023SJohn Marino 
539*e4b17023SJohn Marino /* Convert arg to a valid memory address for specified machine mode that points
540*e4b17023SJohn Marino    to a specific named address space, by emitting insns to perform arithmetic
541*e4b17023SJohn Marino    if necessary.  */
542*e4b17023SJohn Marino extern rtx memory_address_addr_space (enum machine_mode, rtx, addr_space_t);
543*e4b17023SJohn Marino 
544*e4b17023SJohn Marino /* Like memory_address_addr_space, except assume the memory address points to
545*e4b17023SJohn Marino    the generic named address space.  */
546*e4b17023SJohn Marino #define memory_address(MODE,RTX) \
547*e4b17023SJohn Marino 	memory_address_addr_space ((MODE), (RTX), ADDR_SPACE_GENERIC)
548*e4b17023SJohn Marino 
549*e4b17023SJohn Marino /* Return a memory reference like MEMREF, but with its mode changed
550*e4b17023SJohn Marino    to MODE and its address changed to ADDR.
551*e4b17023SJohn Marino    (VOIDmode means don't change the mode.
552*e4b17023SJohn Marino    NULL for ADDR means don't change the address.)  */
553*e4b17023SJohn Marino extern rtx change_address (rtx, enum machine_mode, rtx);
554*e4b17023SJohn Marino 
555*e4b17023SJohn Marino /* Return a memory reference like MEMREF, but with its mode changed
556*e4b17023SJohn Marino    to MODE and its address offset by OFFSET bytes.  */
557*e4b17023SJohn Marino #define adjust_address(MEMREF, MODE, OFFSET) \
558*e4b17023SJohn Marino   adjust_address_1 (MEMREF, MODE, OFFSET, 1, 1)
559*e4b17023SJohn Marino 
560*e4b17023SJohn Marino /* Likewise, but the reference is not required to be valid.  */
561*e4b17023SJohn Marino #define adjust_address_nv(MEMREF, MODE, OFFSET) \
562*e4b17023SJohn Marino   adjust_address_1 (MEMREF, MODE, OFFSET, 0, 1)
563*e4b17023SJohn Marino 
564*e4b17023SJohn Marino /* Return a memory reference like MEMREF, but with its mode changed
565*e4b17023SJohn Marino    to MODE and its address changed to ADDR, which is assumed to be
566*e4b17023SJohn Marino    increased by OFFSET bytes from MEMREF.  */
567*e4b17023SJohn Marino #define adjust_automodify_address(MEMREF, MODE, ADDR, OFFSET) \
568*e4b17023SJohn Marino   adjust_automodify_address_1 (MEMREF, MODE, ADDR, OFFSET, 1)
569*e4b17023SJohn Marino 
570*e4b17023SJohn Marino /* Likewise, but the reference is not required to be valid.  */
571*e4b17023SJohn Marino #define adjust_automodify_address_nv(MEMREF, MODE, ADDR, OFFSET) \
572*e4b17023SJohn Marino   adjust_automodify_address_1 (MEMREF, MODE, ADDR, OFFSET, 0)
573*e4b17023SJohn Marino 
574*e4b17023SJohn Marino extern rtx adjust_address_1 (rtx, enum machine_mode, HOST_WIDE_INT, int, int);
575*e4b17023SJohn Marino extern rtx adjust_automodify_address_1 (rtx, enum machine_mode, rtx,
576*e4b17023SJohn Marino 					HOST_WIDE_INT, int);
577*e4b17023SJohn Marino 
578*e4b17023SJohn Marino /* Return a memory reference like MEMREF, but whose address is changed by
579*e4b17023SJohn Marino    adding OFFSET, an RTX, to it.  POW2 is the highest power of two factor
580*e4b17023SJohn Marino    known to be in OFFSET (possibly 1).  */
581*e4b17023SJohn Marino extern rtx offset_address (rtx, rtx, unsigned HOST_WIDE_INT);
582*e4b17023SJohn Marino 
583*e4b17023SJohn Marino /* Definitions from emit-rtl.c */
584*e4b17023SJohn Marino #include "emit-rtl.h"
585*e4b17023SJohn Marino 
586*e4b17023SJohn Marino /* Return a memory reference like MEMREF, but with its mode widened to
587*e4b17023SJohn Marino    MODE and adjusted by OFFSET.  */
588*e4b17023SJohn Marino extern rtx widen_memory_access (rtx, enum machine_mode, HOST_WIDE_INT);
589*e4b17023SJohn Marino 
590*e4b17023SJohn Marino /* Return a memory reference like MEMREF, but which is known to have a
591*e4b17023SJohn Marino    valid address.  */
592*e4b17023SJohn Marino extern rtx validize_mem (rtx);
593*e4b17023SJohn Marino 
594*e4b17023SJohn Marino extern rtx use_anchored_address (rtx);
595*e4b17023SJohn Marino 
596*e4b17023SJohn Marino /* Given REF, a MEM, and T, either the type of X or the expression
597*e4b17023SJohn Marino    corresponding to REF, set the memory attributes.  OBJECTP is nonzero
598*e4b17023SJohn Marino    if we are making a new object of this type.  */
599*e4b17023SJohn Marino extern void set_mem_attributes (rtx, tree, int);
600*e4b17023SJohn Marino 
601*e4b17023SJohn Marino /* Similar, except that BITPOS has not yet been applied to REF, so if
602*e4b17023SJohn Marino    we alter MEM_OFFSET according to T then we should subtract BITPOS
603*e4b17023SJohn Marino    expecting that it'll be added back in later.  */
604*e4b17023SJohn Marino extern void set_mem_attributes_minus_bitpos (rtx, tree, int, HOST_WIDE_INT);
605*e4b17023SJohn Marino 
606*e4b17023SJohn Marino /* Return OFFSET if XEXP (MEM, 0) - OFFSET is known to be ALIGN
607*e4b17023SJohn Marino    bits aligned for 0 <= OFFSET < ALIGN / BITS_PER_UNIT, or
608*e4b17023SJohn Marino    -1 if not known.  */
609*e4b17023SJohn Marino extern int get_mem_align_offset (rtx, unsigned int);
610*e4b17023SJohn Marino 
611*e4b17023SJohn Marino /* Assemble the static constant template for function entry trampolines.  */
612*e4b17023SJohn Marino extern rtx assemble_trampoline_template (void);
613*e4b17023SJohn Marino 
614*e4b17023SJohn Marino /* Copy given rtx to a new temp reg and return that.  */
615*e4b17023SJohn Marino extern rtx copy_to_reg (rtx);
616*e4b17023SJohn Marino 
617*e4b17023SJohn Marino /* Like copy_to_reg but always make the reg Pmode.  */
618*e4b17023SJohn Marino extern rtx copy_addr_to_reg (rtx);
619*e4b17023SJohn Marino 
620*e4b17023SJohn Marino /* Like copy_to_reg but always make the reg the specified mode MODE.  */
621*e4b17023SJohn Marino extern rtx copy_to_mode_reg (enum machine_mode, rtx);
622*e4b17023SJohn Marino 
623*e4b17023SJohn Marino /* Copy given rtx to given temp reg and return that.  */
624*e4b17023SJohn Marino extern rtx copy_to_suggested_reg (rtx, rtx, enum machine_mode);
625*e4b17023SJohn Marino 
626*e4b17023SJohn Marino /* Copy a value to a register if it isn't already a register.
627*e4b17023SJohn Marino    Args are mode (in case value is a constant) and the value.  */
628*e4b17023SJohn Marino extern rtx force_reg (enum machine_mode, rtx);
629*e4b17023SJohn Marino 
630*e4b17023SJohn Marino /* Return given rtx, copied into a new temp reg if it was in memory.  */
631*e4b17023SJohn Marino extern rtx force_not_mem (rtx);
632*e4b17023SJohn Marino 
633*e4b17023SJohn Marino /* Return mode and signedness to use when an argument or result in the
634*e4b17023SJohn Marino    given mode is promoted.  */
635*e4b17023SJohn Marino extern enum machine_mode promote_function_mode (const_tree, enum machine_mode, int *,
636*e4b17023SJohn Marino 					        const_tree, int);
637*e4b17023SJohn Marino 
638*e4b17023SJohn Marino /* Return mode and signedness to use when an object in the given mode
639*e4b17023SJohn Marino    is promoted.  */
640*e4b17023SJohn Marino extern enum machine_mode promote_mode (const_tree, enum machine_mode, int *);
641*e4b17023SJohn Marino 
642*e4b17023SJohn Marino /* Return mode and signedness to use when object is promoted.  */
643*e4b17023SJohn Marino enum machine_mode promote_decl_mode (const_tree, int *);
644*e4b17023SJohn Marino 
645*e4b17023SJohn Marino /* Remove some bytes from the stack.  An rtx says how many.  */
646*e4b17023SJohn Marino extern void adjust_stack (rtx);
647*e4b17023SJohn Marino 
648*e4b17023SJohn Marino /* Add some bytes to the stack.  An rtx says how many.  */
649*e4b17023SJohn Marino extern void anti_adjust_stack (rtx);
650*e4b17023SJohn Marino 
651*e4b17023SJohn Marino /* Add some bytes to the stack while probing it.  An rtx says how many. */
652*e4b17023SJohn Marino extern void anti_adjust_stack_and_probe (rtx, bool);
653*e4b17023SJohn Marino 
654*e4b17023SJohn Marino /* This enum is used for the following two functions.  */
655*e4b17023SJohn Marino enum save_level {SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL};
656*e4b17023SJohn Marino 
657*e4b17023SJohn Marino /* Save the stack pointer at the specified level.  */
658*e4b17023SJohn Marino extern void emit_stack_save (enum save_level, rtx *);
659*e4b17023SJohn Marino 
660*e4b17023SJohn Marino /* Restore the stack pointer from a save area of the specified level.  */
661*e4b17023SJohn Marino extern void emit_stack_restore (enum save_level, rtx);
662*e4b17023SJohn Marino 
663*e4b17023SJohn Marino /* Invoke emit_stack_save for the nonlocal_goto_save_area.  */
664*e4b17023SJohn Marino extern void update_nonlocal_goto_save_area (void);
665*e4b17023SJohn Marino 
666*e4b17023SJohn Marino /* Allocate some space on the stack dynamically and return its address.  */
667*e4b17023SJohn Marino extern rtx allocate_dynamic_stack_space (rtx, unsigned, unsigned, bool);
668*e4b17023SJohn Marino 
669*e4b17023SJohn Marino /* Emit one stack probe at ADDRESS, an address within the stack.  */
670*e4b17023SJohn Marino extern void emit_stack_probe (rtx);
671*e4b17023SJohn Marino 
672*e4b17023SJohn Marino /* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
673*e4b17023SJohn Marino    FIRST is a constant and size is a Pmode RTX.  These are offsets from
674*e4b17023SJohn Marino    the current stack pointer.  STACK_GROWS_DOWNWARD says whether to add
675*e4b17023SJohn Marino    or subtract them from the stack pointer.  */
676*e4b17023SJohn Marino extern void probe_stack_range (HOST_WIDE_INT, rtx);
677*e4b17023SJohn Marino 
678*e4b17023SJohn Marino /* Return an rtx that refers to the value returned by a library call
679*e4b17023SJohn Marino    in its original home.  This becomes invalid if any more code is emitted.  */
680*e4b17023SJohn Marino extern rtx hard_libcall_value (enum machine_mode, rtx);
681*e4b17023SJohn Marino 
682*e4b17023SJohn Marino /* Return the mode desired by operand N of a particular bitfield
683*e4b17023SJohn Marino    insert/extract insn, or MAX_MACHINE_MODE if no such insn is
684*e4b17023SJohn Marino    available.  */
685*e4b17023SJohn Marino 
686*e4b17023SJohn Marino enum extraction_pattern { EP_insv, EP_extv, EP_extzv };
687*e4b17023SJohn Marino extern enum machine_mode
688*e4b17023SJohn Marino mode_for_extraction (enum extraction_pattern, int);
689*e4b17023SJohn Marino 
690*e4b17023SJohn Marino extern void store_bit_field (rtx, unsigned HOST_WIDE_INT,
691*e4b17023SJohn Marino 			     unsigned HOST_WIDE_INT,
692*e4b17023SJohn Marino 			     unsigned HOST_WIDE_INT,
693*e4b17023SJohn Marino 			     unsigned HOST_WIDE_INT,
694*e4b17023SJohn Marino 			     enum machine_mode, rtx);
695*e4b17023SJohn Marino extern rtx extract_bit_field (rtx, unsigned HOST_WIDE_INT,
696*e4b17023SJohn Marino 			      unsigned HOST_WIDE_INT, int, bool, rtx,
697*e4b17023SJohn Marino 			      enum machine_mode, enum machine_mode);
698*e4b17023SJohn Marino extern rtx extract_low_bits (enum machine_mode, enum machine_mode, rtx);
699*e4b17023SJohn Marino extern rtx expand_mult (enum machine_mode, rtx, rtx, rtx, int);
700*e4b17023SJohn Marino extern rtx expand_mult_highpart_adjust (enum machine_mode, rtx, rtx, rtx, rtx, int);
701*e4b17023SJohn Marino 
702*e4b17023SJohn Marino extern rtx assemble_static_space (unsigned HOST_WIDE_INT);
703*e4b17023SJohn Marino extern int safe_from_p (const_rtx, tree, int);
704*e4b17023SJohn Marino extern bool split_comparison (enum rtx_code, enum machine_mode,
705*e4b17023SJohn Marino 			      enum rtx_code *, enum rtx_code *);
706*e4b17023SJohn Marino 
707*e4b17023SJohn Marino /* Call this once to initialize the contents of the optabs
708*e4b17023SJohn Marino    appropriately for the current target machine.  */
709*e4b17023SJohn Marino extern void init_optabs (void);
710*e4b17023SJohn Marino extern void init_all_optabs (void);
711*e4b17023SJohn Marino 
712*e4b17023SJohn Marino /* Call this to initialize an optab function entry.  */
713*e4b17023SJohn Marino extern rtx init_one_libfunc (const char *);
714*e4b17023SJohn Marino extern rtx set_user_assembler_libfunc (const char *, const char *);
715*e4b17023SJohn Marino 
716*e4b17023SJohn Marino /* Build a decl for a libfunc named NAME. */
717*e4b17023SJohn Marino extern tree build_libfunc_function (const char *);
718*e4b17023SJohn Marino 
719*e4b17023SJohn Marino /* Get the personality libfunc for a function decl.  */
720*e4b17023SJohn Marino rtx get_personality_function (tree);
721*e4b17023SJohn Marino 
722*e4b17023SJohn Marino #endif /* GCC_EXPR_H */
723