]> gcc.gnu.org Git - gcc.git/blame - gcc/rtl.h
(type attribute, movdi movdf insns): Add loadd.
[gcc.git] / gcc / rtl.h
CommitLineData
6f29feb1 1/* Register Transfer Language (RTL) definitions for GNU C-Compiler
3da3fb2f 2 Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc.
6f29feb1
JW
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING. If not, write to
18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20
21#include "machmode.h"
22
23#undef FFS /* Some systems predefine this symbol; don't let it interfere. */
1cfc3092 24#undef FLOAT /* Likewise. */
6f29feb1
JW
25
26/* Register Transfer Language EXPRESSIONS CODES */
27
28#define RTX_CODE enum rtx_code
29enum rtx_code {
30
31#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM ,
32#include "rtl.def" /* rtl expressions are documented here */
33#undef DEF_RTL_EXPR
34
6dc42e49 35 LAST_AND_UNUSED_RTX_CODE}; /* A convenient way to get a value for
6f29feb1 36 NUM_RTX_CODE.
6dc42e49 37 Assumes default enum value assignment. */
6f29feb1
JW
38
39#define NUM_RTX_CODE ((int)LAST_AND_UNUSED_RTX_CODE)
40 /* The cast here, saves many elsewhere. */
41
42extern int rtx_length[];
43#define GET_RTX_LENGTH(CODE) (rtx_length[(int)(CODE)])
44
45extern char *rtx_name[];
46#define GET_RTX_NAME(CODE) (rtx_name[(int)(CODE)])
47
48extern char *rtx_format[];
49#define GET_RTX_FORMAT(CODE) (rtx_format[(int)(CODE)])
50
51extern char rtx_class[];
52#define GET_RTX_CLASS(CODE) (rtx_class[(int)(CODE)])
53\f
54/* Common union for an element of an rtx. */
55
56typedef union rtunion_def
57{
5f4f0e22 58 HOST_WIDE_INT rtwint;
6f29feb1
JW
59 int rtint;
60 char *rtstr;
61 struct rtx_def *rtx;
62 struct rtvec_def *rtvec;
63 enum machine_mode rttype;
64} rtunion;
65
66/* RTL expression ("rtx"). */
67
68typedef struct rtx_def
69{
70#ifdef ONLY_INT_FIELDS
71 unsigned short code;
72#else
73 /* The kind of expression this is. */
74 enum rtx_code code : 16;
75#endif
76 /* The kind of value the expression has. */
77#ifdef ONLY_INT_FIELDS
78 int mode : 8;
79#else
80 enum machine_mode mode : 8;
81#endif
82 /* 1 in an INSN if it can alter flow of control
83 within this function. Not yet used! */
84 unsigned int jump : 1;
85 /* 1 in an INSN if it can call another function. Not yet used! */
86 unsigned int call : 1;
87 /* 1 in a MEM or REG if value of this expression will never change
88 during the current function, even though it is not
89 manifestly constant.
90 1 in a SYMBOL_REF if it addresses something in the per-function
91 constants pool.
92 1 in a CALL_INSN if it is a const call.
93 1 in a JUMP_INSN if it is a branch that should be annulled. Valid from
94 reorg until end of compilation; cleared before used. */
95 unsigned int unchanging : 1;
96 /* 1 in a MEM expression if contents of memory are volatile.
97 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL or BARRIER
98 if it is deleted.
99 1 in a REG expression if corresponds to a variable declared by the user.
100 0 for an internally generated temporary.
101 In a SYMBOL_REF, this flag is used for machine-specific purposes. */
102 unsigned int volatil : 1;
103 /* 1 in a MEM referring to a field of a structure (not a union!).
104 0 if the MEM was a variable or the result of a * operator in C;
105 1 if it was the result of a . or -> operator (on a struct) in C.
106 1 in a REG if the register is used only in exit code a loop.
107 1 in a CODE_LABEL if the label is used for nonlocal gotos
108 and must not be deleted even if its count is zero.
109 1 in a LABEL_REF if this is a reference to a label outside the
110 current loop.
111 1 in an INSN, JUMP_INSN, or CALL_INSN if this insn must be scheduled
d45cf215 112 together with the preceding insn. Valid only within sched.
6f29feb1
JW
113 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
114 from the target of a branch. Valid from reorg until end of compilation;
115 cleared before used. */
116 unsigned int in_struct : 1;
117 /* 1 if this rtx is used. This is used for copying shared structure.
118 See `unshare_all_rtl'.
119 In a REG, this is not needed for that purpose, and used instead
120 in `leaf_renumber_regs_insn'.
121 In a SYMBOL_REF, means that emit_library_call
122 has used it as the function. */
123 unsigned int used : 1;
124 /* Nonzero if this rtx came from procedure integration.
125 In a REG, nonzero means this reg refers to the return value
126 of the current function. */
127 unsigned integrated : 1;
128 /* The first element of the operands of this rtx.
129 The number of operands and their types are controlled
130 by the `code' field, according to rtl.def. */
131 rtunion fld[1];
132} *rtx;
133
f837a861
MM
134/* Add prototype support. */
135#ifndef PROTO
136#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
137#define PROTO(ARGS) ARGS
138#else
139#define PROTO(ARGS) ()
140#endif
141#endif
142
6f29feb1
JW
143#define NULL_RTX (rtx) 0
144
5f4f0e22
CH
145/* Define a generic NULL if one hasn't already been defined. */
146
147#ifndef NULL
148#define NULL 0
149#endif
150
f837a861
MM
151#ifndef GENERIC_PTR
152#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
153#define GENERIC_PTR void *
154#else
155#define GENERIC_PTR char *
156#endif
157#endif
158
5f4f0e22 159#ifndef NULL_PTR
f837a861 160#define NULL_PTR ((GENERIC_PTR)0)
5f4f0e22
CH
161#endif
162
6f29feb1
JW
163/* Define macros to access the `code' field of the rtx. */
164
165#ifdef SHORT_ENUM_BUG
166#define GET_CODE(RTX) ((enum rtx_code) ((RTX)->code))
167#define PUT_CODE(RTX, CODE) ((RTX)->code = ((short) (CODE)))
168#else
169#define GET_CODE(RTX) ((RTX)->code)
170#define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
171#endif
172
173#define GET_MODE(RTX) ((RTX)->mode)
174#define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE))
175
176#define RTX_INTEGRATED_P(RTX) ((RTX)->integrated)
177#define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging)
178
179/* RTL vector. These appear inside RTX's when there is a need
180 for a variable number of things. The principle use is inside
181 PARALLEL expressions. */
182
183typedef struct rtvec_def{
184 unsigned num_elem; /* number of elements */
185 rtunion elem[1];
186} *rtvec;
187
188#define NULL_RTVEC (rtvec) 0
189
190#define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
191#define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (unsigned) NUM)
192
193#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[(I)].rtx)
194
195/* 1 if X is a REG. */
196
197#define REG_P(X) (GET_CODE (X) == REG)
198
199/* 1 if X is a constant value that is an integer. */
200
201#define CONSTANT_P(X) \
202 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
203 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
204 || GET_CODE (X) == CONST || GET_CODE (X) == HIGH)
205
206/* General accessor macros for accessing the fields of an rtx. */
207
208#define XEXP(RTX, N) ((RTX)->fld[N].rtx)
209#define XINT(RTX, N) ((RTX)->fld[N].rtint)
5f4f0e22 210#define XWINT(RTX, N) ((RTX)->fld[N].rtwint)
6f29feb1
JW
211#define XSTR(RTX, N) ((RTX)->fld[N].rtstr)
212#define XVEC(RTX, N) ((RTX)->fld[N].rtvec)
213#define XVECLEN(RTX, N) ((RTX)->fld[N].rtvec->num_elem)
214#define XVECEXP(RTX,N,M)((RTX)->fld[N].rtvec->elem[M].rtx)
215\f
216/* ACCESS MACROS for particular fields of insns. */
217
218/* Holds a unique number for each insn.
219 These are not necessarily sequentially increasing. */
220#define INSN_UID(INSN) ((INSN)->fld[0].rtint)
221
222/* Chain insns together in sequence. */
223#define PREV_INSN(INSN) ((INSN)->fld[1].rtx)
224#define NEXT_INSN(INSN) ((INSN)->fld[2].rtx)
225
226/* The body of an insn. */
227#define PATTERN(INSN) ((INSN)->fld[3].rtx)
228
229/* Code number of instruction, from when it was recognized.
230 -1 means this instruction has not been recognized yet. */
231#define INSN_CODE(INSN) ((INSN)->fld[4].rtint)
232
233/* Set up in flow.c; empty before then.
234 Holds a chain of INSN_LIST rtx's whose first operands point at
235 previous insns with direct data-flow connections to this one.
236 That means that those insns set variables whose next use is in this insn.
237 They are always in the same basic block as this insn. */
238#define LOG_LINKS(INSN) ((INSN)->fld[5].rtx)
239
240/* 1 if insn has been deleted. */
241#define INSN_DELETED_P(INSN) ((INSN)->volatil)
242
243/* 1 if insn is a call to a const function. */
244#define CONST_CALL_P(INSN) ((INSN)->unchanging)
245
246/* 1 if insn is a branch that should not unconditionally execute its
247 delay slots, i.e., it is an annulled branch. */
248#define INSN_ANNULLED_BRANCH_P(INSN) ((INSN)->unchanging)
249
250/* 1 if insn is in a delay slot and is from the target of the branch. If
6dc42e49 251 the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
6f29feb1
JW
252 executed if the branch is taken. For annulled branches with this bit
253 clear, the insn should be executed only if the branch is not taken. */
254#define INSN_FROM_TARGET_P(INSN) ((INSN)->in_struct)
255
256/* Holds a list of notes on what this insn does to various REGs.
257 It is a chain of EXPR_LIST rtx's, where the second operand
258 is the chain pointer and the first operand is the REG being described.
259 The mode field of the EXPR_LIST contains not a real machine mode
260 but a value that says what this note says about the REG:
261 REG_DEAD means that the value in REG dies in this insn (i.e., it is
262 not needed past this insn). If REG is set in this insn, the REG_DEAD
263 note may, but need not, be omitted.
264 REG_INC means that the REG is autoincremented or autodecremented.
265 REG_EQUIV describes the insn as a whole; it says that the
266 insn sets a register to a constant value or to be equivalent to
267 a memory address. If the
268 register is spilled to the stack then the constant value
269 should be substituted for it. The contents of the REG_EQUIV
270 is the constant value or memory address, which may be different
271 from the source of the SET although it has the same value.
272 REG_EQUAL is like REG_EQUIV except that the destination
273 is only momentarily equal to the specified rtx. Therefore, it
274 cannot be used for substitution; but it can be used for cse.
275 REG_RETVAL means that this insn copies the return-value of
276 a library call out of the hard reg for return values. This note
277 is actually an INSN_LIST and it points to the first insn involved
278 in setting up arguments for the call. flow.c uses this to delete
279 the entire library call when its result is dead.
280 REG_LIBCALL is the inverse of REG_RETVAL: it goes on the first insn
281 of the library call and points at the one that has the REG_RETVAL.
282 REG_WAS_0 says that the register set in this insn held 0 before the insn.
283 The contents of the note is the insn that stored the 0.
284 If that insn is deleted or patched to a NOTE, the REG_WAS_0 is inoperative.
285 The REG_WAS_0 note is actually an INSN_LIST, not an EXPR_LIST.
286 REG_NONNEG means that the register is always nonnegative during
287 the containing loop. This is used in branches so that decrement and
288 branch instructions terminating on zero can be matched. There must be
289 an insn pattern in the md file named `decrement_and_branch_until_zero'
290 or else this will never be added to any instructions.
291 REG_NO_CONFLICT means there is no conflict *after this insn*
292 between the register in the note and the destination of this insn.
293 REG_UNUSED identifies a register set in this insn and never used.
294 REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use
295 CC0, respectively. Normally, these are required to be consecutive insns,
296 but we permit putting a cc0-setting insn in the delay slot of a branch
297 as long as only one copy of the insn exists. In that case, these notes
298 point from one to the other to allow code generation to determine what
299 any require information and to properly update CC_STATUS.
300 REG_LABEL points to a CODE_LABEL. Used by non-JUMP_INSNs to
301 say that the CODE_LABEL contained in the REG_LABEL note is used
302 by the insn.
d45cf215 303 REG_DEP_ANTI is used in LOG_LINKS which represent anti (write after read)
6f29feb1
JW
304 dependencies. REG_DEP_OUTPUT is used in LOG_LINKS which represent output
305 (write after write) dependencies. Data dependencies, which are the only
306 type of LOG_LINK created by flow, are represented by a 0 reg note kind. */
307
308#define REG_NOTES(INSN) ((INSN)->fld[6].rtx)
309
310/* Don't forget to change reg_note_name in rtl.c. */
311enum reg_note { REG_DEAD = 1, REG_INC = 2, REG_EQUIV = 3, REG_WAS_0 = 4,
312 REG_EQUAL = 5, REG_RETVAL = 6, REG_LIBCALL = 7,
313 REG_NONNEG = 8, REG_NO_CONFLICT = 9, REG_UNUSED = 10,
314 REG_CC_SETTER = 11, REG_CC_USER = 12, REG_LABEL = 13,
315 REG_DEP_ANTI = 14, REG_DEP_OUTPUT = 15 };
316
317/* Define macros to extract and insert the reg-note kind in an EXPR_LIST. */
318#define REG_NOTE_KIND(LINK) ((enum reg_note) GET_MODE (LINK))
319#define PUT_REG_NOTE_KIND(LINK,KIND) PUT_MODE(LINK, (enum machine_mode) (KIND))
320
321/* Names for REG_NOTE's in EXPR_LIST insn's. */
322
323extern char *reg_note_name[];
324#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)])
325
326/* The label-number of a code-label. The assembler label
327 is made from `L' and the label-number printed in decimal.
328 Label numbers are unique in a compilation. */
329#define CODE_LABEL_NUMBER(INSN) ((INSN)->fld[3].rtint)
330
331#define LINE_NUMBER NOTE
332
333/* In a NOTE that is a line number, this is a string for the file name
3da3fb2f
RK
334 that the line is in. We use the same field to record block numbers
335 temporarily in NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes.
336 (We avoid lots of casts between ints and pointers if we use a
337 different macro for the bock number.) */
6f29feb1
JW
338
339#define NOTE_SOURCE_FILE(INSN) ((INSN)->fld[3].rtstr)
3da3fb2f 340#define NOTE_BLOCK_NUMBER(INSN) ((INSN)->fld[3].rtint)
6f29feb1
JW
341
342/* In a NOTE that is a line number, this is the line number.
343 Other kinds of NOTEs are identified by negative numbers here. */
344#define NOTE_LINE_NUMBER(INSN) ((INSN)->fld[4].rtint)
345
346/* Codes that appear in the NOTE_LINE_NUMBER field
347 for kinds of notes that are not line numbers. */
348
349/* This note indicates the end of the real body of the function,
350 after moving the parms into their homes, etc. */
351#define NOTE_INSN_FUNCTION_BEG 0
352
353/* This note is used to get rid of an insn
354 when it isn't safe to patch the insn out of the chain. */
355#define NOTE_INSN_DELETED -1
356#define NOTE_INSN_BLOCK_BEG -2
357#define NOTE_INSN_BLOCK_END -3
358#define NOTE_INSN_LOOP_BEG -4
359#define NOTE_INSN_LOOP_END -5
360/* This kind of note is generated at the end of the function body,
361 just before the return insn or return label.
362 In an optimizing compilation it is deleted by the first jump optimization,
363 after enabling that optimizer to determine whether control can fall
364 off the end of the function body without a return statement. */
365#define NOTE_INSN_FUNCTION_END -6
366/* This kind of note is generated just after each call to `setjmp', et al. */
367#define NOTE_INSN_SETJMP -7
368/* Generated at the place in a loop that `continue' jumps to. */
369#define NOTE_INSN_LOOP_CONT -8
370/* Generated at the start of a duplicated exit test. */
371#define NOTE_INSN_LOOP_VTOP -9
bdac5f58
TW
372/* This marks the point immediately after the last prologue insn. */
373#define NOTE_INSN_PROLOGUE_END -10
374/* This marks the point immediately prior to the first epilogue insn. */
375#define NOTE_INSN_EPILOGUE_BEG -11
196cedd0
RS
376/* Generated in place of user-declared labels when they are deleted. */
377#define NOTE_INSN_DELETED_LABEL -12
6f29feb1
JW
378/* Don't forget to change note_insn_name in rtl.c. */
379
10f07067
RS
380
381#if 0 /* These are not used, and I don't know what they were for. --rms. */
6f29feb1
JW
382#define NOTE_DECL_NAME(INSN) ((INSN)->fld[3].rtstr)
383#define NOTE_DECL_CODE(INSN) ((INSN)->fld[4].rtint)
384#define NOTE_DECL_RTL(INSN) ((INSN)->fld[5].rtx)
385#define NOTE_DECL_IDENTIFIER(INSN) ((INSN)->fld[6].rtint)
386#define NOTE_DECL_TYPE(INSN) ((INSN)->fld[7].rtint)
10f07067 387#endif /* 0 */
6f29feb1
JW
388
389/* Names for NOTE insn's other than line numbers. */
390
391extern char *note_insn_name[];
392#define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)])
393
394/* The name of a label, in case it corresponds to an explicit label
395 in the input source code. */
396#define LABEL_NAME(LABEL) ((LABEL)->fld[4].rtstr)
397
398/* In jump.c, each label contains a count of the number
399 of LABEL_REFs that point at it, so unused labels can be deleted. */
400#define LABEL_NUSES(LABEL) ((LABEL)->fld[5].rtint)
401
402/* In jump.c, each JUMP_INSN can point to a label that it can jump to,
403 so that if the JUMP_INSN is deleted, the label's LABEL_NUSES can
404 be decremented and possibly the label can be deleted. */
405#define JUMP_LABEL(INSN) ((INSN)->fld[7].rtx)
406
407/* Once basic blocks are found in flow.c,
408 each CODE_LABEL starts a chain that goes through
409 all the LABEL_REFs that jump to that label.
410 The chain eventually winds up at the CODE_LABEL; it is circular. */
411#define LABEL_REFS(LABEL) ((LABEL)->fld[5].rtx)
412\f
413/* This is the field in the LABEL_REF through which the circular chain
414 of references to a particular label is linked.
415 This chain is set up in flow.c. */
416
417#define LABEL_NEXTREF(REF) ((REF)->fld[1].rtx)
418
419/* Once basic blocks are found in flow.c,
420 Each LABEL_REF points to its containing instruction with this field. */
421
422#define CONTAINING_INSN(RTX) ((RTX)->fld[2].rtx)
423
424/* For a REG rtx, REGNO extracts the register number. */
425
426#define REGNO(RTX) ((RTX)->fld[0].rtint)
427
428/* For a REG rtx, REG_FUNCTION_VALUE_P is nonzero if the reg
429 is the current function's return value. */
430
431#define REG_FUNCTION_VALUE_P(RTX) ((RTX)->integrated)
432
433/* 1 in a REG rtx if it corresponds to a variable declared by the user. */
434#define REG_USERVAR_P(RTX) ((RTX)->volatil)
435
436/* For a CONST_INT rtx, INTVAL extracts the integer. */
437
5f4f0e22 438#define INTVAL(RTX) ((RTX)->fld[0].rtwint)
6f29feb1
JW
439
440/* For a SUBREG rtx, SUBREG_REG extracts the value we want a subreg of.
441 SUBREG_WORD extracts the word-number. */
442
443#define SUBREG_REG(RTX) ((RTX)->fld[0].rtx)
444#define SUBREG_WORD(RTX) ((RTX)->fld[1].rtint)
445
446/* Access various components of an ASM_OPERANDS rtx. */
447
448#define ASM_OPERANDS_TEMPLATE(RTX) XSTR ((RTX), 0)
449#define ASM_OPERANDS_OUTPUT_CONSTRAINT(RTX) XSTR ((RTX), 1)
450#define ASM_OPERANDS_OUTPUT_IDX(RTX) XINT ((RTX), 2)
451#define ASM_OPERANDS_INPUT_VEC(RTX) XVEC ((RTX), 3)
452#define ASM_OPERANDS_INPUT_CONSTRAINT_VEC(RTX) XVEC ((RTX), 4)
453#define ASM_OPERANDS_INPUT(RTX, N) XVECEXP ((RTX), 3, (N))
454#define ASM_OPERANDS_INPUT_LENGTH(RTX) XVECLEN ((RTX), 3)
455#define ASM_OPERANDS_INPUT_CONSTRAINT(RTX, N) XSTR (XVECEXP ((RTX), 4, (N)), 0)
456#define ASM_OPERANDS_INPUT_MODE(RTX, N) GET_MODE (XVECEXP ((RTX), 4, (N)))
457#define ASM_OPERANDS_SOURCE_FILE(RTX) XSTR ((RTX), 5)
458#define ASM_OPERANDS_SOURCE_LINE(RTX) XINT ((RTX), 6)
459
460/* For a MEM rtx, 1 if it's a volatile reference.
461 Also in an ASM_OPERANDS rtx. */
462#define MEM_VOLATILE_P(RTX) ((RTX)->volatil)
463
464/* For a MEM rtx, 1 if it refers to a structure or union component. */
465#define MEM_IN_STRUCT_P(RTX) ((RTX)->in_struct)
466
467/* For a LABEL_REF, 1 means that this reference is to a label outside the
468 loop containing the reference. */
469#define LABEL_OUTSIDE_LOOP_P(RTX) ((RTX)->in_struct)
470
adfaf10a
RS
471/* For a LABEL_REF, 1 means it is for a nonlocal label. */
472#define LABEL_REF_NONLOCAL_P(RTX) ((RTX)->volatil)
473
6f29feb1
JW
474/* For a CODE_LABEL, 1 means always consider this label to be needed. */
475#define LABEL_PRESERVE_P(RTX) ((RTX)->in_struct)
476
477/* For a REG, 1 means the register is used only in an exit test of a loop. */
478#define REG_LOOP_TEST_P(RTX) ((RTX)->in_struct)
479
480/* During sched, for an insn, 1 means that the insn must be scheduled together
d45cf215 481 with the preceding insn. */
6f29feb1
JW
482#define SCHED_GROUP_P(INSN) ((INSN)->in_struct)
483
484/* For a SET rtx, SET_DEST is the place that is set
485 and SET_SRC is the value it is set to. */
486#define SET_DEST(RTX) ((RTX)->fld[0].rtx)
487#define SET_SRC(RTX) ((RTX)->fld[1].rtx)
488
489/* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
490#define TRAP_CONDITION(RTX) ((RTX)->fld[0].rtx)
491
492/* 1 in a SYMBOL_REF if it addresses this function's constants pool. */
493#define CONSTANT_POOL_ADDRESS_P(RTX) ((RTX)->unchanging)
494
495/* Flag in a SYMBOL_REF for machine-specific purposes. */
496#define SYMBOL_REF_FLAG(RTX) ((RTX)->volatil)
497
498/* 1 means a SYMBOL_REF has been the library function in emit_library_call. */
499#define SYMBOL_REF_USED(RTX) ((RTX)->used)
500
501/* For an INLINE_HEADER rtx, FIRST_FUNCTION_INSN is the first insn
502 of the function that is not involved in copying parameters to
503 pseudo-registers. FIRST_PARM_INSN is the very first insn of
504 the function, including the parameter copying.
505 We keep this around in case we must splice
506 this function into the assembly code at the end of the file.
507 FIRST_LABELNO is the first label number used by the function (inclusive).
508 LAST_LABELNO is the last label used by the function (exclusive).
509 MAX_REGNUM is the largest pseudo-register used by that function.
510 FUNCTION_ARGS_SIZE is the size of the argument block in the stack.
511 POPS_ARGS is the number of bytes of input arguments popped by the function
512 STACK_SLOT_LIST is the list of stack slots.
513 FUNCTION_FLAGS are where single-bit flags are saved.
514 OUTGOING_ARGS_SIZE is the size of the largest outgoing stack parameter list.
515 ORIGINAL_ARG_VECTOR is a vector of the original DECL_RTX values
516 for the function arguments.
517 ORIGINAL_DECL_INITIAL is a pointer to the original DECL_INITIAL for the
518 function.
519
520 We want this to lay down like an INSN. The PREV_INSN field
521 is always NULL. The NEXT_INSN field always points to the
522 first function insn of the function being squirreled away. */
523
524#define FIRST_FUNCTION_INSN(RTX) ((RTX)->fld[2].rtx)
525#define FIRST_PARM_INSN(RTX) ((RTX)->fld[3].rtx)
526#define FIRST_LABELNO(RTX) ((RTX)->fld[4].rtint)
527#define LAST_LABELNO(RTX) ((RTX)->fld[5].rtint)
528#define MAX_PARMREG(RTX) ((RTX)->fld[6].rtint)
529#define MAX_REGNUM(RTX) ((RTX)->fld[7].rtint)
530#define FUNCTION_ARGS_SIZE(RTX) ((RTX)->fld[8].rtint)
531#define POPS_ARGS(RTX) ((RTX)->fld[9].rtint)
532#define STACK_SLOT_LIST(RTX) ((RTX)->fld[10].rtx)
533#define FUNCTION_FLAGS(RTX) ((RTX)->fld[11].rtint)
534#define OUTGOING_ARGS_SIZE(RTX) ((RTX)->fld[12].rtint)
535#define ORIGINAL_ARG_VECTOR(RTX) ((RTX)->fld[13].rtvec)
536#define ORIGINAL_DECL_INITIAL(RTX) ((RTX)->fld[14].rtx)
537
538/* In FUNCTION_FLAGS we save some variables computed when emitting the code
539 for the function and which must be `or'ed into the current flag values when
540 insns from that function are being inlined. */
541
542/* These ought to be an enum, but non-ANSI compilers don't like that. */
543#define FUNCTION_FLAGS_CALLS_ALLOCA 01
544#define FUNCTION_FLAGS_CALLS_SETJMP 02
545#define FUNCTION_FLAGS_RETURNS_STRUCT 04
546#define FUNCTION_FLAGS_RETURNS_PCC_STRUCT 010
547#define FUNCTION_FLAGS_NEEDS_CONTEXT 020
548#define FUNCTION_FLAGS_HAS_NONLOCAL_LABEL 040
549#define FUNCTION_FLAGS_RETURNS_POINTER 0100
550#define FUNCTION_FLAGS_USES_CONST_POOL 0200
551#define FUNCTION_FLAGS_CALLS_LONGJMP 0400
552#define FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE 01000
553
554/* Define a macro to look for REG_INC notes,
555 but save time on machines where they never exist. */
556
58e54c44
RS
557/* Don't continue this line--convex cc version 4.1 would lose. */
558#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
6f29feb1
JW
559#define FIND_REG_INC_NOTE(insn, reg) (find_reg_note ((insn), REG_INC, (reg)))
560#else
561#define FIND_REG_INC_NOTE(insn, reg) 0
562#endif
563
564/* Indicate whether the machine has any sort of auto increment addressing.
565 If not, we can avoid checking for REG_INC notes. */
566
58e54c44
RS
567/* Don't continue this line--convex cc version 4.1 would lose. */
568#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
6f29feb1
JW
569#define AUTO_INC_DEC
570#endif
571\f
572/* Generally useful functions. */
573
5f4f0e22
CH
574/* The following functions accept a wide integer argument. Rather than
575 having to cast on every function call, we use a macro instead, that is
576 defined here and in tree.h. */
577
578#ifndef exact_log2
579#define exact_log2(N) exact_log2_wide ((HOST_WIDE_INT) (N))
580#define floor_log2(N) floor_log2_wide ((HOST_WIDE_INT) (N))
581#endif
582
583#define plus_constant(X,C) plus_constant_wide (X, (HOST_WIDE_INT) (C))
584
585#define plus_constant_for_output(X,C) \
586 plus_constant_for_output_wide (X, (HOST_WIDE_INT) (C))
587
f837a861
MM
588extern rtx plus_constant_wide PROTO((rtx, HOST_WIDE_INT));
589extern rtx plus_constant_for_output_wide PROTO((rtx, HOST_WIDE_INT));
5f4f0e22
CH
590
591#define GEN_INT(N) gen_rtx (CONST_INT, VOIDmode, (N))
592
f837a861
MM
593#if 0
594/* We cannot define prototypes for the variable argument functions,
595 since they have not been ANSI-fied, and an ANSI compiler would
596 complain when compiling the definition of these functions. */
5f4f0e22 597
f837a861
MM
598extern rtx gen_rtx PROTO((enum rtx_code, enum machine_mode, ...));
599extern rtvec gen_rtvec PROTO((int, ...));
600
601#else
602extern rtx gen_rtx ();
6f29feb1 603extern rtvec gen_rtvec ();
f837a861
MM
604#endif
605
606#ifdef BUFSIZ /* stdio.h has been included */
607extern rtx read_rtx PROTO((FILE *));
608#else
1cfc3092 609extern rtx read_rtx ();
f837a861
MM
610#endif
611
612#if 0
613/* At present, don't prototype xrealloc, since all of the callers don't
614 cast their pointers to char *, and all of the xrealloc's don't use
615 void * yet. */
616extern char *xrealloc PROTO((void *, unsigned));
617#else
618extern char *xrealloc ();
619#endif
620
621extern char *xmalloc PROTO((unsigned));
622extern char *oballoc PROTO((int));
623extern char *permalloc PROTO((int));
624extern void free PROTO((void *));
625extern rtx rtx_alloc PROTO((RTX_CODE));
626extern rtvec rtvec_alloc PROTO((int));
627extern rtx find_reg_note PROTO((rtx, enum reg_note, rtx));
628extern rtx find_regno_note PROTO((rtx, enum reg_note, int));
629extern HOST_WIDE_INT get_integer_term PROTO((rtx));
630extern rtx get_related_value PROTO((rtx));
631extern rtx single_set PROTO((rtx));
632extern rtx find_last_value PROTO((rtx, rtx *, rtx));
633extern rtx copy_rtx PROTO((rtx));
634extern rtx copy_rtx_if_shared PROTO((rtx));
635extern rtx copy_most_rtx PROTO((rtx, rtx));
636extern rtx replace_rtx PROTO((rtx, rtx, rtx));
637extern rtvec gen_rtvec_v PROTO((int, rtx *));
638extern rtx gen_reg_rtx PROTO((enum machine_mode));
639extern rtx gen_label_rtx PROTO((void));
640extern rtx gen_inline_header_rtx PROTO((rtx, rtx, int, int, int, int, int, int, rtx, int, int, rtvec, rtx));
641extern rtx gen_lowpart_common PROTO((enum machine_mode, rtx));
642extern rtx gen_lowpart PROTO((enum machine_mode, rtx));
643extern rtx gen_lowpart_if_possible PROTO((enum machine_mode, rtx));
644extern rtx operand_subword PROTO((rtx, int, int, enum machine_mode));
645extern rtx operand_subword_force PROTO((rtx, int, enum machine_mode));
646extern int subreg_lowpart_p PROTO((rtx));
647extern rtx make_safe_from PROTO((rtx, rtx));
648extern rtx memory_address PROTO((enum machine_mode, rtx));
649extern rtx get_insns PROTO((void));
650extern rtx get_last_insn PROTO((void));
651extern rtx get_last_insn_anywhere PROTO((void));
652extern void start_sequence PROTO((void));
653extern void push_to_sequence PROTO((rtx));
654extern void end_sequence PROTO((void));
655extern rtx gen_sequence PROTO((void));
656extern rtx immed_double_const PROTO((HOST_WIDE_INT, HOST_WIDE_INT, enum machine_mode));
657extern rtx force_const_mem PROTO((enum machine_mode, rtx));
658extern rtx force_reg PROTO((enum machine_mode, rtx));
659extern rtx get_pool_constant PROTO((rtx));
660extern enum machine_mode get_pool_mode PROTO((rtx));
661extern int get_pool_offset PROTO((rtx));
662extern rtx assign_stack_local PROTO((enum machine_mode, int, int));
663extern rtx assign_stack_temp PROTO((enum machine_mode, int, int));
664extern rtx protect_from_queue PROTO((rtx, int));
665extern void emit_queue PROTO((void));
666extern rtx emit_move_insn PROTO((rtx, rtx));
667extern rtx emit_insn_before PROTO((rtx, rtx));
668extern rtx emit_jump_insn_before PROTO((rtx, rtx));
669extern rtx emit_call_insn_before PROTO((rtx, rtx));
670extern rtx emit_barrier_before PROTO((rtx));
671extern rtx emit_note_before PROTO((int, rtx));
672extern rtx emit_insn_after PROTO((rtx, rtx));
673extern rtx emit_jump_insn_after PROTO((rtx, rtx));
674extern rtx emit_barrier_after PROTO((rtx));
675extern rtx emit_label_after PROTO((rtx, rtx));
676extern rtx emit_note_after PROTO((int, rtx));
677extern rtx emit_line_note_after PROTO((char *, int, rtx));
678extern rtx emit_insn PROTO((rtx));
679extern rtx emit_insns PROTO((rtx));
680extern rtx emit_insns_before PROTO((rtx, rtx));
681extern rtx emit_jump_insn PROTO((rtx));
682extern rtx emit_call_insn PROTO((rtx));
683extern rtx emit_label PROTO((rtx));
684extern rtx emit_barrier PROTO((void));
685extern rtx emit_line_note PROTO((char *, int));
686extern rtx emit_note PROTO((char *, int));
687extern rtx emit_line_note_force PROTO((char *, int));
688extern rtx make_insn_raw PROTO((rtx));
689extern rtx previous_insn PROTO((rtx));
690extern rtx next_insn PROTO((rtx));
691extern rtx prev_nonnote_insn PROTO((rtx));
692extern rtx next_nonnote_insn PROTO((rtx));
693extern rtx prev_real_insn PROTO((rtx));
694extern rtx next_real_insn PROTO((rtx));
695extern rtx prev_active_insn PROTO((rtx));
696extern rtx next_active_insn PROTO((rtx));
697extern rtx prev_label PROTO((rtx));
698extern rtx next_label PROTO((rtx));
699extern rtx next_cc0_user PROTO((rtx));
700extern rtx prev_cc0_setter PROTO((rtx));
701extern rtx reg_set_last PROTO((rtx, rtx));
702extern rtx next_nondeleted_insn PROTO((rtx));
703extern enum rtx_code reverse_condition PROTO((enum rtx_code));
704extern enum rtx_code swap_condition PROTO((enum rtx_code));
705extern enum rtx_code unsigned_condition PROTO((enum rtx_code));
706extern enum rtx_code signed_condition PROTO((enum rtx_code));
707extern rtx find_equiv_reg PROTO((rtx, rtx, enum reg_class, int, short *, int, enum machine_mode));
708extern rtx squeeze_notes PROTO((rtx, rtx));
709extern rtx delete_insn PROTO((rtx));
710extern void delete_jump PROTO((rtx));
711extern rtx get_label_before PROTO((rtx));
712extern rtx get_label_after PROTO((rtx));
713extern rtx follow_jumps PROTO((rtx));
714extern rtx adj_offsettable_operand PROTO((rtx, int));
715extern rtx try_split PROTO((rtx, rtx, int));
716extern rtx split_insns PROTO((rtx, rtx));
717extern rtx simplify_unary_operation PROTO((enum rtx_code, enum machine_mode, rtx, enum machine_mode));
718extern rtx simplify_binary_operation PROTO((enum rtx_code, enum machine_mode, rtx, rtx));
719extern rtx simplify_ternary_operation PROTO((enum rtx_code, enum machine_mode, enum machine_mode, rtx, rtx, rtx));
720extern rtx simplify_relational_operation PROTO((enum rtx_code, enum machine_mode, rtx, rtx));
721extern rtx nonlocal_label_rtx_list PROTO((void));
722extern rtx gen_move_insn PROTO((rtx, rtx));
723extern rtx gen_jump PROTO((rtx));
724extern rtx gen_beq PROTO((rtx));
725extern rtx gen_bge PROTO((rtx));
726extern rtx gen_ble PROTO((rtx));
727extern rtx eliminate_constant_term PROTO((rtx, rtx *));
6f29feb1
JW
728
729/* Maximum number of parallel sets and clobbers in any insn in this fn.
730 Always at least 3, since the combiner could put that many togetherm
731 and we want this to remain correct for all the remaining passes. */
732
733extern int max_parallel;
734
f837a861
MM
735extern int asm_noperands PROTO((rtx));
736extern char *decode_asm_operands PROTO((rtx, rtx *, rtx **, char **, enum machine_mode *));
6f29feb1 737
f837a861
MM
738extern enum reg_class reg_preferred_class PROTO((int));
739extern enum reg_class reg_alternate_class PROTO((int));
6f29feb1 740
f837a861 741extern rtx get_first_nonparm_insn PROTO((void));
6f29feb1
JW
742
743/* Standard pieces of rtx, to be substituted directly into things. */
744extern rtx pc_rtx;
745extern rtx cc0_rtx;
746extern rtx const0_rtx;
747extern rtx const1_rtx;
a8efe40d 748extern rtx const2_rtx;
6f29feb1
JW
749extern rtx constm1_rtx;
750extern rtx const_true_rtx;
a8efe40d
RK
751
752extern rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
753
754/* Returns a constant 0 rtx in mode MODE. Integer modes are treated the
755 same as VOIDmode. */
756
757#define CONST0_RTX(MODE) (const_tiny_rtx[0][(int) (MODE)])
758
759/* Likewise, for the constants 1 and 2. */
760
761#define CONST1_RTX(MODE) (const_tiny_rtx[1][(int) (MODE)])
762#define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
6f29feb1
JW
763
764/* All references to certain hard regs, except those created
765 by allocating pseudo regs into them (when that's possible),
766 go through these unique rtx objects. */
767extern rtx stack_pointer_rtx;
768extern rtx frame_pointer_rtx;
769extern rtx arg_pointer_rtx;
770extern rtx pic_offset_table_rtx;
771extern rtx struct_value_rtx;
772extern rtx struct_value_incoming_rtx;
773extern rtx static_chain_rtx;
774extern rtx static_chain_incoming_rtx;
775
776/* Virtual registers are used during RTL generation to refer to locations into
777 the stack frame when the actual location isn't known until RTL generation
778 is complete. The routine instantiate_virtual_regs replaces these with
779 the proper value, which is normally {frame,arg,stack}_pointer_rtx plus
780 a constant. */
781
782#define FIRST_VIRTUAL_REGISTER (FIRST_PSEUDO_REGISTER)
783
784/* This points to the first word of the incoming arguments passed on the stack,
785 either by the caller or by the callee when pretending it was passed by the
786 caller. */
787
788extern rtx virtual_incoming_args_rtx;
789
790#define VIRTUAL_INCOMING_ARGS_REGNUM (FIRST_VIRTUAL_REGISTER)
791
792/* If FRAME_GROWS_DOWNWARDS, this points to immediately above the first
793 variable on the stack. Otherwise, it points to the first variable on
794 the stack. */
795
796extern rtx virtual_stack_vars_rtx;
797
798#define VIRTUAL_STACK_VARS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 1)
799
800/* This points to the location of dynamically-allocated memory on the stack
801 immediately after the stack pointer has been adjusted by the amount
802 desired. */
803
804extern rtx virtual_stack_dynamic_rtx;
805
806#define VIRTUAL_STACK_DYNAMIC_REGNUM ((FIRST_VIRTUAL_REGISTER) + 2)
807
808/* This points to the location in the stack at which outgoing arguments should
809 be written when the stack is pre-pushed (arguments pushed using push
810 insns always use sp). */
811
812extern rtx virtual_outgoing_args_rtx;
813
814#define VIRTUAL_OUTGOING_ARGS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 3)
815
816#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 3)
817
f837a861
MM
818extern rtx find_next_ref PROTO((rtx, rtx));
819extern rtx *find_single_use PROTO((rtx, rtx, rtx *));
820
821/* It is hard to write the prototype for expand_expr, since it needs
822 expr.h to be included for the enumeration. */
823
824extern rtx expand_expr ();
825extern rtx immed_real_const_1();
826
827#ifdef TREE_CODE
828/* rtl.h and tree.h were included. */
829extern rtx output_constant_def PROTO((tree));
830extern rtx immed_real_const PROTO((tree));
831extern rtx immed_real_const_1 PROTO((REAL_VALUE_TYPE, enum machine_mode));
832extern tree make_tree PROTO((tree, rtx));
833
834#else
835extern rtx output_constant_def ();
836extern rtx immed_real_const ();
837extern rtx immed_real_const_1 ();
838#endif
6f29feb1
JW
839
840/* Define a default value for STORE_FLAG_VALUE. */
841
842#ifndef STORE_FLAG_VALUE
843#define STORE_FLAG_VALUE 1
844#endif
845
846/* Nonzero after end of reload pass.
847 Set to 1 or 0 by toplev.c. */
848
849extern int reload_completed;
850
851/* Set to 1 while reload_as_needed is operating.
852 Required by some machines to handle any generated moves differently. */
853
854extern int reload_in_progress;
855
856/* If this is nonzero, we do not bother generating VOLATILE
857 around volatile memory references, and we are willing to
858 output indirect addresses. If cse is to follow, we reject
859 indirect addresses so a useful potential cse is generated;
860 if it is used only once, instruction combination will produce
861 the same indirect address eventually. */
862extern int cse_not_expected;
863
864/* Indexed by pseudo register number, gives the rtx for that pseudo.
865 Allocated in parallel with regno_pointer_flag. */
866extern rtx *regno_reg_rtx;
This page took 0.153918 seconds and 5 git commands to generate.