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