00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef GCC_RTL_H
00029 #define GCC_RTL_H
00030
00031 struct function;
00032
00033 #include "machmode.h"
00034
00035 #undef FFS
00036 #undef FLOAT
00037 #undef ABS
00038 #undef PC
00039
00040
00041
00042 #define NOOP_MOVE_INSN_CODE INT_MAX
00043
00044
00045
00046 #define RTX_CODE enum rtx_code
00047 enum rtx_code {
00048
00049 #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM ,
00050 #include "rtl.def"
00051 #undef DEF_RTL_EXPR
00052
00053 LAST_AND_UNUSED_RTX_CODE};
00054
00055
00056
00057 #define NUM_RTX_CODE ((int) LAST_AND_UNUSED_RTX_CODE)
00058
00059
00060 extern const unsigned char rtx_length[NUM_RTX_CODE];
00061 #define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
00062
00063 extern const char * const rtx_name[NUM_RTX_CODE];
00064 #define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)])
00065
00066 extern const char * const rtx_format[NUM_RTX_CODE];
00067 #define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
00068
00069 extern const char rtx_class[NUM_RTX_CODE];
00070 #define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
00071
00072 extern const unsigned char rtx_next[NUM_RTX_CODE];
00073
00074
00075
00076 typedef struct
00077 {
00078
00079 unsigned min_align: 8;
00080
00081 unsigned base_after_vec: 1;
00082 unsigned min_after_vec: 1;
00083
00084 unsigned max_after_vec: 1;
00085
00086 unsigned min_after_base: 1;
00087
00088 unsigned max_after_base: 1;
00089
00090
00091 unsigned offset_unsigned: 1;
00092 unsigned : 2;
00093 unsigned scale : 8;
00094 } addr_diff_vec_flags;
00095
00096
00097
00098
00099
00100
00101
00102
00103 typedef struct mem_attrs GTY(())
00104 {
00105 HOST_WIDE_INT alias;
00106 tree expr;
00107 rtx offset;
00108 rtx size;
00109 unsigned int align;
00110 } mem_attrs;
00111
00112
00113
00114 union rtunion_def
00115 {
00116 HOST_WIDE_INT rtwint;
00117 int rtint;
00118 unsigned int rtuint;
00119 const char *rtstr;
00120 rtx rtx;
00121 rtvec rtvec;
00122 enum machine_mode rttype;
00123 addr_diff_vec_flags rt_addr_diff_vec_flags;
00124 struct cselib_val_struct *rt_cselib;
00125 struct bitmap_head_def *rtbit;
00126 tree rttree;
00127 struct basic_block_def *bb;
00128 mem_attrs *rtmem;
00129 };
00130 typedef union rtunion_def rtunion;
00131
00132
00133
00134 struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"),
00135 chain_prev ("RTX_PREV (&%h)")))
00136 {
00137 /* The kind of expression this is. */
00138 ENUM_BITFIELD(rtx_code) code: 16;
00139
00140 /* The kind of value the expression has. */
00141 ENUM_BITFIELD(machine_mode) mode : 8;
00142
00143 /* 1 in a MEM if we should keep the alias set for this mem unchanged
00144 when we access a component.
00145 1 in a CALL_INSN if it is a sibling call.
00146 1 in a SET that is for a return.
00147 In a CODE_LABEL, part of the two-bit alternate entry field. */
00148 unsigned int jump : 1;
00149 /* In a CODE_LABEL, part of the two-bit alternate entry field.
00150 1 in a MEM if it cannot trap. */
00151 unsigned int call : 1;
00152 /* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere.
00153 1 in a SUBREG if it references an unsigned object whose mode has been
00154 from a promoted to a wider mode.
00155 1 in a SYMBOL_REF if it addresses something in the per-function
00156 constants pool.
00157 1 in a CALL_INSN, NOTE, or EXPR_LIST for a const or pure call.
00158 1 in a JUMP_INSN, CALL_INSN, or INSN of an annulling branch. */
00159 unsigned int unchanging : 1;
00160 /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile.
00161 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE
00162 if it has been deleted.
00163 1 in a REG expression if corresponds to a variable declared by the user,
00164 0 for an internally generated temporary.
00165 1 in a SUBREG with a negative value.
00166 1 in a LABEL_REF or in a REG_LABEL note for a non-local label.
00167 In a SYMBOL_REF, this flag is used for machine-specific purposes. */
00168 unsigned int volatil : 1;
00169 /* 1 in a MEM referring to a field of an aggregate.
00170 0 if the MEM was a variable or the result of a * operator in C;
00171 1 if it was the result of a . or -> operator (on a struct) in C.
00172 1 in a REG if the register is used only in exit code a loop.
00173 1 in a SUBREG expression if was generated from a variable with a
00174 promoted mode.
00175 1 in a CODE_LABEL if the label is used for nonlocal gotos
00176 and must not be deleted even if its count is zero.
00177 1 in a LABEL_REF if this is a reference to a label outside the
00178 current loop.
00179 1 in an INSN, JUMP_INSN or CALL_INSN if this insn must be scheduled
00180 together with the preceding insn. Valid only within sched.
00181 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
00182 from the target of a branch. Valid from reorg until end of compilation;
00183 cleared before used.
00184 1 in an INSN or related rtx if this insn is dead code. Valid only during
00185 dead-code elimination phase; cleared before use. */
00186 unsigned int in_struct : 1;
00187 /* At the end of RTL generation, 1 if this rtx is used. This is used for
00188 copying shared structure. See `unshare_all_rtl'.
00189 In a REG, this is not needed for that purpose, and used instead
00190 in `leaf_renumber_regs_insn'.
00191 1 in a SYMBOL_REF, means that emit_library_call
00192 has used it as the function. */
00193 unsigned int used : 1;
00194 /* Nonzero if this rtx came from procedure integration.
00195 1 in a REG or PARALLEL means this rtx refers to the return value
00196 of the current function.
00197 1 in a SYMBOL_REF if the symbol is weak. */
00198 unsigned integrated : 1;
00199 /* 1 in an INSN or a SET if this rtx is related to the call frame,
00200 either changing how we compute the frame address or saving and
00201 restoring registers in the prologue and epilogue.
00202 1 in a MEM if the MEM refers to a scalar, rather than a member of
00203 an aggregate.
00204 1 in a REG if the register is a pointer.
00205 1 in a SYMBOL_REF if it addresses something in the per-function
00206 constant string pool. */
00207 unsigned frame_related : 1;
00208
00209 /* The first element of the operands of this rtx.
00210 The number of operands and their types are controlled
00211 by the `code' field, according to rtl.def. */
00212 rtunion GTY ((special ("rtx_def"),
00213 desc ("GET_CODE (&%0)"))) fld[1];
00214 };
00215
00216 #define NULL_RTX (rtx) 0
00217
00218 /* The "next" and "previous" RTX, relative to this one. */
00219
00220 #define RTX_NEXT(X) (rtx_next[GET_CODE (X)] == 0 ? NULL \
00221 : *(rtx *)(((char *)X) + rtx_next[GET_CODE (X)]))
00222
00223 /* FIXME: the "NEXT_INSN (PREV_INSN (X)) == X" condition shouldn't be needed.
00224 */
00225 #define RTX_PREV(X) ((GET_CODE (X) == INSN \
00226 || GET_CODE (X) == CALL_INSN \
00227 || GET_CODE (X) == JUMP_INSN \
00228 || GET_CODE (X) == NOTE \
00229 || GET_CODE (X) == BARRIER \
00230 || GET_CODE (X) == CODE_LABEL) \
00231 && PREV_INSN (X) != NULL \
00232 && NEXT_INSN (PREV_INSN (X)) == X \
00233 ? PREV_INSN (X) : NULL)
00234
00235 /* Define macros to access the `code' field of the rtx. */
00236
00237 #define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
00238 #define PUT_CODE(RTX, CODE) ((RTX)->code = (ENUM_BITFIELD(rtx_code)) (CODE))
00239
00240 #define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
00241 #define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
00242
00243 /* RTL vector. These appear inside RTX's when there is a need
00244 for a variable number of things. The principle use is inside
00245 PARALLEL expressions. */
00246
00247 struct rtvec_def GTY(()) {
00248 int num_elem; /* number of elements */
00249 rtx GTY ((length ("%h.num_elem"))) elem[1];
00250 };
00251
00252 #define NULL_RTVEC (rtvec) 0
00253
00254 #define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
00255 #define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (NUM))
00256
00257 /* Predicate yielding nonzero iff X is an rtl for a register. */
00258 #define REG_P(X) (GET_CODE (X) == REG)
00259
00260 /* Predicate yielding nonzero iff X is a label insn. */
00261 #define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)
00262
00263 /* Predicate yielding nonzero iff X is a jump insn. */
00264 #define JUMP_P(X) (GET_CODE (X) == JUMP_INSN)
00265
00266 /* Predicate yielding nonzero iff X is a note insn. */
00267 #define NOTE_P(X) (GET_CODE (X) == NOTE)
00268
00269 /* Predicate yielding nonzero iff X is a barrier insn. */
00270 #define BARRIER_P(X) (GET_CODE (X) == BARRIER)
00271
00272 /* Predicate yielding nonzero iff X is cc0. */
00273 #ifdef HAVE_cc0
00274 #define CC0_P(X) ((X) == cc0_rtx)
00275 #else
00276 #define CC0_P(X) 0
00277 #endif
00278
00279 /* Predicate yielding nonzero iff X is a data for a jump table. */
00280 #define JUMP_TABLE_DATA_P(INSN) \
00281 (JUMP_P (INSN) && (GET_CODE (PATTERN (INSN)) == ADDR_VEC || \
00282 GET_CODE (PATTERN (INSN)) == ADDR_DIFF_VEC))
00283
00284 /* 1 if X is a constant value that is an integer. */
00285
00286 #define CONSTANT_P(X) \
00287 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
00288 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
00289 || GET_CODE (X) == CONST || GET_CODE (X) == HIGH \
00290 || GET_CODE (X) == CONST_VECTOR \
00291 || GET_CODE (X) == CONSTANT_P_RTX)
00292
00293 /* General accessor macros for accessing the fields of an rtx. */
00294
00295 #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
00296 /* The bit with a star outside the statement expr and an & inside is
00297 so that N can be evaluated only once. */
00298 #define RTL_CHECK1(RTX, N, C1) __extension__ \
00299 (*({ rtx const _rtx = (RTX); const int _n = (N); \
00300 const enum rtx_code _code = GET_CODE (_rtx); \
00301 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
00302 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
00303 __FUNCTION__); \
00304 if (GET_RTX_FORMAT(_code)[_n] != C1) \
00305 rtl_check_failed_type1 (_rtx, _n, C1, __FILE__, __LINE__, \
00306 __FUNCTION__); \
00307 &_rtx->fld[_n]; }))
00308
00309 #define RTL_CHECK2(RTX, N, C1, C2) __extension__ \
00310 (*({ rtx const _rtx = (RTX); const int _n = (N); \
00311 const enum rtx_code _code = GET_CODE (_rtx); \
00312 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
00313 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
00314 __FUNCTION__); \
00315 if (GET_RTX_FORMAT(_code)[_n] != C1 \
00316 && GET_RTX_FORMAT(_code)[_n] != C2) \
00317 rtl_check_failed_type2 (_rtx, _n, C1, C2, __FILE__, __LINE__, \
00318 __FUNCTION__); \
00319 &_rtx->fld[_n]; }))
00320
00321 #define RTL_CHECKC1(RTX, N, C) __extension__ \
00322 (*({ rtx const _rtx = (RTX); const int _n = (N); \
00323 if (GET_CODE (_rtx) != (C)) \
00324 rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
00325 __FUNCTION__); \
00326 &_rtx->fld[_n]; }))
00327
00328 #define RTL_CHECKC2(RTX, N, C1, C2) __extension__ \
00329 (*({ rtx const _rtx = (RTX); const int _n = (N); \
00330 const enum rtx_code _code = GET_CODE (_rtx); \
00331 if (_code != (C1) && _code != (C2)) \
00332 rtl_check_failed_code2 (_rtx, (C1), (C2), __FILE__, __LINE__, \
00333 __FUNCTION__); \
00334 &_rtx->fld[_n]; }))
00335
00336 #define RTVEC_ELT(RTVEC, I) __extension__ \
00337 (*({ rtvec const _rtvec = (RTVEC); const int _i = (I); \
00338 if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \
00339 rtvec_check_failed_bounds (_rtvec, _i, __FILE__, __LINE__, \
00340 __FUNCTION__); \
00341 &_rtvec->elem[_i]; }))
00342
00343 extern void rtl_check_failed_bounds PARAMS ((rtx, int,
00344 const char *, int, const char *))
00345 ATTRIBUTE_NORETURN;
00346 extern void rtl_check_failed_type1 PARAMS ((rtx, int, int,
00347 const char *, int, const char *))
00348 ATTRIBUTE_NORETURN;
00349 extern void rtl_check_failed_type2 PARAMS ((rtx, int, int, int,
00350 const char *, int, const char *))
00351 ATTRIBUTE_NORETURN;
00352 extern void rtl_check_failed_code1 PARAMS ((rtx, enum rtx_code,
00353 const char *, int, const char *))
00354 ATTRIBUTE_NORETURN;
00355 extern void rtl_check_failed_code2 PARAMS ((rtx, enum rtx_code, enum rtx_code,
00356 const char *, int, const char *))
00357 ATTRIBUTE_NORETURN;
00358 extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
00359 const char *, int, const char *))
00360 ATTRIBUTE_NORETURN;
00361
00362 #else /* not ENABLE_RTL_CHECKING */
00363
00364 #define RTL_CHECK1(RTX, N, C1) ((RTX)->fld[N])
00365 #define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->fld[N])
00366 #define RTL_CHECKC1(RTX, N, C) ((RTX)->fld[N])
00367 #define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->fld[N])
00368 #define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
00369
00370 #endif
00371
00372 /* General accessor macros for accessing the flags of an rtx. */
00373
00374 /* Access an individual rtx flag, with no checking of any kind. */
00375 #define RTX_FLAG(RTX, FLAG) ((RTX)->FLAG)
00376
00377 #if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION >= 2007)
00378 #define RTL_FLAG_CHECK1(NAME, RTX, C1) __extension__ \
00379 ({ rtx const _rtx = (RTX); \
00380 if (GET_CODE(_rtx) != C1) \
00381 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
00382 __FUNCTION__); \
00383 _rtx; })
00384
00385 #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) __extension__ \
00386 ({ rtx const _rtx = (RTX); \
00387 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2) \
00388 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
00389 __FUNCTION__); \
00390 _rtx; })
00391
00392 #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) __extension__ \
00393 ({ rtx const _rtx = (RTX); \
00394 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
00395 && GET_CODE(_rtx) != C3) \
00396 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
00397 __FUNCTION__); \
00398 _rtx; })
00399
00400 #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) __extension__ \
00401 ({ rtx const _rtx = (RTX); \
00402 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
00403 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4) \
00404 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
00405 __FUNCTION__); \
00406 _rtx; })
00407
00408 #define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) __extension__ \
00409 ({ rtx const _rtx = (RTX); \
00410 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
00411 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
00412 && GET_CODE(_rtx) != C5) \
00413 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
00414 __FUNCTION__); \
00415 _rtx; })
00416
00417 #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) \
00418 __extension__ \
00419 ({ rtx const _rtx = (RTX); \
00420 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
00421 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
00422 && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6) \
00423 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
00424 __FUNCTION__); \
00425 _rtx; })
00426
00427 #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) \
00428 __extension__ \
00429 ({ rtx const _rtx = (RTX); \
00430 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
00431 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
00432 && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
00433 && GET_CODE(_rtx) != C7) \
00434 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
00435 __FUNCTION__); \
00436 _rtx; })
00437
00438 #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) \
00439 __extension__ \
00440 ({ rtx const _rtx = (RTX); \
00441 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
00442 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
00443 && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
00444 && GET_CODE(_rtx) != C7 && GET_CODE(_rtx) != C8) \
00445 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
00446 __FUNCTION__); \
00447 _rtx; })
00448
00449 extern void rtl_check_failed_flag PARAMS ((const char *, rtx, const char *,
00450 int, const char *))
00451 ATTRIBUTE_NORETURN
00452 ;
00453
00454 #else /* not ENABLE_RTL_FLAG_CHECKING */
00455
00456 #define RTL_FLAG_CHECK1(NAME, RTX, C1) (RTX)
00457 #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) (RTX)
00458 #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) (RTX)
00459 #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) (RTX)
00460 #define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX)
00461 #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) (RTX)
00462 #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) (RTX)
00463 #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX)
00464 #endif
00465
00466 #define CLEAR_RTX_FLAGS(RTX) \
00467 do { \
00468 rtx const _rtx = (RTX); \
00469 _rtx->call = 0; \
00470 _rtx->frame_related = 0; \
00471 _rtx->in_struct = 0; \
00472 _rtx->integrated = 0; \
00473 _rtx->jump = 0; \
00474 _rtx->unchanging = 0; \
00475 _rtx->used = 0; \
00476 _rtx->volatil = 0; \
00477 } while (0)
00478
00479 #define XWINT(RTX, N) (RTL_CHECK1 (RTX, N, 'w').rtwint)
00480 #define XINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rtint)
00481 #define XSTR(RTX, N) (RTL_CHECK2 (RTX, N, 's', 'S').rtstr)
00482 #define XEXP(RTX, N) (RTL_CHECK2 (RTX, N, 'e', 'u').rtx)
00483 #define XVEC(RTX, N) (RTL_CHECK2 (RTX, N, 'E', 'V').rtvec)
00484 #define XMODE(RTX, N) (RTL_CHECK1 (RTX, N, 'M').rttype)
00485 #define XBITMAP(RTX, N) (RTL_CHECK1 (RTX, N, 'b').rtbit)
00486 #define XTREE(RTX, N) (RTL_CHECK1 (RTX, N, 't').rttree)
00487 #define XBBDEF(RTX, N) (RTL_CHECK1 (RTX, N, 'B').bb)
00488 #define XTMPL(RTX, N) (RTL_CHECK1 (RTX, N, 'T').rtstr)
00489
00490 #define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M)
00491 #define XVECLEN(RTX, N) GET_NUM_ELEM (XVEC (RTX, N))
00492
00493 /* These are like XWINT, etc. except that they expect a '0' field instead
00494 of the normal type code. */
00495
00496 #define X0WINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtwint)
00497 #define X0INT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtint)
00498 #define X0UINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtuint)
00499 #define X0STR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtstr)
00500 #define X0EXP(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtx)
00501 #define X0VEC(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtvec)
00502 #define X0MODE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rttype)
00503 #define X0BITMAP(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtbit)
00504 #define X0TREE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rttree)
00505 #define X0BBDEF(RTX, N) (RTL_CHECK1 (RTX, N, '0').bb)
00506 #define X0ADVFLAGS(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_addr_diff_vec_flags)
00507 #define X0CSELIB(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_cselib)
00508 #define X0MEMATTR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtmem)
00509
00510 #define XCWINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtwint)
00511 #define XCINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtint)
00512 #define XCUINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtuint)
00513 #define XCSTR(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtstr)
00514 #define XCEXP(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtx)
00515 #define XCVEC(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtvec)
00516 #define XCMODE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rttype)
00517 #define XCBITMAP(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtbit)
00518 #define XCTREE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rttree)
00519 #define XCBBDEF(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).bb)
00520 #define XCADVFLAGS(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_addr_diff_vec_flags)
00521 #define XCCSELIB(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_cselib)
00522
00523 #define XCVECEXP(RTX, N, M, C) RTVEC_ELT (XCVEC (RTX, N, C), M)
00524 #define XCVECLEN(RTX, N, C) GET_NUM_ELEM (XCVEC (RTX, N, C))
00525
00526 #define XC2EXP(RTX, N, C1, C2) (RTL_CHECKC2 (RTX, N, C1, C2).rtx)
00527
00528 /* ACCESS MACROS for particular fields of insns. */
00529
00530 /* Determines whether X is an insn. */
00531 #define INSN_P(X) (GET_RTX_CLASS (GET_CODE(X)) == 'i')
00532
00533 /* Holds a unique number for each insn.
00534 These are not necessarily sequentially increasing. */
00535 #define INSN_UID(INSN) XINT (INSN, 0)
00536
00537 /* Chain insns together in sequence. */
00538 #define PREV_INSN(INSN) XEXP (INSN, 1)
00539 #define NEXT_INSN(INSN) XEXP (INSN, 2)
00540
00541 #define BLOCK_FOR_INSN(INSN) XBBDEF (INSN, 3)
00542 #define INSN_SCOPE(INSN) XTREE (INSN, 4)
00543 /* The body of an insn. */
00544 #define PATTERN(INSN) XEXP (INSN, 5)
00545
00546 /* Code number of instruction, from when it was recognized.
00547 -1 means this instruction has not been recognized yet. */
00548 #define INSN_CODE(INSN) XINT (INSN, 6)
00549
00550 /* Set up in flow.c; empty before then.
00551 Holds a chain of INSN_LIST rtx's whose first operands point at
00552 previous insns with direct data-flow connections to this one.
00553 That means that those insns set variables whose next use is in this insn.
00554 They are always in the same basic block as this insn. */
00555 #define LOG_LINKS(INSN) XEXP(INSN, 7)
00556
00557 #define RTX_INTEGRATED_P(RTX) \
00558 (RTL_FLAG_CHECK8("RTX_INTEGRATED_P", (RTX), INSN, CALL_INSN, \
00559 JUMP_INSN, INSN_LIST, BARRIER, CODE_LABEL, CONST, \
00560 NOTE)->integrated)
00561 #define RTX_UNCHANGING_P(RTX) \
00562 (RTL_FLAG_CHECK3("RTX_UNCHANGING_P", (RTX), REG, MEM, CONCAT)->unchanging)
00563 #define RTX_FRAME_RELATED_P(RTX) \
00564 (RTL_FLAG_CHECK5("RTX_FRAME_RELATED_P", (RTX), INSN, CALL_INSN, \
00565 JUMP_INSN, BARRIER, SET)->frame_related)
00566
00567 /* 1 if RTX is an insn that has been deleted. */
00568 #define INSN_DELETED_P(RTX) \
00569 (RTL_FLAG_CHECK6("INSN_DELETED_P", (RTX), INSN, CALL_INSN, JUMP_INSN, \
00570 CODE_LABEL, BARRIER, NOTE)->volatil)
00571
00572 /* 1 if RTX is a call to a const or pure function. */
00573 #define CONST_OR_PURE_CALL_P(RTX) \
00574 (RTL_FLAG_CHECK3("CONST_OR_PURE_CALL_P", (RTX), CALL_INSN, NOTE, \
00575 EXPR_LIST)->unchanging)
00576
00577 /* 1 if RTX is a call_insn for a sibling call. */
00578 #define SIBLING_CALL_P(RTX) \
00579 (RTL_FLAG_CHECK1("SIBLING_CALL_P", (RTX), CALL_INSN)->jump)
00580
00581 /* 1 if RTX is a jump_insn, call_insn, or insn that is an annulling branch. */
00582 #define INSN_ANNULLED_BRANCH_P(RTX) \
00583 (RTL_FLAG_CHECK3("INSN_ANNULLED_BRANCH_P", (RTX), JUMP_INSN, CALL_INSN, INSN)->unchanging)
00584
00585 /* 1 if RTX is an insn that is dead code. Valid only for dead-code
00586 elimination phase. */
00587 #define INSN_DEAD_CODE_P(RTX) \
00588 (RTL_FLAG_CHECK1("INSN_DEAD_CODE_P", (RTX), INSN)->in_struct)
00589
00590 /* 1 if RTX is an insn in a delay slot and is from the target of the branch.
00591 If the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
00592 executed if the branch is taken. For annulled branches with this bit
00593 clear, the insn should be executed only if the branch is not taken. */
00594 #define INSN_FROM_TARGET_P(RTX) \
00595 (RTL_FLAG_CHECK3("INSN_FROM_TARGET_P", (RTX), INSN, JUMP_INSN, CALL_INSN)->in_struct)
00596
00597 #define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS(RTX, 4)
00598
00599 #define CSELIB_VAL_PTR(RTX) X0CSELIB(RTX, 0)
00600
00601 /* Holds a list of notes on what this insn does to various REGs.
00602 It is a chain of EXPR_LIST rtx's, where the second operand is the
00603 chain pointer and the first operand is the REG being described.
00604 The mode field of the EXPR_LIST contains not a real machine mode
00605 but a value from enum reg_note. */
00606
00607 #define REG_NOTES(INSN) XEXP(INSN, 8)
00608
00609 /* Don't forget to change reg_note_name in rtl.c. */
00610 enum reg_note
00611 {
00612 /* The value in REG dies in this insn (i.e., it is not needed past
00613 this insn). If REG is set in this insn, the REG_DEAD note may,
00614 but need not, be omitted. */
00615 REG_DEAD = 1,
00616
00617 /* The REG is autoincremented or autodecremented. */
00618 REG_INC,
00619
00620 /* Describes the insn as a whole; it says that the insn sets a register
00621 to a constant value or to be equivalent to a memory address. If the
00622 register is spilled to the stack then the constant value should be
00623 substituted for it. The contents of the REG_EQUIV is the constant
00624 value or memory address, which may be different from the source of
00625 the SET although it has the same value. A REG_EQUIV note may also
00626 appear on an insn which copies a register parameter to a pseudo-register,
00627 if there is a memory address which could be used to hold that
00628 pseudo-register throughout the function. */
00629 REG_EQUIV,
00630
00631 /* Like REG_EQUIV except that the destination is only momentarily equal
00632 to the specified rtx. Therefore, it cannot be used for substitution;
00633 but it can be used for cse. */
00634 REG_EQUAL,
00635
00636 /* The register set in this insn held 0 before the insn. The contents of
00637 the note is the insn that stored the 0. If that insn is deleted or
00638 patched to a NOTE, the REG_WAS_0 is inoperative. The REG_WAS_0 note
00639 is actually an INSN_LIST, not an EXPR_LIST. */
00640 REG_WAS_0,
00641
00642 /* This insn copies the return-value of a library call out of the hard reg
00643 for return values. This note is actually an INSN_LIST and it points to
00644 the first insn involved in setting up arguments for the call. flow.c
00645 uses this to delete the entire library call when its result is dead. */
00646 REG_RETVAL,
00647
00648 /* The inverse of REG_RETVAL: it goes on the first insn of the library call
00649 and points at the one that has the REG_RETVAL. This note is also an
00650 INSN_LIST. */
00651 REG_LIBCALL,
00652
00653 /* The register is always nonnegative during the containing loop. This is
00654 used in branches so that decrement and branch instructions terminating
00655 on zero can be matched. There must be an insn pattern in the md file
00656 named `decrement_and_branch_until_zero' or else this will never be added
00657 to any instructions. */
00658 REG_NONNEG,
00659
00660 /* There is no conflict *after this insn* between the register in the note
00661 and the destination of this insn. */
00662 REG_NO_CONFLICT,
00663
00664 /* Identifies a register set in this insn and never used. */
00665 REG_UNUSED,
00666
00667 /* REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use CC0,
00668 respectively. Normally, these are required to be consecutive insns, but
00669 we permit putting a cc0-setting insn in the delay slot of a branch as
00670 long as only one copy of the insn exists. In that case, these notes
00671 point from one to the other to allow code generation to determine what
00672 any require information and to properly update CC_STATUS. These notes
00673 are INSN_LISTs. */
00674 REG_CC_SETTER, REG_CC_USER,
00675
00676 /* Points to a CODE_LABEL. Used by non-JUMP_INSNs to say that the
00677 CODE_LABEL contained in the REG_LABEL note is used by the insn.
00678 This note is an INSN_LIST. */
00679 REG_LABEL,
00680
00681 /* REG_DEP_ANTI and REG_DEP_OUTPUT are used in LOG_LINKS to represent
00682 write-after-read and write-after-write dependencies respectively.
00683 Data dependencies, which are the only type of LOG_LINK created by
00684 flow, are represented by a 0 reg note kind. */
00685 REG_DEP_ANTI, REG_DEP_OUTPUT,
00686
00687 /* REG_BR_PROB is attached to JUMP_INSNs and CALL_INSNs.
00688 It has an integer value. For jumps, it is the probability that this is a
00689 taken branch. For calls, it is the probability that this call won't
00690 return. */
00691 REG_BR_PROB,
00692
00693 /* Attached to a call insn; indicates that the call is malloc-like and
00694 that the pointer returned cannot alias anything else. */
00695 REG_NOALIAS,
00696
00697 /* Used to optimize rtl generated by dynamic stack allocations for targets
00698 where SETJMP_VIA_SAVE_AREA is true. */
00699 REG_SAVE_AREA,
00700
00701 /* REG_BR_PRED is attached to JUMP_INSNs and CALL_INSNSs. It contains
00702 CONCAT of two integer value. First specifies the branch predictor
00703 that added the note, second specifies the predicted hitrate of branch
00704 in the same format as REG_BR_PROB note uses. */
00705 REG_BR_PRED,
00706
00707 /* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
00708 for DWARF to interpret what they imply. The attached rtx is used
00709 instead of intuition. */
00710 REG_FRAME_RELATED_EXPR,
00711
00712 /* Indicates that REG holds the exception context for the function.
00713 This context is shared by inline functions, so the code to acquire
00714 the real exception context is delayed until after inlining. */
00715 REG_EH_CONTEXT,
00716
00717 /* Indicates what exception region an INSN belongs in. This is used to
00718 indicate what region to which a call may throw. REGION 0 indicates
00719 that a call cannot throw at all. REGION -1 indicates that it cannot
00720 throw, nor will it execute a non-local goto. */
00721 REG_EH_REGION,
00722
00723 /* Used by haifa-sched to save NOTE_INSN notes across scheduling. */
00724 REG_SAVE_NOTE,
00725
00726 /* Indicates that this insn (which is part of the prologue) computes
00727 a value which might not be used later, and if so it's OK to delete
00728 the insn. Normally, deleting any insn in the prologue is an error.
00729 At present the parameter is unused and set to (const_int 0). */
00730 REG_MAYBE_DEAD,
00731
00732 /* Indicates that a call does not return. */
00733 REG_NORETURN,
00734
00735 /* Indicates that an indirect jump is a non-local goto instead of a
00736 computed goto. */
00737 REG_NON_LOCAL_GOTO,
00738
00739 /* This kind of note is generated at each to `setjmp',
00740 and similar functions that can return twice. */
00741 REG_SETJMP,
00742
00743 /* Indicate calls that always returns. */
00744 REG_ALWAYS_RETURN,
00745
00746 /* Indicate that the memory load references a vtable. The expression
00747 is of the form (plus (symbol_ref vtable_sym) (const_int offset)). */
00748 REG_VTABLE_REF
00749 };
00750
00751 /* The base value for branch probability notes. */
00752 #define REG_BR_PROB_BASE 10000
00753
00754 /* Define macros to extract and insert the reg-note kind in an EXPR_LIST. */
00755 #define REG_NOTE_KIND(LINK) ((enum reg_note) GET_MODE (LINK))
00756 #define PUT_REG_NOTE_KIND(LINK, KIND) \
00757 PUT_MODE (LINK, (enum machine_mode) (KIND))
00758
00759 /* Names for REG_NOTE's in EXPR_LIST insn's. */
00760
00761 extern const char * const reg_note_name[];
00762 #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
00763
00764 /* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of
00765 USE and CLOBBER expressions.
00766 USE expressions list the registers filled with arguments that
00767 are passed to the function.
00768 CLOBBER expressions document the registers explicitly clobbered
00769 by this CALL_INSN.
00770 Pseudo registers can not be mentioned in this list. */
00771 #define CALL_INSN_FUNCTION_USAGE(INSN) XEXP(INSN, 9)
00772
00773 /* The label-number of a code-label. The assembler label
00774 is made from `L' and the label-number printed in decimal.
00775 Label numbers are unique in a compilation. */
00776 #define CODE_LABEL_NUMBER(INSN) XINT (INSN, 6)
00777
00778 #define LINE_NUMBER NOTE
00779
00780 /* In a NOTE that is a line number, this is a string for the file name that the
00781 line is in. We use the same field to record block numbers temporarily in
00782 NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes. (We avoid lots of casts
00783 between ints and pointers if we use a different macro for the block number.)
00784 */
00785
00786 #define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
00787 #define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
00788 #define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
00789 #define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE)
00790 #define NOTE_EXPECTED_VALUE(INSN) XCEXP (INSN, 4, NOTE)
00791 #define NOTE_PREDICTION(INSN) XCINT (INSN, 4, NOTE)
00792 #define NOTE_PRECONDITIONED(INSN) XCINT (INSN, 4, NOTE)
00793
00794 /* In a NOTE that is a line number, this is the line number.
00795 Other kinds of NOTEs are identified by negative numbers here. */
00796 #define NOTE_LINE_NUMBER(INSN) XCINT (INSN, 5, NOTE)
00797
00798 /* Nonzero if INSN is a note marking the beginning of a basic block. */
00799 #define NOTE_INSN_BASIC_BLOCK_P(INSN) \
00800 (GET_CODE (INSN) == NOTE \
00801 && NOTE_LINE_NUMBER (INSN) == NOTE_INSN_BASIC_BLOCK)
00802
00803 /* Algorithm and flags for prediction. */
00804 #define NOTE_PREDICTION_ALG(INSN) (XCINT(INSN, 4, NOTE)>>8)
00805 #define NOTE_PREDICTION_FLAGS(INSN) (XCINT(INSN, 4, NOTE)&0xff)
00806 #define NOTE_PREDICT(ALG,FLAGS) ((ALG<<8)+(FLAGS))
00807
00808 /* Codes that appear in the NOTE_LINE_NUMBER field
00809 for kinds of notes that are not line numbers.
00810
00811 Notice that we do not try to use zero here for any of
00812 the special note codes because sometimes the source line
00813 actually can be zero! This happens (for example) when we
00814 are generating code for the per-translation-unit constructor
00815 and destructor routines for some C++ translation unit.
00816
00817 If you should change any of the following values, or if you
00818 should add a new value here, don't forget to change the
00819 note_insn_name array in rtl.c. */
00820
00821 enum insn_note
00822 {
00823 /* Keep all of these numbers negative. Adjust as needed. */
00824 NOTE_INSN_BIAS = -100,
00825
00826 /* This note is used to get rid of an insn
00827 when it isn't safe to patch the insn out of the chain. */
00828 NOTE_INSN_DELETED,
00829
00830 /* These are used to mark the beginning and end of a lexical block.
00831 See NOTE_BLOCK, identify_blocks and reorder_blocks. */
00832 NOTE_INSN_BLOCK_BEG,
00833 NOTE_INSN_BLOCK_END,
00834
00835 /* These mark the extremes of a loop. */
00836 NOTE_INSN_LOOP_BEG,
00837 NOTE_INSN_LOOP_END,
00838
00839 /* Generated at the place in a loop that `continue' jumps to. */
00840 NOTE_INSN_LOOP_CONT,
00841 /* Generated at the start of a duplicated exit test. */
00842 NOTE_INSN_LOOP_VTOP,
00843
00844 /* Generated at the end of a conditional at the top of the loop.
00845 This is used to perform a lame form of loop rotation in lieu
00846 of actually understanding the loop structure. The note is
00847 discarded after rotation is complete. */
00848 NOTE_INSN_LOOP_END_TOP_COND,
00849
00850 /* This kind of note is generated at the end of the function body,
00851 just before the return insn or return label. In an optimizing
00852 compilation it is deleted by the first jump optimization, after
00853 enabling that optimizer to determine whether control can fall
00854 off the end of the function body without a return statement. */
00855 NOTE_INSN_FUNCTION_END,
00856
00857 /* This marks the point immediately after the last prologue insn. */
00858 NOTE_INSN_PROLOGUE_END,
00859
00860 /* This marks the point immediately prior to the first epilogue insn. */
00861 NOTE_INSN_EPILOGUE_BEG,
00862
00863 /* Generated in place of user-declared labels when they are deleted. */
00864 NOTE_INSN_DELETED_LABEL,
00865
00866 /* This note indicates the start of the real body of the function,
00867 i.e. the point just after all of the parms have been moved into
00868 their homes, etc. */
00869 NOTE_INSN_FUNCTION_BEG,
00870
00871 /* These note where exception handling regions begin and end.
00872 Uses NOTE_EH_HANDLER to identify the region in question. */
00873 NOTE_INSN_EH_REGION_BEG,
00874 NOTE_INSN_EH_REGION_END,
00875
00876 /* Generated whenever a duplicate line number note is output. For example,
00877 one is output after the end of an inline function, in order to prevent
00878 the line containing the inline call from being counted twice in gcov. */
00879 NOTE_INSN_REPEATED_LINE_NUMBER,
00880
00881 /* Record the struct for the following basic block. Uses NOTE_BASIC_BLOCK. */
00882 NOTE_INSN_BASIC_BLOCK,
00883
00884 /* Record the expected value of a register at a location. Uses
00885 NOTE_EXPECTED_VALUE; stored as (eq (reg) (const_int)). */
00886 NOTE_INSN_EXPECTED_VALUE,
00887
00888 /* Record a prediction. Uses NOTE_PREDICTION. */
00889 NOTE_INSN_PREDICTION,
00890
00891 NOTE_INSN_MAX
00892 };
00893
00894 /* Names for NOTE insn's other than line numbers. */
00895
00896 extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
00897 #define GET_NOTE_INSN_NAME(NOTE_CODE) \
00898 (note_insn_name[(NOTE_CODE) - (int) NOTE_INSN_BIAS])
00899
00900 /* The name of a label, in case it corresponds to an explicit label
00901 in the input source code. */
00902 #define LABEL_NAME(RTX) XCSTR (RTX, 7, CODE_LABEL)
00903
00904 /* In jump.c, each label contains a count of the number
00905 of LABEL_REFs that point at it, so unused labels can be deleted. */
00906 #define LABEL_NUSES(RTX) XCINT (RTX, 4, CODE_LABEL)
00907
00908 /* Labels carry a two-bit field composed of the ->jump and ->call
00909 bits. This field indicates whether the label is an alternate
00910 entry point, and if so, what kind. */
00911 enum label_kind
00912 {
00913 LABEL_NORMAL = 0, /* ordinary label */
00914 LABEL_STATIC_ENTRY, /* alternate entry point, not exported */
00915 LABEL_GLOBAL_ENTRY, /* alternate entry point, exported */
00916 LABEL_WEAK_ENTRY /* alternate entry point, exported as weak symbol */
00917 };
00918
00919 #if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION > 2007)
00920
00921 /* Retrieve the kind of LABEL. */
00922 #define LABEL_KIND(LABEL) __extension__ \
00923 ({ rtx const _label = (LABEL); \
00924 if (GET_CODE (_label) != CODE_LABEL) \
00925 rtl_check_failed_flag ("LABEL_KIND", _label, __FILE__, __LINE__, \
00926 __FUNCTION__); \
00927 (enum label_kind) ((_label->jump << 1) | _label->call); })
00928
00929 /* Set the kind of LABEL. */
00930 #define SET_LABEL_KIND(LABEL, KIND) do { \
00931 rtx _label = (LABEL); \
00932 unsigned int _kind = (KIND); \
00933 if (GET_CODE (_label) != CODE_LABEL) \
00934 rtl_check_failed_flag ("SET_LABEL_KIND", _label, __FILE__, __LINE__, \
00935 __FUNCTION__); \
00936 _label->jump = ((_kind >> 1) & 1); \
00937 _label->call = (_kind & 1); \
00938 } while (0)
00939
00940 #else
00941
00942 /* Retrieve the kind of LABEL. */
00943 #define LABEL_KIND(LABEL) \
00944 ((enum label_kind) (((LABEL)->jump << 1) | (LABEL)->call))
00945
00946 /* Set the kind of LABEL. */
00947 #define SET_LABEL_KIND(LABEL, KIND) do { \
00948 rtx _label = (LABEL); \
00949 unsigned int _kind = (KIND); \
00950 _label->jump = ((_kind >> 1) & 1); \
00951 _label->call = (_kind & 1); \
00952 } while (0)
00953
00954 #endif /* rtl flag checking */
00955
00956 #define LABEL_ALT_ENTRY_P(LABEL) (LABEL_KIND (LABEL) != LABEL_NORMAL)
00957
00958 /* The original regno this ADDRESSOF was built for. */
00959 #define ADDRESSOF_REGNO(RTX) XCUINT (RTX, 1, ADDRESSOF)
00960
00961 /* The variable in the register we took the address of. */
00962 #define ADDRESSOF_DECL(RTX) XCTREE (RTX, 2, ADDRESSOF)
00963
00964 /* In jump.c, each JUMP_INSN can point to a label that it can jump to,
00965 so that if the JUMP_INSN is deleted, the label's LABEL_NUSES can
00966 be decremented and possibly the label can be deleted. */
00967 #define JUMP_LABEL(INSN) XCEXP (INSN, 9, JUMP_INSN)
00968
00969 /* Once basic blocks are found in flow.c,
00970 each CODE_LABEL starts a chain that goes through
00971 all the LABEL_REFs that jump to that label.
00972 The chain eventually winds up at the CODE_LABEL: it is circular. */
00973 #define LABEL_REFS(LABEL) XCEXP (LABEL, 5, CODE_LABEL)
00974
00975 /* This is the field in the LABEL_REF through which the circular chain
00976 of references to a particular label is linked.
00977 This chain is set up in flow.c. */
00978
00979 #define LABEL_NEXTREF(REF) XCEXP (REF, 1, LABEL_REF)
00980
00981 /* Once basic blocks are found in flow.c,
00982 Each LABEL_REF points to its containing instruction with this field. */
00983
00984 #define CONTAINING_INSN(RTX) XCEXP (RTX, 2, LABEL_REF)
00985
00986 /* For a REG rtx, REGNO extracts the register number. ORIGINAL_REGNO holds
00987 the number the register originally had; for a pseudo register turned into
00988 a hard reg this will hold the old pseudo register number. */
00989
00990 #define REGNO(RTX) XCUINT (RTX, 0, REG)
00991 #define ORIGINAL_REGNO(RTX) X0UINT (RTX, 1)
00992
00993 /* 1 if RTX is a reg or parallel that is the current function's return
00994 value. */
00995 #define REG_FUNCTION_VALUE_P(RTX) \
00996 (RTL_FLAG_CHECK2("REG_FUNCTION_VALUE_P", (RTX), REG, PARALLEL)->integrated)
00997
00998 /* 1 if RTX is a reg that corresponds to a variable declared by the user. */
00999 #define REG_USERVAR_P(RTX) \
01000 (RTL_FLAG_CHECK1("REG_USERVAR_P", (RTX), REG)->volatil)
01001
01002 /* 1 if RTX is a reg that holds a pointer value. */
01003 #define REG_POINTER(RTX) \
01004 (RTL_FLAG_CHECK1("REG_POINTER", (RTX), REG)->frame_related)
01005
01006 /* 1 if the given register REG corresponds to a hard register. */
01007 #define HARD_REGISTER_P(REG) (HARD_REGISTER_NUM_P (REGNO (REG)))
01008
01009 /* 1 if the given register number REG_NO corresponds to a hard register. */
01010 #define HARD_REGISTER_NUM_P(REG_NO) ((REG_NO) < FIRST_PSEUDO_REGISTER)
01011
01012 /* For a CONST_INT rtx, INTVAL extracts the integer. */
01013
01014 #define INTVAL(RTX) XCWINT(RTX, 0, CONST_INT)
01015
01016 /* For a CONST_DOUBLE:
01017 For a DImode, there are two integers CONST_DOUBLE_LOW is the
01018 low-order word and ..._HIGH the high-order.
01019 For a float, there is a REAL_VALUE_TYPE structure, and
01020 CONST_DOUBLE_REAL_VALUE(r) is a pointer to it. */
01021 #define CONST_DOUBLE_LOW(r) XCWINT (r, 0, CONST_DOUBLE)
01022 #define CONST_DOUBLE_HIGH(r) XCWINT (r, 1, CONST_DOUBLE)
01023 #define CONST_DOUBLE_REAL_VALUE(r) ((struct real_value *)&CONST_DOUBLE_LOW(r))
01024
01025 /* For a CONST_VECTOR, return element #n. */
01026 #define CONST_VECTOR_ELT(RTX, N) XCVECEXP (RTX, 0, N, CONST_VECTOR)
01027
01028 /* For a CONST_VECTOR, return the number of elements in a vector. */
01029 #define CONST_VECTOR_NUNITS(RTX) XCVECLEN (RTX, 0, CONST_VECTOR)
01030
01031 /* For a SUBREG rtx, SUBREG_REG extracts the value we want a subreg of.
01032 SUBREG_BYTE extracts the byte-number. */
01033
01034 #define SUBREG_REG(RTX) XCEXP (RTX, 0, SUBREG)
01035 #define SUBREG_BYTE(RTX) XCUINT (RTX, 1, SUBREG)
01036
01037 /* in rtlanal.c */
01038 extern unsigned int subreg_lsb PARAMS ((rtx));
01039 extern unsigned int subreg_regno_offset PARAMS ((unsigned int,
01040 enum machine_mode,
01041 unsigned int,
01042 enum machine_mode));
01043 extern bool subreg_offset_representable_p PARAMS ((unsigned int,
01044 enum machine_mode,
01045 unsigned int,
01046 enum machine_mode));
01047 extern unsigned int subreg_regno PARAMS ((rtx));
01048
01049 /* 1 if RTX is a subreg containing a reg that is already known to be
01050 sign- or zero-extended from the mode of the subreg to the mode of
01051 the reg. SUBREG_PROMOTED_UNSIGNED_P gives the signedness of the
01052 extension.
01053
01054 When used as a LHS, is means that this extension must be done
01055 when assigning to SUBREG_REG. */
01056
01057 #define SUBREG_PROMOTED_VAR_P(RTX) \
01058 (RTL_FLAG_CHECK1("SUBREG_PROMOTED", (RTX), SUBREG)->in_struct)
01059
01060 #define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL) \
01061 do { \
01062 rtx const _rtx = RTL_FLAG_CHECK1("SUBREG_PROMOTED_UNSIGNED_SET", (RTX), SUBREG); \
01063 if ((VAL) < 0) \
01064 _rtx->volatil = 1; \
01065 else { \
01066 _rtx->volatil = 0; \
01067 _rtx->unchanging = (VAL); \
01068 } \
01069 } while (0)
01070 #define SUBREG_PROMOTED_UNSIGNED_P(RTX) \
01071 ((RTL_FLAG_CHECK1("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil) \
01072 ? -1 : (RTX)->unchanging)
01073
01074 /* Access various components of an ASM_OPERANDS rtx. */
01075
01076 #define ASM_OPERANDS_TEMPLATE(RTX) XCSTR (RTX, 0, ASM_OPERANDS)
01077 #define ASM_OPERANDS_OUTPUT_CONSTRAINT(RTX) XCSTR (RTX, 1, ASM_OPERANDS)
01078 #define ASM_OPERANDS_OUTPUT_IDX(RTX) XCINT (RTX, 2, ASM_OPERANDS)
01079 #define ASM_OPERANDS_INPUT_VEC(RTX) XCVEC (RTX, 3, ASM_OPERANDS)
01080 #define ASM_OPERANDS_INPUT_CONSTRAINT_VEC(RTX) XCVEC (RTX, 4, ASM_OPERANDS)
01081 #define ASM_OPERANDS_INPUT(RTX, N) XCVECEXP (RTX, 3, N, ASM_OPERANDS)
01082 #define ASM_OPERANDS_INPUT_LENGTH(RTX) XCVECLEN (RTX, 3, ASM_OPERANDS)
01083 #define ASM_OPERANDS_INPUT_CONSTRAINT_EXP(RTX, N) \
01084 XCVECEXP (RTX, 4, N, ASM_OPERANDS)
01085 #define ASM_OPERANDS_INPUT_CONSTRAINT(RTX, N) \
01086 XSTR (XCVECEXP (RTX, 4, N, ASM_OPERANDS), 0)
01087 #define ASM_OPERANDS_INPUT_MODE(RTX, N) \
01088 GET_MODE (XCVECEXP (RTX, 4, N, ASM_OPERANDS))
01089 #define ASM_OPERANDS_SOURCE_FILE(RTX) XCSTR (RTX, 5, ASM_OPERANDS)
01090 #define ASM_OPERANDS_SOURCE_LINE(RTX) XCINT (RTX, 6, ASM_OPERANDS)
01091
01092 /* 1 if RTX is a mem and we should keep the alias set for this mem
01093 unchanged when we access a component. Set to 1, or example, when we
01094 are already in a non-addressable component of an aggregate. */
01095 #define MEM_KEEP_ALIAS_SET_P(RTX) \
01096 (RTL_FLAG_CHECK1("MEM_KEEP_ALIAS_SET_P", (RTX), MEM)->jump)
01097
01098 /* 1 if RTX is a mem or asm_operand for a volatile reference. */
01099 #define MEM_VOLATILE_P(RTX) \
01100 (RTL_FLAG_CHECK3("MEM_VOLATILE_P", (RTX), MEM, ASM_OPERANDS, \
01101 ASM_INPUT)->volatil)
01102
01103 /* 1 if RTX is a mem that refers to an aggregate, either to the
01104 aggregate itself of to a field of the aggregate. If zero, RTX may
01105 or may not be such a reference. */
01106 #define MEM_IN_STRUCT_P(RTX) \
01107 (RTL_FLAG_CHECK1("MEM_IN_STRUCT_P", (RTX), MEM)->in_struct)
01108
01109 /* 1 if RTX is a mem that refers to a scalar. If zero, RTX may or may
01110 not refer to a scalar. */
01111 #define MEM_SCALAR_P(RTX) \
01112 (RTL_FLAG_CHECK1("MEM_SCALAR_P", (RTX), MEM)->frame_related)
01113
01114 /* 1 if RTX is a mem that cannot trap. */
01115 #define MEM_NOTRAP_P(RTX) \
01116 (RTL_FLAG_CHECK1("MEM_NOTRAP_P", (RTX), MEM)->call)
01117
01118 /* If VAL is nonzero, set MEM_IN_STRUCT_P and clear MEM_SCALAR_P in
01119 RTX. Otherwise, vice versa. Use this macro only when you are
01120 *sure* that you know that the MEM is in a structure, or is a
01121 scalar. VAL is evaluated only once. */
01122 #define MEM_SET_IN_STRUCT_P(RTX, VAL) \
01123 do { \
01124 if (VAL) \
01125 { \
01126 MEM_IN_STRUCT_P (RTX) = 1; \
01127 MEM_SCALAR_P (RTX) = 0; \
01128 } \
01129 else \
01130 { \
01131 MEM_IN_STRUCT_P (RTX) = 0; \
01132 MEM_SCALAR_P (RTX) = 1; \
01133 } \
01134 } while (0)
01135
01136 /* The memory attribute block. We provide access macros for each value
01137 in the block and provide defaults if none specified. */
01138 #define MEM_ATTRS(RTX) X0MEMATTR (RTX, 1)
01139
01140 /* For a MEM rtx, the alias set. If 0, this MEM is not in any alias
01141 set, and may alias anything. Otherwise, the MEM can only alias
01142 MEMs in the same alias set. This value is set in a
01143 language-dependent manner in the front-end, and should not be
01144 altered in the back-end. These set numbers are tested for zero,
01145 and compared for equality; they have no other significance. In
01146 some front-ends, these numbers may correspond in some way to types,
01147 or other language-level entities, but they need not, and the
01148 back-end makes no such assumptions. */
01149 #define MEM_ALIAS_SET(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->alias)
01150
01151 /* For a MEM rtx, the decl it is known to refer to, if it is known to
01152 refer to part of a DECL. It may also be a COMPONENT_REF. */
01153 #define MEM_EXPR(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->expr)
01154
01155 /* For a MEM rtx, the offset from the start of MEM_EXPR, if known, as a
01156 RTX that is always a CONST_INT. */
01157 #define MEM_OFFSET(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->offset)
01158
01159 /* For a MEM rtx, the size in bytes of the MEM, if known, as an RTX that
01160 is always a CONST_INT. */
01161 #define MEM_SIZE(RTX) \
01162 (MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->size \
01163 : GET_MODE (RTX) != BLKmode ? GEN_INT (GET_MODE_SIZE (GET_MODE (RTX))) \
01164 : 0)
01165
01166 /* For a MEM rtx, the alignment in bits. We can use the alignment of the
01167 mode as a default when STRICT_ALIGNMENT, but not if not. */
01168 #define MEM_ALIGN(RTX) \
01169 (MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->align \
01170 : (STRICT_ALIGNMENT && GET_MODE (RTX) != BLKmode \
01171 ? GET_MODE_ALIGNMENT (GET_MODE (RTX)) : BITS_PER_UNIT))
01172
01173 /* Copy the attributes that apply to memory locations from RHS to LHS. */
01174 #define MEM_COPY_ATTRIBUTES(LHS, RHS) \
01175 (MEM_VOLATILE_P (LHS) = MEM_VOLATILE_P (RHS), \
01176 MEM_IN_STRUCT_P (LHS) = MEM_IN_STRUCT_P (RHS), \
01177 MEM_SCALAR_P (LHS) = MEM_SCALAR_P (RHS), \
01178 MEM_NOTRAP_P (LHS) = MEM_NOTRAP_P (RHS), \
01179 RTX_UNCHANGING_P (LHS) = RTX_UNCHANGING_P (RHS), \
01180 MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \
01181 MEM_ATTRS (LHS) = MEM_ATTRS (RHS))
01182
01183 /* 1 if RTX is a label_ref to a label outside the loop containing the
01184 reference. */
01185 #define LABEL_OUTSIDE_LOOP_P(RTX) \
01186 (RTL_FLAG_CHECK1("LABEL_OUTSIDE_LOOP_P", (RTX), LABEL_REF)->in_struct)
01187
01188 /* 1 if RTX is a label_ref for a nonlocal label. */
01189 /* Likewise in an expr_list for a reg_label note. */
01190 #define LABEL_REF_NONLOCAL_P(RTX) \
01191 (RTL_FLAG_CHECK2("LABEL_REF_NONLOCAL_P", (RTX), LABEL_REF, \
01192 REG_LABEL)->volatil)
01193
01194 /* 1 if RTX is a code_label that should always be considered to be needed. */
01195 #define LABEL_PRESERVE_P(RTX) \
01196 (RTL_FLAG_CHECK2("LABEL_PRESERVE_P", (RTX), CODE_LABEL, NOTE)->in_struct)
01197
01198 /* 1 if RTX is a reg that is used only in an exit test of a loop. */
01199 #define REG_LOOP_TEST_P(RTX) \
01200 (RTL_FLAG_CHECK1("REG_LOOP_TEST_P", (RTX), REG)->in_struct)
01201
01202 /* During sched, 1 if RTX is an insn that must be scheduled together
01203 with the preceding insn. */
01204 #define SCHED_GROUP_P(RTX) \
01205 (RTL_FLAG_CHECK3("SCHED_GROUP_P", (RTX), INSN, JUMP_INSN, CALL_INSN \
01206 )->in_struct)
01207
01208 /* For a SET rtx, SET_DEST is the place that is set
01209 and SET_SRC is the value it is set to. */
01210 #define SET_DEST(RTX) XC2EXP(RTX, 0, SET, CLOBBER)
01211 #define SET_SRC(RTX) XCEXP(RTX, 1, SET)
01212 #define SET_IS_RETURN_P(RTX) \
01213 (RTL_FLAG_CHECK1("SET_IS_RETURN_P", (RTX), SET)->jump)
01214
01215 /* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
01216 #define TRAP_CONDITION(RTX) XCEXP (RTX, 0, TRAP_IF)
01217 #define TRAP_CODE(RTX) XCEXP (RTX, 1, TRAP_IF)
01218
01219 /* For a COND_EXEC rtx, COND_EXEC_TEST is the condition to base
01220 conditionally executing the code on, COND_EXEC_CODE is the code
01221 to execute if the condition is true. */
01222 #define COND_EXEC_TEST(RTX) XCEXP (RTX, 0, COND_EXEC)
01223 #define COND_EXEC_CODE(RTX) XCEXP (RTX, 1, COND_EXEC)
01224
01225 /* 1 if RTX is a symbol_ref that addresses this function's constants pool. */
01226 #define CONSTANT_POOL_ADDRESS_P(RTX) \
01227 (RTL_FLAG_CHECK1("CONSTANT_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->unchanging)
01228
01229 /* 1 if RTX is a symbol_ref that addresses this function's string constant
01230 pool */
01231 #define STRING_POOL_ADDRESS_P(RTX) \
01232 (RTL_FLAG_CHECK1("STRING_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->frame_related)
01233
01234 /* Used if RTX is a symbol_ref, for machine-specific purposes. */
01235 #define SYMBOL_REF_FLAG(RTX) \
01236 (RTL_FLAG_CHECK1("SYMBOL_REF_FLAG", (RTX), SYMBOL_REF)->volatil)
01237
01238 /* 1 if RTX is a symbol_ref that has been the library function in
01239 emit_library_call. */
01240 #define SYMBOL_REF_USED(RTX) \
01241 (RTL_FLAG_CHECK1("SYMBOL_REF_USED", (RTX), SYMBOL_REF)->used)
01242
01243 /* 1 if RTX is a symbol_ref for a weak symbol. */
01244 #define SYMBOL_REF_WEAK(RTX) \
01245 (RTL_FLAG_CHECK1("SYMBOL_REF_WEAK", (RTX), SYMBOL_REF)->integrated)
01246
01247 /* Define a macro to look for REG_INC notes,
01248 but save time on machines where they never exist. */
01249
01250 #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
01251 #define FIND_REG_INC_NOTE(INSN, REG) \
01252 ((REG) != NULL_RTX && REG_P ((REG)) \
01253 ? find_regno_note ((INSN), REG_INC, REGNO (REG)) \
01254 : find_reg_note ((INSN), REG_INC, (REG)))
01255 #else
01256 #define FIND_REG_INC_NOTE(INSN, REG) 0
01257 #endif
01258
01259 /* Indicate whether the machine has any sort of auto increment addressing.
01260 If not, we can avoid checking for REG_INC notes. */
01261
01262 #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
01263 #define AUTO_INC_DEC
01264 #endif
01265
01266 #ifndef HAVE_PRE_INCREMENT
01267 #define HAVE_PRE_INCREMENT 0
01268 #endif
01269
01270 #ifndef HAVE_PRE_DECREMENT
01271 #define HAVE_PRE_DECREMENT 0
01272 #endif
01273
01274 #ifndef HAVE_POST_INCREMENT
01275 #define HAVE_POST_INCREMENT 0
01276 #endif
01277
01278 #ifndef HAVE_POST_DECREMENT
01279 #define HAVE_POST_DECREMENT 0
01280 #endif
01281
01282 #ifndef HAVE_POST_MODIFY_DISP
01283 #define HAVE_POST_MODIFY_DISP 0
01284 #endif
01285
01286 #ifndef HAVE_POST_MODIFY_REG
01287 #define HAVE_POST_MODIFY_REG 0
01288 #endif
01289
01290 #ifndef HAVE_PRE_MODIFY_DISP
01291 #define HAVE_PRE_MODIFY_DISP 0
01292 #endif
01293
01294 #ifndef HAVE_PRE_MODIFY_REG
01295 #define HAVE_PRE_MODIFY_REG 0
01296 #endif
01297
01298
01299 /* Some architectures do not have complete pre/post increment/decrement
01300 instruction sets, or only move some modes efficiently. These macros
01301 allow us to tune autoincrement generation. */
01302
01303 #ifndef USE_LOAD_POST_INCREMENT
01304 #define USE_LOAD_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
01305 #endif
01306
01307 #ifndef USE_LOAD_POST_DECREMENT
01308 #define USE_LOAD_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
01309 #endif
01310
01311 #ifndef USE_LOAD_PRE_INCREMENT
01312 #define USE_LOAD_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
01313 #endif
01314
01315 #ifndef USE_LOAD_PRE_DECREMENT
01316 #define USE_LOAD_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
01317 #endif
01318
01319 #ifndef USE_STORE_POST_INCREMENT
01320 #define USE_STORE_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
01321 #endif
01322
01323 #ifndef USE_STORE_POST_DECREMENT
01324 #define USE_STORE_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
01325 #endif
01326
01327 #ifndef USE_STORE_PRE_INCREMENT
01328 #define USE_STORE_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
01329 #endif
01330
01331 #ifndef USE_STORE_PRE_DECREMENT
01332 #define USE_STORE_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
01333 #endif
01334
01335 /* Determine if the insn is a PHI node. */
01336 #define PHI_NODE_P(X) \
01337 ((X) && GET_CODE (X) == INSN \
01338 && GET_CODE (PATTERN (X)) == SET \
01339 && GET_CODE (SET_SRC (PATTERN (X))) == PHI)
01340
01341 /* Nonzero if we need to distinguish between the return value of this function
01342 and the return value of a function called by this function. This helps
01343 integrate.c.
01344 This is 1 until after the rtl generation pass. */
01345 extern int rtx_equal_function_value_matters;
01346
01347 /* Nonzero when we are generating CONCATs. */
01348 extern int generating_concat_p;
01349
01350 /* Generally useful functions. */
01351
01352 /* In expmed.c */
01353 extern int ceil_log2 PARAMS ((unsigned HOST_WIDE_INT));
01354
01355 #define plus_constant(X, C) plus_constant_wide ((X), (HOST_WIDE_INT) (C))
01356
01357 /* In builtins.c */
01358 extern rtx expand_builtin_expect_jump PARAMS ((tree, rtx, rtx));
01359
01360 /* In explow.c */
01361 extern void set_stack_check_libfunc PARAMS ((rtx));
01362 extern HOST_WIDE_INT trunc_int_for_mode PARAMS ((HOST_WIDE_INT,
01363 enum machine_mode));
01364 extern rtx plus_constant_wide PARAMS ((rtx, HOST_WIDE_INT));
01365 extern rtx plus_constant_for_output_wide PARAMS ((rtx, HOST_WIDE_INT));
01366 extern void optimize_save_area_alloca PARAMS ((rtx));
01367
01368 /* In emit-rtl.c */
01369 extern rtx gen_rtx PARAMS ((enum rtx_code,
01370 enum machine_mode, ...));
01371 extern rtvec gen_rtvec PARAMS ((int, ...));
01372 extern rtx copy_insn_1 PARAMS ((rtx));
01373 extern rtx copy_insn PARAMS ((rtx));
01374 extern rtx gen_int_mode PARAMS ((HOST_WIDE_INT,
01375 enum machine_mode));
01376 extern rtx emit_copy_of_insn_after PARAMS ((rtx, rtx));
01377
01378 /* In rtl.c */
01379 extern rtx rtx_alloc PARAMS ((RTX_CODE));
01380 extern rtvec rtvec_alloc PARAMS ((int));
01381 extern rtx copy_rtx PARAMS ((rtx));
01382
01383 /* In emit-rtl.c */
01384 extern rtx copy_rtx_if_shared PARAMS ((rtx));
01385
01386 /* In rtl.c */
01387 extern rtx copy_most_rtx PARAMS ((rtx, rtx));
01388 extern rtx shallow_copy_rtx PARAMS ((rtx));
01389 extern int rtx_equal_p PARAMS ((rtx, rtx));
01390
01391 /* In emit-rtl.c */
01392 extern rtvec gen_rtvec_v PARAMS ((int, rtx *));
01393 extern rtx gen_reg_rtx PARAMS ((enum machine_mode));
01394 extern rtx gen_label_rtx PARAMS ((void));
01395 extern int subreg_hard_regno PARAMS ((rtx, int));
01396 extern rtx gen_lowpart_common PARAMS ((enum machine_mode, rtx));
01397 extern rtx gen_lowpart PARAMS ((enum machine_mode, rtx));
01398
01399 /* In cse.c */
01400 extern rtx gen_lowpart_if_possible PARAMS ((enum machine_mode, rtx));
01401
01402 /* In emit-rtl.c */
01403 extern rtx gen_highpart PARAMS ((enum machine_mode, rtx));
01404 extern rtx gen_highpart_mode PARAMS ((enum machine_mode,
01405 enum machine_mode, rtx));
01406 extern rtx gen_realpart PARAMS ((enum machine_mode, rtx));
01407 extern rtx gen_imagpart PARAMS ((enum machine_mode, rtx));
01408 extern rtx operand_subword PARAMS ((rtx, unsigned int, int,
01409 enum machine_mode));
01410 extern rtx constant_subword PARAMS ((rtx, int,
01411 enum machine_mode));
01412
01413 /* In emit-rtl.c */
01414 extern rtx operand_subword_force PARAMS ((rtx, unsigned int,
01415 enum machine_mode));
01416 extern int subreg_lowpart_p PARAMS ((rtx));
01417 extern unsigned int subreg_lowpart_offset PARAMS ((enum machine_mode,
01418 enum machine_mode));
01419 extern unsigned int subreg_highpart_offset PARAMS ((enum machine_mode,
01420 enum machine_mode));
01421 extern rtx make_safe_from PARAMS ((rtx, rtx));
01422 extern rtx convert_memory_address PARAMS ((enum machine_mode, rtx));
01423 extern rtx get_insns PARAMS ((void));
01424 extern const char *get_insn_name PARAMS ((int));
01425 extern rtx get_last_insn PARAMS ((void));
01426 extern rtx get_last_insn_anywhere PARAMS ((void));
01427 extern rtx get_first_nonnote_insn PARAMS ((void));
01428 extern rtx get_last_nonnote_insn PARAMS ((void));
01429 extern void start_sequence PARAMS ((void));
01430 extern void push_to_sequence PARAMS ((rtx));
01431 extern void end_sequence PARAMS ((void));
01432 extern void push_to_full_sequence PARAMS ((rtx, rtx));
01433 extern void end_full_sequence PARAMS ((rtx*, rtx*));
01434
01435 /* In varasm.c */
01436 extern rtx immed_double_const PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT, enum machine_mode));
01437 extern rtx mem_for_const_double PARAMS ((rtx));
01438 extern rtx force_const_mem PARAMS ((enum machine_mode, rtx));
01439
01440 /* In varasm.c */
01441 extern rtx get_pool_constant PARAMS ((rtx));
01442 extern rtx get_pool_constant_mark PARAMS ((rtx, bool *));
01443 extern enum machine_mode get_pool_mode PARAMS ((rtx));
01444 extern rtx get_pool_constant_for_function PARAMS ((struct function *, rtx));
01445 extern enum machine_mode get_pool_mode_for_function PARAMS ((struct function *, rtx));
01446 extern int get_pool_offset PARAMS ((rtx));
01447 extern rtx simplify_subtraction PARAMS ((rtx));
01448
01449 /* In function.c */
01450 extern rtx assign_stack_local PARAMS ((enum machine_mode,
01451 HOST_WIDE_INT, int));
01452 extern rtx assign_stack_temp PARAMS ((enum machine_mode,
01453 HOST_WIDE_INT, int));
01454 extern rtx assign_stack_temp_for_type PARAMS ((enum machine_mode,
01455 HOST_WIDE_INT, int, tree));
01456 extern rtx assign_temp PARAMS ((tree, int, int, int));
01457 /* In emit-rtl.c */
01458 extern rtx emit_insn_before PARAMS ((rtx, rtx));
01459 extern rtx emit_insn_before_scope PARAMS ((rtx, rtx, tree));
01460 extern rtx emit_jump_insn_before PARAMS ((rtx, rtx));
01461 extern rtx emit_jump_insn_before_scope PARAMS ((rtx, rtx, tree));
01462 extern rtx emit_call_insn_before PARAMS ((rtx, rtx));
01463 extern rtx emit_call_insn_before_scope PARAMS ((rtx, rtx, tree));
01464 extern rtx emit_barrier_before PARAMS ((rtx));
01465 extern rtx emit_label_before PARAMS ((rtx, rtx));
01466 extern rtx emit_note_before PARAMS ((int, rtx));
01467 extern rtx emit_insn_after PARAMS ((rtx, rtx));
01468 extern rtx emit_insn_after_scope PARAMS ((rtx, rtx, tree));
01469 extern rtx emit_jump_insn_after PARAMS ((rtx, rtx));
01470 extern rtx emit_jump_insn_after_scope PARAMS ((rtx, rtx, tree));
01471 extern rtx emit_call_insn_after PARAMS ((rtx, rtx));
01472 extern rtx emit_call_insn_after_scope PARAMS ((rtx, rtx, tree));
01473 extern rtx emit_barrier_after PARAMS ((rtx));
01474 extern rtx emit_label_after PARAMS ((rtx, rtx));
01475 extern rtx emit_note_after PARAMS ((int, rtx));
01476 extern rtx emit_line_note_after PARAMS ((const char *, int, rtx));
01477 extern rtx emit_insn PARAMS ((rtx));
01478 extern rtx emit_jump_insn PARAMS ((rtx));
01479 extern rtx emit_call_insn PARAMS ((rtx));
01480 extern rtx emit_label PARAMS ((rtx));
01481 extern rtx emit_barrier PARAMS ((void));
01482 extern rtx emit_line_note PARAMS ((const char *, int));
01483 extern rtx emit_note PARAMS ((const char *, int));
01484 extern rtx emit_line_note_force PARAMS ((const char *, int));
01485 extern rtx make_insn_raw PARAMS ((rtx));
01486 extern rtx previous_insn PARAMS ((rtx));
01487 extern rtx next_insn PARAMS ((rtx));
01488 extern rtx prev_nonnote_insn PARAMS ((rtx));
01489 extern rtx next_nonnote_insn PARAMS ((rtx));
01490 extern rtx prev_real_insn PARAMS ((rtx));
01491 extern rtx next_real_insn PARAMS ((rtx));
01492 extern rtx prev_active_insn PARAMS ((rtx));
01493 extern rtx next_active_insn PARAMS ((rtx));
01494 extern int active_insn_p PARAMS ((rtx));
01495 extern rtx prev_label PARAMS ((rtx));
01496 extern rtx next_label PARAMS ((rtx));
01497 extern rtx next_cc0_user PARAMS ((rtx));
01498 extern rtx prev_cc0_setter PARAMS ((rtx));
01499
01500 /* In cfglayout.c */
01501 extern tree choose_inner_scope PARAMS ((tree, tree));
01502
01503 /* In jump.c */
01504 extern rtx next_nondeleted_insn PARAMS ((rtx));
01505 extern enum rtx_code reverse_condition PARAMS ((enum rtx_code));
01506 extern enum rtx_code reverse_condition_maybe_unordered PARAMS ((enum rtx_code));
01507 extern enum rtx_code swap_condition PARAMS ((enum rtx_code));
01508 extern enum rtx_code unsigned_condition PARAMS ((enum rtx_code));
01509 extern enum rtx_code signed_condition PARAMS ((enum rtx_code));
01510 extern void mark_jump_label PARAMS ((rtx, rtx, int));
01511 extern void cleanup_barriers PARAMS ((void));
01512
01513 /* In jump.c */
01514 extern bool squeeze_notes PARAMS ((rtx *, rtx *));
01515 extern rtx delete_related_insns PARAMS ((rtx));
01516 extern void delete_jump PARAMS ((rtx));
01517 extern void delete_barrier PARAMS ((rtx));
01518 extern rtx get_label_before PARAMS ((rtx));
01519 extern rtx get_label_after PARAMS ((rtx));
01520 extern rtx follow_jumps PARAMS ((rtx));
01521
01522 /* In recog.c */
01523 extern rtx *find_constant_term_loc PARAMS ((rtx *));
01524
01525 /* In emit-rtl.c */
01526 extern rtx try_split PARAMS ((rtx, rtx, int));
01527 extern int split_branch_probability;
01528
01529 /* In unknown file */
01530 extern rtx split_insns PARAMS ((rtx, rtx));
01531
01532 /* In simplify-rtx.c */
01533 extern rtx simplify_unary_operation PARAMS ((enum rtx_code,
01534 enum machine_mode, rtx,
01535 enum machine_mode));
01536 extern rtx simplify_binary_operation PARAMS ((enum rtx_code,
01537 enum machine_mode, rtx,
01538 rtx));
01539 extern rtx simplify_ternary_operation PARAMS ((enum rtx_code,
01540 enum machine_mode,
01541 enum machine_mode, rtx, rtx,
01542 rtx));
01543 extern rtx simplify_relational_operation PARAMS ((enum rtx_code,
01544 enum machine_mode, rtx,
01545 rtx));
01546 extern rtx simplify_gen_binary PARAMS ((enum rtx_code,
01547 enum machine_mode,
01548 rtx, rtx));
01549 extern rtx simplify_gen_unary PARAMS ((enum rtx_code,
01550 enum machine_mode, rtx,
01551 enum machine_mode));
01552 extern rtx simplify_gen_ternary PARAMS ((enum rtx_code,
01553 enum machine_mode,
01554 enum machine_mode,
01555 rtx, rtx, rtx));
01556 extern rtx simplify_gen_relational PARAMS ((enum rtx_code,
01557 enum machine_mode,
01558 enum machine_mode,
01559 rtx, rtx));
01560 extern rtx simplify_subreg PARAMS ((enum machine_mode,
01561 rtx,
01562 enum machine_mode,
01563 unsigned int));
01564 extern rtx simplify_gen_subreg PARAMS ((enum machine_mode,
01565 rtx,
01566 enum machine_mode,
01567 unsigned int));
01568 extern rtx simplify_replace_rtx PARAMS ((rtx, rtx, rtx));
01569 extern rtx simplify_rtx PARAMS ((rtx));
01570 extern rtx avoid_constant_pool_reference PARAMS ((rtx));
01571
01572 /* In function.c */
01573 extern rtx gen_mem_addressof PARAMS ((rtx, tree, int));
01574
01575 /* In regclass.c */
01576 extern enum machine_mode choose_hard_reg_mode PARAMS ((unsigned int,
01577 unsigned int));
01578
01579 /* In emit-rtl.c */
01580 extern rtx set_unique_reg_note PARAMS ((rtx, enum reg_note, rtx));
01581
01582 /* Functions in rtlanal.c */
01583
01584 /* Single set is implemented as macro for performance reasons. */
01585 #define single_set(I) (INSN_P (I) \
01586 ? (GET_CODE (PATTERN (I)) == SET \
01587 ? PATTERN (I) : single_set_1 (I)) \
01588 : NULL_RTX)
01589 #define single_set_1(I) single_set_2 (I, PATTERN (I))
01590
01591 extern int rtx_addr_can_trap_p PARAMS ((rtx));
01592 extern int rtx_unstable_p PARAMS ((rtx));
01593 extern int rtx_varies_p PARAMS ((rtx, int));
01594 extern int rtx_addr_varies_p PARAMS ((rtx, int));
01595 extern HOST_WIDE_INT get_integer_term PARAMS ((rtx));
01596 extern rtx get_related_value PARAMS ((rtx));
01597 extern rtx get_jump_table_offset PARAMS ((rtx, rtx *));
01598 extern int global_reg_mentioned_p PARAMS ((rtx));
01599 extern int reg_mentioned_p PARAMS ((rtx, rtx));
01600 extern int count_occurrences PARAMS ((rtx, rtx, int));
01601 extern int reg_referenced_p PARAMS ((rtx, rtx));
01602 extern int reg_used_between_p PARAMS ((rtx, rtx, rtx));
01603 extern int reg_referenced_between_p PARAMS ((rtx, rtx, rtx));
01604 extern int reg_set_between_p PARAMS ((rtx, rtx, rtx));
01605 extern int regs_set_between_p PARAMS ((rtx, rtx, rtx));
01606 extern int commutative_operand_precedence PARAMS ((rtx));
01607 extern int swap_commutative_operands_p PARAMS ((rtx, rtx));
01608 extern int modified_between_p PARAMS ((rtx, rtx, rtx));
01609 extern int no_labels_between_p PARAMS ((rtx, rtx));
01610 extern int no_jumps_between_p PARAMS ((rtx, rtx));
01611 extern int modified_in_p PARAMS ((rtx, rtx));
01612 extern int insn_dependent_p PARAMS ((rtx, rtx));
01613 extern int reg_set_p PARAMS ((rtx, rtx));
01614 extern rtx single_set_2 PARAMS ((rtx, rtx));
01615 extern int multiple_sets PARAMS ((rtx));
01616 extern int set_noop_p PARAMS ((rtx));
01617 extern int noop_move_p PARAMS ((rtx));
01618 extern rtx find_last_value PARAMS ((rtx, rtx *, rtx, int));
01619 extern int refers_to_regno_p PARAMS ((unsigned int, unsigned int,
01620 rtx, rtx *));
01621 extern int reg_overlap_mentioned_p PARAMS ((rtx, rtx));
01622 extern rtx set_of PARAMS ((rtx, rtx));
01623 extern void note_stores PARAMS ((rtx,
01624 void (*) (rtx, rtx, void *),
01625 void *));
01626 extern void note_uses PARAMS ((rtx *,
01627 void (*) (rtx *, void *),
01628 void *));
01629 extern rtx reg_set_last PARAMS ((rtx, rtx));
01630 extern int dead_or_set_p PARAMS ((rtx, rtx));
01631 extern int dead_or_set_regno_p PARAMS ((rtx, unsigned int));
01632 extern rtx find_reg_note PARAMS ((rtx, enum reg_note, rtx));
01633 extern rtx find_regno_note PARAMS ((rtx, enum reg_note,
01634 unsigned int));
01635 extern rtx find_reg_equal_equiv_note PARAMS ((rtx));
01636 extern int find_reg_fusage PARAMS ((rtx, enum rtx_code, rtx));
01637 extern int find_regno_fusage PARAMS ((rtx, enum rtx_code,
01638 unsigned int));
01639 extern int pure_call_p PARAMS ((rtx));
01640 extern void remove_note PARAMS ((rtx, rtx));
01641 extern int side_effects_p PARAMS ((rtx));
01642 extern int volatile_refs_p PARAMS ((rtx));
01643 extern int volatile_insn_p PARAMS ((rtx));
01644 extern int may_trap_p PARAMS ((rtx));
01645 extern int inequality_comparisons_p PARAMS ((rtx));
01646 extern rtx replace_rtx PARAMS ((rtx, rtx, rtx));
01647 extern rtx replace_regs PARAMS ((rtx, rtx *, unsigned int,
01648 int));
01649 extern int computed_jump_p PARAMS ((rtx));
01650 typedef int (*rtx_function) PARAMS ((rtx *, void *));
01651 extern int for_each_rtx PARAMS ((rtx *, rtx_function, void *));
01652 extern rtx regno_use_in PARAMS ((unsigned int, rtx));
01653 extern int auto_inc_p PARAMS ((rtx));
01654 extern int in_expr_list_p PARAMS ((rtx, rtx));
01655 extern void remove_node_from_expr_list PARAMS ((rtx, rtx *));
01656 extern int insns_safe_to_move_p PARAMS ((rtx, rtx, rtx *));
01657 extern int loc_mentioned_in_p PARAMS ((rtx *, rtx));
01658 extern rtx find_first_parameter_load PARAMS ((rtx, rtx));
01659 extern bool keep_with_call_p PARAMS ((rtx));
01660
01661 /* flow.c */
01662
01663 extern rtx find_use_as_address PARAMS ((rtx, rtx, HOST_WIDE_INT));
01664
01665 /* lists.c */
01666
01667 void free_EXPR_LIST_list PARAMS ((rtx *));
01668 void free_INSN_LIST_list PARAMS ((rtx *));
01669 void free_EXPR_LIST_node PARAMS ((rtx));
01670 void free_INSN_LIST_node PARAMS ((rtx));
01671 rtx alloc_INSN_LIST PARAMS ((rtx, rtx));
01672 rtx alloc_EXPR_LIST PARAMS ((int, rtx, rtx));
01673
01674 /* regclass.c */
01675
01676 /* Maximum number of parallel sets and clobbers in any insn in this fn.
01677 Always at least 3, since the combiner could put that many togetherm
01678 and we want this to remain correct for all the remaining passes. */
01679
01680 extern int max_parallel;
01681
01682 /* Free up register info memory. */
01683 extern void free_reg_info PARAMS ((void));
01684
01685 /* recog.c */
01686 extern int asm_noperands PARAMS ((rtx));
01687 extern const char *decode_asm_operands PARAMS ((rtx, rtx *, rtx **,
01688 const char **,
01689 enum machine_mode *));
01690
01691 extern enum reg_class reg_preferred_class PARAMS ((int));
01692 extern enum reg_class reg_alternate_class PARAMS ((int));
01693
01694 extern rtx get_first_nonparm_insn PARAMS ((void));
01695
01696 extern void split_all_insns PARAMS ((int));
01697 extern void split_all_insns_noflow PARAMS ((void));
01698
01699 #define MAX_SAVED_CONST_INT 64
01700 extern GTY(()) rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
01701
01702 #define const0_rtx (const_int_rtx[MAX_SAVED_CONST_INT])
01703 #define const1_rtx (const_int_rtx[MAX_SAVED_CONST_INT+1])
01704 #define const2_rtx (const_int_rtx[MAX_SAVED_CONST_INT+2])
01705 #define constm1_rtx (const_int_rtx[MAX_SAVED_CONST_INT-1])
01706 extern GTY(()) rtx const_true_rtx;
01707
01708 extern GTY(()) rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
01709
01710 /* Returns a constant 0 rtx in mode MODE. Integer modes are treated the
01711 same as VOIDmode. */
01712
01713 #define CONST0_RTX(MODE) (const_tiny_rtx[0][(int) (MODE)])
01714
01715 /* Likewise, for the constants 1 and 2. */
01716
01717 #define CONST1_RTX(MODE) (const_tiny_rtx[1][(int) (MODE)])
01718 #define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
01719
01720 /* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg
01721 is used to represent the frame pointer. This is because the
01722 hard frame pointer and the automatic variables are separated by an amount
01723 that cannot be determined until after register allocation. We can assume
01724 that in this case ELIMINABLE_REGS will be defined, one action of which
01725 will be to eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM. */
01726 #ifndef HARD_FRAME_POINTER_REGNUM
01727 #define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM
01728 #endif
01729
01730 /* Index labels for global_rtl. */
01731 enum global_rtl_index
01732 {
01733 GR_PC,
01734 GR_CC0,
01735 GR_STACK_POINTER,
01736 GR_FRAME_POINTER,
01737 /* For register elimination to work properly these hard_frame_pointer_rtx,
01738 frame_pointer_rtx, and arg_pointer_rtx must be the same if they refer to
01739 the same register. */
01740 #if FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
01741 GR_ARG_POINTER = GR_FRAME_POINTER,
01742 #endif
01743 #if HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM
01744 GR_HARD_FRAME_POINTER = GR_FRAME_POINTER,
01745 #else
01746 GR_HARD_FRAME_POINTER,
01747 #endif
01748 #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
01749 #if HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
01750 GR_ARG_POINTER = GR_HARD_FRAME_POINTER,
01751 #else
01752 GR_ARG_POINTER,
01753 #endif
01754 #endif
01755 GR_VIRTUAL_INCOMING_ARGS,
01756 GR_VIRTUAL_STACK_ARGS,
01757 GR_VIRTUAL_STACK_DYNAMIC,
01758 GR_VIRTUAL_OUTGOING_ARGS,
01759 GR_VIRTUAL_CFA,
01760
01761 GR_MAX
01762 };
01763
01764 /* Pointers to standard pieces of rtx are stored here. */
01765 extern GTY(()) rtx global_rtl[GR_MAX];
01766
01767 /* Standard pieces of rtx, to be substituted directly into things. */
01768 #define pc_rtx (global_rtl[GR_PC])
01769 #define cc0_rtx (global_rtl[GR_CC0])
01770
01771 /* All references to certain hard regs, except those created
01772 by allocating pseudo regs into them (when that's possible),
01773 go through these unique rtx objects. */
01774 #define stack_pointer_rtx (global_rtl[GR_STACK_POINTER])
01775 #define frame_pointer_rtx (global_rtl[GR_FRAME_POINTER])
01776 #define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
01777 #define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
01778
01779 extern GTY(()) rtx pic_offset_table_rtx;
01780 extern GTY(()) rtx struct_value_rtx;
01781 extern GTY(()) rtx struct_value_incoming_rtx;
01782 extern GTY(()) rtx static_chain_rtx;
01783 extern GTY(()) rtx static_chain_incoming_rtx;
01784 extern GTY(()) rtx return_address_pointer_rtx;
01785
01786 /* Include the RTL generation functions. */
01787
01788 #ifndef NO_GENRTL_H
01789 #include "genrtl.h"
01790 #endif
01791
01792 /* There are some RTL codes that require special attention; the
01793 generation functions included above do the raw handling. If you
01794 add to this list, modify special_rtx in gengenrtl.c as well. You
01795 should also modify gen_rtx to use the special function. */
01796
01797 extern rtx gen_rtx_CONST_INT PARAMS ((enum machine_mode, HOST_WIDE_INT));
01798 extern rtx gen_rtx_CONST_VECTOR PARAMS ((enum machine_mode, rtvec));
01799 extern rtx gen_raw_REG PARAMS ((enum machine_mode, int));
01800 extern rtx gen_rtx_REG PARAMS ((enum machine_mode, unsigned));
01801 extern rtx gen_rtx_SUBREG PARAMS ((enum machine_mode, rtx, int));
01802 extern rtx gen_rtx_MEM PARAMS ((enum machine_mode, rtx));
01803
01804 extern rtx gen_lowpart_SUBREG PARAMS ((enum machine_mode, rtx));
01805
01806 /* We need the cast here to ensure that we get the same result both with
01807 and without prototypes. */
01808 #define GEN_INT(N) gen_rtx_CONST_INT (VOIDmode, (HOST_WIDE_INT) (N))
01809
01810 /* Virtual registers are used during RTL generation to refer to locations into
01811 the stack frame when the actual location isn't known until RTL generation
01812 is complete. The routine instantiate_virtual_regs replaces these with
01813 the proper value, which is normally {frame,arg,stack}_pointer_rtx plus
01814 a constant. */
01815
01816 #define FIRST_VIRTUAL_REGISTER (FIRST_PSEUDO_REGISTER)
01817
01818 /* This points to the first word of the incoming arguments passed on the stack,
01819 either by the caller or by the callee when pretending it was passed by the
01820 caller. */
01821
01822 #define virtual_incoming_args_rtx (global_rtl[GR_VIRTUAL_INCOMING_ARGS])
01823
01824 #define VIRTUAL_INCOMING_ARGS_REGNUM (FIRST_VIRTUAL_REGISTER)
01825
01826 /* If FRAME_GROWS_DOWNWARD, this points to immediately above the first
01827 variable on the stack. Otherwise, it points to the first variable on
01828 the stack. */
01829
01830 #define virtual_stack_vars_rtx (global_rtl[GR_VIRTUAL_STACK_ARGS])
01831
01832 #define VIRTUAL_STACK_VARS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 1)
01833
01834 /* This points to the location of dynamically-allocated memory on the stack
01835 immediately after the stack pointer has been adjusted by the amount
01836 desired. */
01837
01838 #define virtual_stack_dynamic_rtx (global_rtl[GR_VIRTUAL_STACK_DYNAMIC])
01839
01840 #define VIRTUAL_STACK_DYNAMIC_REGNUM ((FIRST_VIRTUAL_REGISTER) + 2)
01841
01842 /* This points to the location in the stack at which outgoing arguments should
01843 be written when the stack is pre-pushed (arguments pushed using push
01844 insns always use sp). */
01845
01846 #define virtual_outgoing_args_rtx (global_rtl[GR_VIRTUAL_OUTGOING_ARGS])
01847
01848 #define VIRTUAL_OUTGOING_ARGS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 3)
01849
01850 /* This points to the Canonical Frame Address of the function. This
01851 should corrospond to the CFA produced by INCOMING_FRAME_SP_OFFSET,
01852 but is calculated relative to the arg pointer for simplicity; the
01853 frame pointer nor stack pointer are necessarily fixed relative to
01854 the CFA until after reload. */
01855
01856 #define virtual_cfa_rtx (global_rtl[GR_VIRTUAL_CFA])
01857
01858 #define VIRTUAL_CFA_REGNUM ((FIRST_VIRTUAL_REGISTER) + 4)
01859
01860 #define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
01861
01862 /* Nonzero if REGNUM is a pointer into the stack frame. */
01863 #define REGNO_PTR_FRAME_P(REGNUM) \
01864 ((REGNUM) == STACK_POINTER_REGNUM \
01865 || (REGNUM) == FRAME_POINTER_REGNUM \
01866 || (REGNUM) == HARD_FRAME_POINTER_REGNUM \
01867 || (REGNUM) == ARG_POINTER_REGNUM \
01868 || ((REGNUM) >= FIRST_VIRTUAL_REGISTER \
01869 && (REGNUM) <= LAST_VIRTUAL_REGISTER))
01870
01871 /* REGNUM never really appearing in the INSN stream. */
01872 #define INVALID_REGNUM (~(unsigned int) 0)
01873
01874 extern rtx find_next_ref PARAMS ((rtx, rtx));
01875
01876 extern rtx output_constant_def PARAMS ((tree, int));
01877
01878 /* Define a default value for STORE_FLAG_VALUE. */
01879
01880 #ifndef STORE_FLAG_VALUE
01881 #define STORE_FLAG_VALUE 1
01882 #endif
01883
01884 /* Nonzero after the second flow pass has completed.
01885 Set to 1 or 0 by toplev.c */
01886 extern int flow2_completed;
01887
01888 /* Nonzero after end of reload pass.
01889 Set to 1 or 0 by reload1.c. */
01890
01891 extern int reload_completed;
01892
01893 /* Set to 1 while reload_as_needed is operating.
01894 Required by some machines to handle any generated moves differently. */
01895
01896 extern int reload_in_progress;
01897
01898 /* If this is nonzero, we do not bother generating VOLATILE
01899 around volatile memory references, and we are willing to
01900 output indirect addresses. If cse is to follow, we reject
01901 indirect addresses so a useful potential cse is generated;
01902 if it is used only once, instruction combination will produce
01903 the same indirect address eventually. */
01904 extern int cse_not_expected;
01905
01906 /* Set to nonzero before life analysis to indicate that it is unsafe to
01907 generate any new pseudo registers. */
01908 extern int no_new_pseudos;
01909
01910 /* Translates rtx code to tree code, for those codes needed by
01911 REAL_ARITHMETIC. The function returns an int because the caller may not
01912 know what `enum tree_code' means. */
01913
01914 extern int rtx_to_tree_code PARAMS ((enum rtx_code));
01915
01916 /* In tree.c */
01917 struct obstack;
01918 extern void gcc_obstack_init PARAMS ((struct obstack *));
01919
01920 /* In cse.c */
01921 struct cse_basic_block_data;
01922
01923 /* Return the right cost to give to an operation
01924 to make the cost of the corresponding register-to-register instruction
01925 N times that of a fast register-to-register instruction. */
01926 #define COSTS_N_INSNS(N) ((N) * 4)
01927
01928 /* Maximum cost of a rtl expression. This value has the special meaning
01929 not to use an rtx with this cost under any circumstances. */
01930 #define MAX_COST INT_MAX
01931
01932 extern int rtx_cost PARAMS ((rtx, enum rtx_code));
01933 extern int address_cost PARAMS ((rtx, enum machine_mode));
01934 extern int delete_trivially_dead_insns PARAMS ((rtx, int));
01935 #ifdef BUFSIZ
01936 extern int cse_main PARAMS ((rtx, int, int, FILE *));
01937 #endif
01938 extern void cse_end_of_basic_block PARAMS ((rtx,
01939 struct cse_basic_block_data *,
01940 int, int, int));
01941
01942 /* In jump.c */
01943 extern int comparison_dominates_p PARAMS ((enum rtx_code, enum rtx_code));
01944 extern int condjump_p PARAMS ((rtx));
01945 extern int any_condjump_p PARAMS ((rtx));
01946 extern int any_uncondjump_p PARAMS ((rtx));
01947 extern int safe_to_remove_jump_p PARAMS ((rtx));
01948 extern rtx pc_set PARAMS ((rtx));
01949 extern rtx condjump_label PARAMS ((rtx));
01950 extern int simplejump_p PARAMS ((rtx));
01951 extern int tablejump_p PARAMS ((rtx));
01952 extern int returnjump_p PARAMS ((rtx));
01953 extern int onlyjump_p PARAMS ((rtx));
01954 extern int only_sets_cc0_p PARAMS ((rtx));
01955 extern int sets_cc0_p PARAMS ((rtx));
01956 extern int invert_jump_1 PARAMS ((rtx, rtx));
01957 extern int invert_jump PARAMS ((rtx, rtx, int));
01958 extern int rtx_renumbered_equal_p PARAMS ((rtx, rtx));
01959 extern int true_regnum PARAMS ((rtx));
01960 extern unsigned int reg_or_subregno PARAMS ((rtx));
01961 extern int redirect_jump_1 PARAMS ((rtx, rtx));
01962 extern int redirect_jump PARAMS ((rtx, rtx, int));
01963 extern void rebuild_jump_labels PARAMS ((rtx));
01964 extern enum rtx_code reversed_comparison_code PARAMS ((rtx, rtx));
01965 extern enum rtx_code reversed_comparison_code_parts PARAMS ((enum rtx_code,
01966 rtx, rtx, rtx));
01967 extern void delete_for_peephole PARAMS ((rtx, rtx));
01968 extern int condjump_in_parallel_p PARAMS ((rtx));
01969 extern void never_reached_warning PARAMS ((rtx, rtx));
01970 extern void purge_line_number_notes PARAMS ((rtx));
01971 extern void copy_loop_headers PARAMS ((rtx));
01972
01973 /* In emit-rtl.c. */
01974 extern int max_reg_num PARAMS ((void));
01975 extern int max_label_num PARAMS ((void));
01976 extern int get_first_label_num PARAMS ((void));
01977 extern void delete_insns_since PARAMS ((rtx));
01978 extern void mark_reg_pointer PARAMS ((rtx, int));
01979 extern void mark_user_reg PARAMS ((rtx));
01980 extern void reset_used_flags PARAMS ((rtx));
01981 extern void reorder_insns PARAMS ((rtx, rtx, rtx));
01982 extern void reorder_insns_nobb PARAMS ((rtx, rtx, rtx));
01983 extern int get_max_uid PARAMS ((void));
01984 extern int in_sequence_p PARAMS ((void));
01985 extern void force_next_line_note PARAMS ((void));
01986 extern void init_emit PARAMS ((void));
01987 extern void init_emit_once PARAMS ((int));
01988 extern void push_topmost_sequence PARAMS ((void));
01989 extern void pop_topmost_sequence PARAMS ((void));
01990 extern int subreg_realpart_p PARAMS ((rtx));
01991 extern void reverse_comparison PARAMS ((rtx));
01992 extern void set_new_first_and_last_insn PARAMS ((rtx, rtx));
01993 extern void set_new_first_and_last_label_num PARAMS ((int, int));
01994 extern void set_new_last_label_num PARAMS ((int));
01995 extern void unshare_all_rtl_again PARAMS ((rtx));
01996 extern void set_first_insn PARAMS ((rtx));
01997 extern void set_last_insn PARAMS ((rtx));
01998 extern void link_cc0_insns PARAMS ((rtx));
01999 extern void add_insn PARAMS ((rtx));
02000 extern void add_insn_before PARAMS ((rtx, rtx));
02001 extern void add_insn_after PARAMS ((rtx, rtx));
02002 extern void remove_insn PARAMS ((rtx));
02003 extern void reorder_insns_with_line_notes PARAMS ((rtx, rtx, rtx));
02004 extern void emit_insn_after_with_line_notes PARAMS ((rtx, rtx, rtx));
02005 extern enum rtx_code classify_insn PARAMS ((rtx));
02006 extern rtx emit PARAMS ((rtx));
02007 /* Query and clear/ restore no_line_numbers. This is used by the
02008 switch / case handling in stmt.c to give proper line numbers in
02009 warnings about unreachable code. */
02010 int force_line_numbers PARAMS ((void));
02011 void restore_line_number_status PARAMS ((int old_value));
02012 extern void renumber_insns PARAMS ((FILE *));
02013 extern void remove_unnecessary_notes PARAMS ((void));
02014 extern rtx delete_insn PARAMS ((rtx));
02015 extern void delete_insn_chain PARAMS ((rtx, rtx));
02016 extern rtx delete_insn_and_edges PARAMS ((rtx));
02017 extern void delete_insn_chain_and_edges PARAMS ((rtx, rtx));
02018
02019 /* In combine.c */
02020 extern int combine_instructions PARAMS ((rtx, unsigned int));
02021 extern unsigned int extended_count PARAMS ((rtx, enum machine_mode, int));
02022 extern rtx remove_death PARAMS ((unsigned int, rtx));
02023 #ifdef BUFSIZ
02024 extern void dump_combine_stats PARAMS ((FILE *));
02025 extern void dump_combine_total_stats PARAMS ((FILE *));
02026 #endif
02027
02028 /* In sched.c. */
02029 #ifdef BUFSIZ
02030 extern void schedule_insns PARAMS ((FILE *));
02031 extern void schedule_ebbs PARAMS ((FILE *));
02032 #endif
02033 extern void fix_sched_param PARAMS ((const char *, const char *));
02034
02035 /* In print-rtl.c */
02036 extern const char *print_rtx_head;
02037 extern void debug_rtx PARAMS ((rtx));
02038 extern void debug_rtx_list PARAMS ((rtx, int));
02039 extern void debug_rtx_range PARAMS ((rtx, rtx));
02040 extern rtx debug_rtx_find PARAMS ((rtx, int));
02041 #ifdef BUFSIZ
02042 extern void print_mem_expr PARAMS ((FILE *, tree));
02043 extern void print_rtl PARAMS ((FILE *, rtx));
02044 extern void print_simple_rtl PARAMS ((FILE *, rtx));
02045 extern int print_rtl_single PARAMS ((FILE *, rtx));
02046 extern void print_inline_rtx PARAMS ((FILE *, rtx, int));
02047 #endif
02048
02049 /* In loop.c */
02050 extern void init_loop PARAMS ((void));
02051 extern rtx libcall_other_reg PARAMS ((rtx, rtx));
02052 #ifdef BUFSIZ
02053 extern void loop_optimize PARAMS ((rtx, FILE *, int));
02054 #endif
02055 extern void record_excess_regs PARAMS ((rtx, rtx, rtx *));
02056
02057 /* In function.c */
02058 extern void reposition_prologue_and_epilogue_notes PARAMS ((rtx));
02059 extern void thread_prologue_and_epilogue_insns PARAMS ((rtx));
02060 extern int prologue_epilogue_contains PARAMS ((rtx));
02061 extern int sibcall_epilogue_contains PARAMS ((rtx));
02062 extern void preserve_rtl_expr_result PARAMS ((rtx));
02063 extern void mark_temp_addr_taken PARAMS ((rtx));
02064 extern void update_temp_slot_address PARAMS ((rtx, rtx));
02065 extern void purge_addressof PARAMS ((rtx));
02066 extern void purge_hard_subreg_sets PARAMS ((rtx));
02067
02068 /* In stmt.c */
02069 extern void set_file_and_line_for_stmt PARAMS ((const char *, int));
02070 extern void expand_null_return PARAMS ((void));
02071 extern void emit_jump PARAMS ((rtx));
02072 extern int preserve_subexpressions_p PARAMS ((void));
02073
02074 /* In expr.c */
02075 extern rtx move_by_pieces PARAMS ((rtx, rtx,
02076 unsigned HOST_WIDE_INT,
02077 unsigned int, int));
02078
02079 /* In flow.c */
02080 extern void recompute_reg_usage PARAMS ((rtx, int));
02081 extern int initialize_uninitialized_subregs PARAMS ((void));
02082 extern void delete_dead_jumptables PARAMS ((void));
02083 #ifdef BUFSIZ
02084 extern void print_rtl_with_bb PARAMS ((FILE *, rtx));
02085 extern void dump_flow_info PARAMS ((FILE *));
02086 #endif
02087
02088 /* In expmed.c */
02089 extern void init_expmed PARAMS ((void));
02090 extern void expand_inc PARAMS ((rtx, rtx));
02091 extern void expand_dec PARAMS ((rtx, rtx));
02092 extern rtx expand_mult_highpart PARAMS ((enum machine_mode, rtx,
02093 unsigned HOST_WIDE_INT, rtx,
02094 int, int));
02095
02096 /* In gcse.c */
02097 #ifdef BUFSIZ
02098 extern int gcse_main PARAMS ((rtx, FILE *));
02099 #endif
02100
02101 /* In global.c */
02102 extern void mark_elimination PARAMS ((int, int));
02103 #ifdef BUFSIZ
02104 extern int global_alloc PARAMS ((FILE *));
02105 extern void dump_global_regs PARAMS ((FILE *));
02106 #endif
02107 #ifdef HARD_CONST
02108 /* Yes, this ifdef is silly, but HARD_REG_SET is not always defined. */
02109 extern void retry_global_alloc PARAMS ((int, HARD_REG_SET));
02110 #endif
02111 extern void build_insn_chain PARAMS ((rtx));
02112
02113 /* In regclass.c */
02114 extern int reg_classes_intersect_p PARAMS ((enum reg_class, enum reg_class));
02115 extern int reg_class_subset_p PARAMS ((enum reg_class, enum reg_class));
02116 extern void globalize_reg PARAMS ((int));
02117 extern void init_regs PARAMS ((void));
02118 extern void init_fake_stack_mems PARAMS ((void));
02119 extern void init_reg_sets PARAMS ((void));
02120 extern void regset_release_memory PARAMS ((void));
02121 extern void regclass_init PARAMS ((void));
02122 extern void regclass PARAMS ((rtx, int, FILE *));
02123 extern void reg_scan PARAMS ((rtx, unsigned int, int));
02124 extern void reg_scan_update PARAMS ((rtx, rtx, unsigned int));
02125 extern void fix_register PARAMS ((const char *, int, int));
02126 #ifdef HARD_CONST
02127 extern void cannot_change_mode_set_regs PARAMS ((HARD_REG_SET *,
02128 enum machine_mode,
02129 unsigned int));
02130 #endif
02131 extern bool invalid_mode_change_p PARAMS ((unsigned int,
02132 enum reg_class,
02133 enum machine_mode));
02134
02135 extern int delete_null_pointer_checks PARAMS ((rtx));
02136
02137 /* In regmove.c */
02138 #ifdef BUFSIZ
02139 extern void regmove_optimize PARAMS ((rtx, int, FILE *));
02140 #endif
02141 extern void combine_stack_adjustments PARAMS ((void));
02142
02143 /* In reorg.c */
02144 #ifdef BUFSIZ
02145 extern void dbr_schedule PARAMS ((rtx, FILE *));
02146 #endif
02147
02148 /* In local-alloc.c */
02149 #ifdef BUFSIZ
02150 extern void dump_local_alloc PARAMS ((FILE *));
02151 #endif
02152 extern int local_alloc PARAMS ((void));
02153 extern int function_invariant_p PARAMS ((rtx));
02154
02155 /* In profile.c */
02156 extern void init_branch_prob PARAMS ((const char *));
02157 extern void branch_prob PARAMS ((void));
02158 extern void end_branch_prob PARAMS ((void));
02159 extern void output_func_start_profiler PARAMS ((void));
02160
02161 /* In reg-stack.c */
02162 #ifdef BUFSIZ
02163 extern void reg_to_stack PARAMS ((rtx, FILE *));
02164 #endif
02165
02166 /* In fold-const.c */
02167 extern int add_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02168 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02169 unsigned HOST_WIDE_INT *,
02170 HOST_WIDE_INT *));
02171 extern int neg_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02172 unsigned HOST_WIDE_INT *,
02173 HOST_WIDE_INT *));
02174 extern int mul_double PARAMS ((unsigned HOST_WIDE_INT,
02175 HOST_WIDE_INT,
02176 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02177 unsigned HOST_WIDE_INT *,
02178 HOST_WIDE_INT *));
02179 extern void lshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02180 HOST_WIDE_INT, unsigned int,
02181 unsigned HOST_WIDE_INT *,
02182 HOST_WIDE_INT *, int));
02183 extern void rshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02184 HOST_WIDE_INT, unsigned int,
02185 unsigned HOST_WIDE_INT *,
02186 HOST_WIDE_INT *, int));
02187 extern void lrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02188 HOST_WIDE_INT, unsigned int,
02189 unsigned HOST_WIDE_INT *,
02190 HOST_WIDE_INT *));
02191 extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
02192 HOST_WIDE_INT, unsigned int,
02193 unsigned HOST_WIDE_INT *,
02194 HOST_WIDE_INT *));
02195
02196 /* In calls.c */
02197 enum libcall_type
02198 {
02199 LCT_NORMAL = 0,
02200 LCT_CONST = 1,
02201 LCT_PURE = 2,
02202 LCT_CONST_MAKE_BLOCK = 3,
02203 LCT_PURE_MAKE_BLOCK = 4,
02204 LCT_NORETURN = 5,
02205 LCT_THROW = 6,
02206 LCT_ALWAYS_RETURN = 7,
02207 LCT_RETURNS_TWICE = 8
02208 };
02209
02210 extern void emit_library_call PARAMS ((rtx, enum libcall_type,
02211 enum machine_mode, int,
02212 ...));
02213 extern rtx emit_library_call_value PARAMS ((rtx, rtx, enum libcall_type,
02214 enum machine_mode, int,
02215 ...));
02216
02217 /* In unroll.c */
02218 extern int set_dominates_use PARAMS ((int, int, int, rtx, rtx));
02219
02220 /* In varasm.c */
02221 extern int in_data_section PARAMS ((void));
02222 extern void init_varasm_once PARAMS ((void));
02223
02224 /* In rtl.c */
02225 extern void init_rtl PARAMS ((void));
02226 extern void traverse_md_constants PARAMS ((int (*) (void **, void *),
02227 void *));
02228 struct md_constant { char *name, *value; };
02229
02230 #ifdef BUFSIZ
02231 extern int read_skip_spaces PARAMS ((FILE *));
02232 extern rtx read_rtx PARAMS ((FILE *));
02233 #endif
02234
02235 extern const char *read_rtx_filename;
02236 extern int read_rtx_lineno;
02237
02238 /* Redefine abort to report an internal error w/o coredump, and
02239 reporting the location of the error in the source file. This logic
02240 is duplicated in rtl.h and tree.h because every file that needs the
02241 special abort includes one or both. toplev.h gets too few files,
02242 system.h gets too many. */
02243
02244 extern void fancy_abort PARAMS ((const char *, int, const char *))
02245 ATTRIBUTE_NORETURN;
02246 #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
02247
02248 /* In alias.c */
02249 extern void clear_reg_alias_info PARAMS ((rtx));
02250 extern rtx canon_rtx PARAMS ((rtx));
02251 extern int true_dependence PARAMS ((rtx, enum machine_mode, rtx,
02252 int (*)(rtx, int)));
02253 extern rtx get_addr PARAMS ((rtx));
02254 extern int canon_true_dependence PARAMS ((rtx, enum machine_mode, rtx,
02255 rtx, int (*)(rtx, int)));
02256 extern int read_dependence PARAMS ((rtx, rtx));
02257 extern int anti_dependence PARAMS ((rtx, rtx));
02258 extern int output_dependence PARAMS ((rtx, rtx));
02259 extern void mark_constant_function PARAMS ((void));
02260 extern void init_alias_once PARAMS ((void));
02261 extern void init_alias_analysis PARAMS ((void));
02262 extern void end_alias_analysis PARAMS ((void));
02263 extern rtx addr_side_effect_eval PARAMS ((rtx, int, int));
02264
02265 /* In sibcall.c */
02266 typedef enum {
02267 sibcall_use_normal = 1,
02268 sibcall_use_tail_recursion,
02269 sibcall_use_sibcall
02270 } sibcall_use_t;
02271
02272 extern void optimize_sibling_and_tail_recursive_calls PARAMS ((void));
02273 extern void replace_call_placeholder PARAMS ((rtx, sibcall_use_t));
02274
02275 #ifdef STACK_REGS
02276 extern int stack_regs_mentioned PARAMS ((rtx insn));
02277 #endif
02278
02279 /* In toplev.c */
02280 extern GTY(()) rtx stack_limit_rtx;
02281
02282 /* In regrename.c */
02283 extern void regrename_optimize PARAMS ((void));
02284 extern void copyprop_hardreg_forward PARAMS ((void));
02285
02286 /* In ifcvt.c */
02287 extern void if_convert PARAMS ((int));
02288
02289 /* In predict.c */
02290 extern void invert_br_probabilities PARAMS ((rtx));
02291 extern bool expensive_function_p PARAMS ((int));
02292 /* In tracer.c */
02293 extern void tracer PARAMS ((void));
02294
02295 #endif /* ! GCC_RTL_H */