35 #define NOOP_MOVE_INSN_CODE INT_MAX
39 #define RTX_CODE enum rtx_code
42 #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM ,
46 LAST_AND_UNUSED_RTX_CODE};
51 #define NUM_RTX_CODE ((int) LAST_AND_UNUSED_RTX_CODE)
55 # define NON_GENERATOR_NUM_RTX_CODE ((int) MATCH_OPERAND)
86 #define RTX_OBJ_MASK (~1)
87 #define RTX_OBJ_RESULT (RTX_OBJ & RTX_OBJ_MASK)
88 #define RTX_COMPARE_MASK (~1)
89 #define RTX_COMPARE_RESULT (RTX_COMPARE & RTX_COMPARE_MASK)
90 #define RTX_ARITHMETIC_MASK (~1)
91 #define RTX_ARITHMETIC_RESULT (RTX_COMM_ARITH & RTX_ARITHMETIC_MASK)
92 #define RTX_BINARY_MASK (~3)
93 #define RTX_BINARY_RESULT (RTX_COMPARE & RTX_BINARY_MASK)
94 #define RTX_COMMUTATIVE_MASK (~2)
95 #define RTX_COMMUTATIVE_RESULT (RTX_COMM_COMPARE & RTX_COMMUTATIVE_MASK)
96 #define RTX_NON_COMMUTATIVE_RESULT (RTX_COMPARE & RTX_COMMUTATIVE_MASK)
99 #define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
102 #define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)])
105 #define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
108 #define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
120 unsigned base_after_vec: 1;
121 unsigned min_after_vec: 1;
123 unsigned max_after_vec: 1;
125 unsigned min_after_base: 1;
127 unsigned max_after_base: 1;
130 unsigned offset_unsigned: 1;
162 unsigned char addrspace;
226 unsigned int alignment;
255 chain_prev ("RTX_PREV (&%h)
"), variable_size)) rtx_def {
256 /* The kind of expression this is. */
257 ENUM_BITFIELD(rtx_code) code: 16;
259 /* The kind of value the expression has. */
260 ENUM_BITFIELD(machine_mode) mode : 8;
262 /* 1 in a MEM if we should keep the alias set for this mem unchanged
263 when we access a component.
264 1 in a CALL_INSN if it is a sibling call.
265 1 in a SET that is for a return.
266 In a CODE_LABEL, part of the two-bit alternate entry field.
267 1 in a CONCAT is VAL_EXPR_IS_COPIED in var-tracking.c.
268 1 in a VALUE is SP_BASED_VALUE_P in cselib.c.
269 1 in a SUBREG generated by LRA for reload insns. */
270 unsigned int jump : 1;
271 /* In a CODE_LABEL, part of the two-bit alternate entry field.
272 1 in a MEM if it cannot trap.
273 1 in a CALL_INSN logically equivalent to
274 ECF_LOOPING_CONST_OR_PURE and DECL_LOOPING_CONST_OR_PURE_P. */
275 unsigned int call : 1;
276 /* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere.
277 1 in a SUBREG used for SUBREG_PROMOTED_UNSIGNED_P.
278 1 in a SYMBOL_REF if it addresses something in the per-function
280 1 in a CALL_INSN logically equivalent to ECF_CONST and TREE_READONLY.
281 1 in a NOTE, or EXPR_LIST for a const call.
282 1 in a JUMP_INSN of an annulling branch.
283 1 in a CONCAT is VAL_EXPR_IS_CLOBBERED in var-tracking.c.
284 1 in a preserved VALUE is PRESERVED_VALUE_P in cselib.c.
285 1 in a clobber temporarily created for LRA. */
286 unsigned int unchanging : 1;
287 /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile.
288 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE
289 if it has been deleted.
290 1 in a REG expression if corresponds to a variable declared by the user,
291 0 for an internally generated temporary.
292 1 in a SUBREG used for SUBREG_PROMOTED_UNSIGNED_P.
293 1 in a LABEL_REF, REG_LABEL_TARGET or REG_LABEL_OPERAND note for a
295 In a SYMBOL_REF, this flag is used for machine-specific purposes.
296 In a PREFETCH, this flag indicates that it should be considered a scheduling
298 1 in a CONCAT is VAL_NEEDS_RESOLUTION in var-tracking.c. */
299 unsigned int volatil : 1;
300 /* 1 in a REG if the register is used only in exit code a loop.
301 1 in a SUBREG expression if was generated from a variable with a
303 1 in a CODE_LABEL if the label is used for nonlocal gotos
304 and must not be deleted even if its count is zero.
305 1 in an INSN, JUMP_INSN or CALL_INSN if this insn must be scheduled
306 together with the preceding insn. Valid only within sched.
307 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
308 from the target of a branch. Valid from reorg until end of compilation;
311 The name of the field is historical. It used to be used in MEMs
312 to record whether the MEM accessed part of a structure. */
313 unsigned int in_struct : 1;
314 /* At the end of RTL generation, 1 if this rtx is used. This is used for
315 copying shared structure. See `unshare_all_rtl'.
316 In a REG, this is not needed for that purpose, and used instead
317 in `leaf_renumber_regs_insn'.
318 1 in a SYMBOL_REF, means that emit_library_call
319 has used it as the function.
320 1 in a CONCAT is VAL_HOLDS_TRACK_EXPR in var-tracking.c.
321 1 in a VALUE or DEBUG_EXPR is VALUE_RECURSED_INTO in var-tracking.c. */
322 unsigned int used : 1;
323 /* 1 in an INSN or a SET if this rtx is related to the call frame,
324 either changing how we compute the frame address or saving and
325 restoring registers in the prologue and epilogue.
326 1 in a REG or MEM if it is a pointer.
327 1 in a SYMBOL_REF if it addresses something in the per-function
328 constant string pool.
329 1 in a VALUE is VALUE_CHANGED in var-tracking.c. */
330 unsigned frame_related : 1;
331 /* 1 in a REG or PARALLEL that is the current function's return value.
332 1 in a SYMBOL_REF for a weak symbol.
333 1 in a CALL_INSN logically equivalent to ECF_PURE and DECL_PURE_P.
334 1 in a CONCAT is VAL_EXPR_HAS_REVERSE in var-tracking.c.
335 1 in a VALUE or DEBUG_EXPR is NO_LOC_P in var-tracking.c. */
336 unsigned return_val : 1;
338 /* The first element of the operands of this rtx.
339 The number of operands and their types are controlled
340 by the `code' field, according to rtl.def. */
343 HOST_WIDE_INT hwint[1];
344 struct block_symbol block_sym;
345 struct real_value rv;
346 struct fixed_value fv;
350 /* The size in bytes of an rtx header (code, mode and flags). */
351 #define RTX_HDR_SIZE offsetof (struct rtx_def, u)
353 /* The size in bytes of an rtx with code CODE. */
354 #define RTX_CODE_SIZE(CODE) rtx_code_size[CODE]
356 #define NULL_RTX (rtx) 0
358 /* The "next
" and "previous
" RTX, relative to this one. */
360 #define RTX_NEXT(X) (rtx_next[GET_CODE (X)] == 0 ? NULL \
361 : *(rtx *)(((char *)X) + rtx_next[GET_CODE (X)]))
365 #define RTX_PREV(X) ((INSN_P (X) \
367 || JUMP_TABLE_DATA_P (X) \
370 && PREV_INSN (X) != NULL \
371 && NEXT_INSN (PREV_INSN (X)) == X \
372 ? PREV_INSN (X) : NULL)
374 /* Define macros to access the `code' field of the rtx. */
376 #define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
377 #define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
379 #define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
380 #define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE))
382 /* RTL vector. These appear inside RTX's when there is a need
383 for a variable number of things. The principle use is inside
384 PARALLEL expressions. */
386 struct GTY((variable_size)) rtvec_def {
387 int num_elem; /* number of elements */
388 rtx GTY ((length ("%h.num_elem
"))) elem[1];
391 #define NULL_RTVEC (rtvec) 0
393 #define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
394 #define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (NUM))
396 /* Predicate yielding nonzero iff X is an rtx for a register. */
397 #define REG_P(X) (GET_CODE (X) == REG)
399 /* Predicate yielding nonzero iff X is an rtx for a memory location. */
400 #define MEM_P(X) (GET_CODE (X) == MEM)
402 /* Match CONST_*s that can represent compile-time constant integers. */
403 #define CASE_CONST_SCALAR_INT \
407 /* Match CONST_*s for which pointer equality corresponds to value equality. */
408 #define CASE_CONST_UNIQUE \
413 /* Match all CONST_* rtxes. */
414 #define CASE_CONST_ANY \
420 /* Predicate yielding nonzero iff X is an rtx for a constant integer. */
421 #define CONST_INT_P(X) (GET_CODE (X) == CONST_INT)
423 /* Predicate yielding nonzero iff X is an rtx for a constant fixed-point. */
424 #define CONST_FIXED_P(X) (GET_CODE (X) == CONST_FIXED)
426 /* Predicate yielding true iff X is an rtx for a double-int
427 or floating point constant. */
428 #define CONST_DOUBLE_P(X) (GET_CODE (X) == CONST_DOUBLE)
430 /* Predicate yielding true iff X is an rtx for a double-int. */
431 #define CONST_DOUBLE_AS_INT_P(X) \
432 (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == VOIDmode)
434 /* Predicate yielding true iff X is an rtx for a integer const. */
435 #define CONST_SCALAR_INT_P(X) \
436 (CONST_INT_P (X) || CONST_DOUBLE_AS_INT_P (X))
438 /* Predicate yielding true iff X is an rtx for a double-int. */
439 #define CONST_DOUBLE_AS_FLOAT_P(X) \
440 (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode)
442 /* Predicate yielding nonzero iff X is a label insn. */
443 #define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)
445 /* Predicate yielding nonzero iff X is a jump insn. */
446 #define JUMP_P(X) (GET_CODE (X) == JUMP_INSN)
448 /* Predicate yielding nonzero iff X is a call insn. */
449 #define CALL_P(X) (GET_CODE (X) == CALL_INSN)
451 /* Predicate yielding nonzero iff X is an insn that cannot jump. */
452 #define NONJUMP_INSN_P(X) (GET_CODE (X) == INSN)
454 /* Predicate yielding nonzero iff X is a debug note/insn. */
455 #define DEBUG_INSN_P(X) (GET_CODE (X) == DEBUG_INSN)
457 /* Predicate yielding nonzero iff X is an insn that is not a debug insn. */
458 #define NONDEBUG_INSN_P(X) (INSN_P (X) && !DEBUG_INSN_P (X))
460 /* Nonzero if DEBUG_INSN_P may possibly hold. */
461 #define MAY_HAVE_DEBUG_INSNS (flag_var_tracking_assignments)
463 /* Predicate yielding nonzero iff X is a real insn. */
465 (NONJUMP_INSN_P (X) || DEBUG_INSN_P (X) || JUMP_P (X) || CALL_P (X))
467 /* Predicate yielding nonzero iff X is a note insn. */
468 #define NOTE_P(X) (GET_CODE (X) == NOTE)
470 /* Predicate yielding nonzero iff X is a barrier insn. */
471 #define BARRIER_P(X) (GET_CODE (X) == BARRIER)
473 /* Predicate yielding nonzero iff X is a data for a jump table. */
474 #define JUMP_TABLE_DATA_P(INSN) (GET_CODE (INSN) == JUMP_TABLE_DATA)
476 /* Predicate yielding nonzero iff X is a return or simple_return. */
477 #define ANY_RETURN_P(X) \
478 (GET_CODE (X) == RETURN || GET_CODE (X) == SIMPLE_RETURN)
480 /* 1 if X is a unary operator. */
483 (GET_RTX_CLASS (GET_CODE (X)) == RTX_UNARY)
485 /* 1 if X is a binary operator. */
487 #define BINARY_P(X) \
488 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_BINARY_MASK) == RTX_BINARY_RESULT)
490 /* 1 if X is an arithmetic operator. */
492 #define ARITHMETIC_P(X) \
493 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_ARITHMETIC_MASK) \
494 == RTX_ARITHMETIC_RESULT)
496 /* 1 if X is an arithmetic operator. */
498 #define COMMUTATIVE_ARITH_P(X) \
499 (GET_RTX_CLASS (GET_CODE (X)) == RTX_COMM_ARITH)
501 /* 1 if X is a commutative arithmetic operator or a comparison operator.
502 These two are sometimes selected together because it is possible to
503 swap the two operands. */
505 #define SWAPPABLE_OPERANDS_P(X) \
506 ((1 << GET_RTX_CLASS (GET_CODE (X))) \
507 & ((1 << RTX_COMM_ARITH) | (1 << RTX_COMM_COMPARE) \
508 | (1 << RTX_COMPARE)))
510 /* 1 if X is a non-commutative operator. */
512 #define NON_COMMUTATIVE_P(X) \
513 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK) \
514 == RTX_NON_COMMUTATIVE_RESULT)
516 /* 1 if X is a commutative operator on integers. */
518 #define COMMUTATIVE_P(X) \
519 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK) \
520 == RTX_COMMUTATIVE_RESULT)
522 /* 1 if X is a relational operator. */
524 #define COMPARISON_P(X) \
525 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMPARE_MASK) == RTX_COMPARE_RESULT)
527 /* 1 if X is a constant value that is an integer. */
529 #define CONSTANT_P(X) \
530 (GET_RTX_CLASS (GET_CODE (X)) == RTX_CONST_OBJ)
532 /* 1 if X can be used to represent an object. */
533 #define OBJECT_P(X) \
534 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_OBJ_MASK) == RTX_OBJ_RESULT)
536 /* General accessor macros for accessing the fields of an rtx. */
538 #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
539 /* The bit with a star outside the statement expr and an & inside is
540 so that N can be evaluated only once. */
541 #define RTL_CHECK1(RTX, N, C1) __extension__ \
542 (*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
543 const enum rtx_code _code = GET_CODE (_rtx); \
544 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
545 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
547 if (GET_RTX_FORMAT (_code)[_n] != C1) \
548 rtl_check_failed_type1 (_rtx, _n, C1, __FILE__, __LINE__, \
550 &_rtx->u.fld[_n]; }))
552 #define RTL_CHECK2(RTX, N, C1, C2) __extension__ \
553 (*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
554 const enum rtx_code _code = GET_CODE (_rtx); \
555 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
556 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
558 if (GET_RTX_FORMAT (_code)[_n] != C1 \
559 && GET_RTX_FORMAT (_code)[_n] != C2) \
560 rtl_check_failed_type2 (_rtx, _n, C1, C2, __FILE__, __LINE__, \
562 &_rtx->u.fld[_n]; }))
564 #define RTL_CHECKC1(RTX, N, C) __extension__ \
565 (*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
566 if (GET_CODE (_rtx) != (C)) \
567 rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
569 &_rtx->u.fld[_n]; }))
571 #define RTL_CHECKC2(RTX, N, C1, C2) __extension__ \
572 (*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
573 const enum rtx_code _code = GET_CODE (_rtx); \
574 if (_code != (C1) && _code != (C2)) \
575 rtl_check_failed_code2 (_rtx, (C1), (C2), __FILE__, __LINE__, \
577 &_rtx->u.fld[_n]; }))
579 #define RTVEC_ELT(RTVEC, I) __extension__ \
580 (*({ __typeof (RTVEC) const _rtvec = (RTVEC); const int _i = (I); \
581 if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \
582 rtvec_check_failed_bounds (_rtvec, _i, __FILE__, __LINE__, \
584 &_rtvec->elem[_i]; }))
586 #define XWINT(RTX, N) __extension__ \
587 (*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
588 const enum rtx_code _code = GET_CODE (_rtx); \
589 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
590 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
592 if (GET_RTX_FORMAT (_code)[_n] != 'w') \
593 rtl_check_failed_type1 (_rtx, _n, 'w', __FILE__, __LINE__, \
595 &_rtx->u.hwint[_n]; }))
597 #define XCWINT(RTX, N, C) __extension__ \
598 (*({ __typeof (RTX) const _rtx = (RTX); \
599 if (GET_CODE (_rtx) != (C)) \
600 rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
602 &_rtx->u.hwint[N]; }))
604 #define XCMWINT(RTX, N, C, M) __extension__ \
605 (*({ __typeof (RTX) const _rtx = (RTX); \
606 if (GET_CODE (_rtx) != (C) || GET_MODE (_rtx) != (M)) \
607 rtl_check_failed_code_mode (_rtx, (C), (M), false, __FILE__, \
608 __LINE__, __FUNCTION__); \
609 &_rtx->u.hwint[N]; }))
611 #define XCNMPRV(RTX, C, M) __extension__ \
612 ({ __typeof (RTX) const _rtx = (RTX); \
613 if (GET_CODE (_rtx) != (C) || GET_MODE (_rtx) == (M)) \
614 rtl_check_failed_code_mode (_rtx, (C), (M), true, __FILE__, \
615 __LINE__, __FUNCTION__); \
618 #define XCNMPFV(RTX, C, M) __extension__ \
619 ({ __typeof (RTX) const _rtx = (RTX); \
620 if (GET_CODE (_rtx) != (C) || GET_MODE (_rtx) == (M)) \
621 rtl_check_failed_code_mode (_rtx, (C), (M), true, __FILE__, \
622 __LINE__, __FUNCTION__); \
625 #define BLOCK_SYMBOL_CHECK(RTX) __extension__ \
626 ({ __typeof (RTX) const _symbol = (RTX); \
627 const unsigned int flags = RTL_CHECKC1 (_symbol, 1, SYMBOL_REF).rt_int; \
628 if ((flags & SYMBOL_FLAG_HAS_BLOCK_INFO) == 0) \
629 rtl_check_failed_block_symbol (__FILE__, __LINE__, \
631 &_symbol->u.block_sym; })
633 extern void rtl_check_failed_bounds (const_rtx, int, const char *, int,
636 extern void rtl_check_failed_type1 (const_rtx, int, int, const char *, int,
639 extern void rtl_check_failed_type2 (const_rtx, int, int, int, const char *,
642 extern void rtl_check_failed_code1 (const_rtx, enum rtx_code, const char *,
645 extern void rtl_check_failed_code2 (const_rtx, enum rtx_code, enum rtx_code,
646 const char *, int, const char *)
648 extern void rtl_check_failed_code_mode (const_rtx, enum rtx_code, enum machine_mode,
649 bool, const char *, int, const char *)
651 extern void rtl_check_failed_block_symbol (const char *, int, const char *)
653 extern void rtvec_check_failed_bounds (const_rtvec, int, const char *, int,
657 #else /* not ENABLE_RTL_CHECKING */
659 #define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N])
660 #define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N])
661 #define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N])
662 #define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N])
663 #define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
664 #define XWINT(RTX, N) ((RTX)->u.hwint[N])
665 #define XCWINT(RTX, N, C) ((RTX)->u.hwint[N])
666 #define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
667 #define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
668 #define XCNMPRV(RTX, C, M) (&(RTX)->u.rv)
669 #define XCNMPFV(RTX, C, M) (&(RTX)->u.fv)
670 #define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym)
674 /* General accessor macros for accessing the flags of an rtx. */
676 /* Access an individual rtx flag, with no checking of any kind. */
677 #define RTX_FLAG(RTX, FLAG) ((RTX)->FLAG)
679 #if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION >= 2007)
680 #define RTL_FLAG_CHECK1(NAME, RTX, C1) __extension__ \
681 ({ __typeof (RTX) const _rtx = (RTX); \
682 if (GET_CODE (_rtx) != C1) \
683 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
687 #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) __extension__ \
688 ({ __typeof (RTX) const _rtx = (RTX); \
689 if (GET_CODE (_rtx) != C1 && GET_CODE(_rtx) != C2) \
690 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
694 #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) __extension__ \
695 ({ __typeof (RTX) const _rtx = (RTX); \
696 if (GET_CODE (_rtx) != C1 && GET_CODE(_rtx) != C2 \
697 && GET_CODE (_rtx) != C3) \
698 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
702 #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) __extension__ \
703 ({ __typeof (RTX) const _rtx = (RTX); \
704 if (GET_CODE (_rtx) != C1 && GET_CODE(_rtx) != C2 \
705 && GET_CODE (_rtx) != C3 && GET_CODE(_rtx) != C4) \
706 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
710 #define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) __extension__ \
711 ({ __typeof (RTX) const _rtx = (RTX); \
712 if (GET_CODE (_rtx) != C1 && GET_CODE (_rtx) != C2 \
713 && GET_CODE (_rtx) != C3 && GET_CODE (_rtx) != C4 \
714 && GET_CODE (_rtx) != C5) \
715 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
719 #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) \
721 ({ __typeof (RTX) const _rtx = (RTX); \
722 if (GET_CODE (_rtx) != C1 && GET_CODE (_rtx) != C2 \
723 && GET_CODE (_rtx) != C3 && GET_CODE (_rtx) != C4 \
724 && GET_CODE (_rtx) != C5 && GET_CODE (_rtx) != C6) \
725 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
729 #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) \
731 ({ __typeof (RTX) const _rtx = (RTX); \
732 if (GET_CODE (_rtx) != C1 && GET_CODE (_rtx) != C2 \
733 && GET_CODE (_rtx) != C3 && GET_CODE (_rtx) != C4 \
734 && GET_CODE (_rtx) != C5 && GET_CODE (_rtx) != C6 \
735 && GET_CODE (_rtx) != C7) \
736 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
740 #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) \
742 ({ __typeof (RTX) const _rtx = (RTX); \
743 if (GET_CODE (_rtx) != C1 && GET_CODE (_rtx) != C2 \
744 && GET_CODE (_rtx) != C3 && GET_CODE (_rtx) != C4 \
745 && GET_CODE (_rtx) != C5 && GET_CODE (_rtx) != C6 \
746 && GET_CODE (_rtx) != C7 && GET_CODE (_rtx) != C8) \
747 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
751 extern void rtl_check_failed_flag (const char *, const_rtx, const char *,
756 #else /* not ENABLE_RTL_FLAG_CHECKING */
758 #define RTL_FLAG_CHECK1(NAME, RTX, C1) (RTX)
759 #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) (RTX)
760 #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) (RTX)
761 #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) (RTX)
762 #define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX)
763 #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) (RTX)
764 #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) (RTX)
765 #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX)
768 #define XINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rt_int)
769 #define XUINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rt_uint)
770 #define XSTR(RTX, N) (RTL_CHECK2 (RTX, N, 's', 'S').rt_str)
771 #define XEXP(RTX, N) (RTL_CHECK2 (RTX, N, 'e', 'u').rt_rtx)
772 #define XVEC(RTX, N) (RTL_CHECK2 (RTX, N, 'E', 'V').rt_rtvec)
773 #define XMODE(RTX, N) (RTL_CHECK1 (RTX, N, 'M').rt_type)
774 #define XTREE(RTX, N) (RTL_CHECK1 (RTX, N, 't').rt_tree)
775 #define XBBDEF(RTX, N) (RTL_CHECK1 (RTX, N, 'B').rt_bb)
776 #define XTMPL(RTX, N) (RTL_CHECK1 (RTX, N, 'T').rt_str)
777 #define XCFI(RTX, N) (RTL_CHECK1 (RTX, N, 'C').rt_cfi)
779 #define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M)
780 #define XVECLEN(RTX, N) GET_NUM_ELEM (XVEC (RTX, N))
782 /* These are like XINT, etc. except that they expect a '0' field instead
783 of the normal type code. */
785 #define X0INT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_int)
786 #define X0UINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_uint)
787 #define X0STR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_str)
788 #define X0EXP(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_rtx)
789 #define X0VEC(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_rtvec)
790 #define X0MODE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_type)
791 #define X0TREE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_tree)
792 #define X0BBDEF(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_bb)
793 #define X0ADVFLAGS(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_addr_diff_vec_flags)
794 #define X0CSELIB(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_cselib)
795 #define X0MEMATTR(RTX, N) (RTL_CHECKC1 (RTX, N, MEM).rt_mem)
796 #define X0REGATTR(RTX, N) (RTL_CHECKC1 (RTX, N, REG).rt_reg)
797 #define X0CONSTANT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_constant)
799 /* Access a '0' field with any type. */
800 #define X0ANY(RTX, N) RTL_CHECK1 (RTX, N, '0')
802 #define XCINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_int)
803 #define XCUINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_uint)
804 #define XCSTR(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_str)
805 #define XCEXP(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_rtx)
806 #define XCVEC(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_rtvec)
807 #define XCMODE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_type)
808 #define XCTREE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_tree)
809 #define XCBBDEF(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_bb)
810 #define XCCFI(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_cfi)
811 #define XCCSELIB(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_cselib)
813 #define XCVECEXP(RTX, N, M, C) RTVEC_ELT (XCVEC (RTX, N, C), M)
814 #define XCVECLEN(RTX, N, C) GET_NUM_ELEM (XCVEC (RTX, N, C))
816 #define XC2EXP(RTX, N, C1, C2) (RTL_CHECKC2 (RTX, N, C1, C2).rt_rtx)
818 /* ACCESS MACROS for particular fields of insns. */
820 /* Holds a unique number for each insn.
821 These are not necessarily sequentially increasing. */
822 #define INSN_UID(INSN) XINT (INSN, 0)
824 /* Chain insns together in sequence. */
825 #define PREV_INSN(INSN) XEXP (INSN, 1)
826 #define NEXT_INSN(INSN) XEXP (INSN, 2)
828 #define BLOCK_FOR_INSN(INSN) XBBDEF (INSN, 3)
830 /* The body of an insn. */
831 #define PATTERN(INSN) XEXP (INSN, 4)
833 #define INSN_LOCATION(INSN) XUINT (INSN, 5)
835 #define INSN_HAS_LOCATION(INSN) ((LOCATION_LOCUS (INSN_LOCATION (INSN)))\
838 /* LOCATION of an RTX if relevant. */
839 #define RTL_LOCATION(X) (INSN_P (X) ? \
840 INSN_LOCATION (X) : UNKNOWN_LOCATION)
842 /* Code number of instruction, from when it was recognized.
843 -1 means this instruction has not been recognized yet. */
844 #define INSN_CODE(INSN) XINT (INSN, 6)
846 #define RTX_FRAME_RELATED_P(RTX) \
848 CALL_INSN, JUMP_INSN, BARRIER, SET)->frame_related)
850 /* 1 if RTX is an insn that has been deleted. */
851 #define INSN_DELETED_P(RTX) \
853 CALL_INSN, JUMP_INSN, JUMP_TABLE_DATA, \
854 CODE_LABEL, BARRIER, NOTE)->volatil)
856 /* 1 if RTX is a call to a const function. Built from ECF_CONST and
858 #define RTL_CONST_CALL_P(RTX) \
861 /* 1 if RTX is a call to a pure function. Built from ECF_PURE and
863 #define RTL_PURE_CALL_P(RTX) \
866 /* 1 if RTX is a call to a const or pure function. */
867 #define RTL_CONST_OR_PURE_CALL_P(RTX) \
868 (RTL_CONST_CALL_P (RTX) || RTL_PURE_CALL_P (RTX))
870 /* 1 if RTX is a call to a looping const or pure function. Built from
871 ECF_LOOPING_CONST_OR_PURE and DECL_LOOPING_CONST_OR_PURE_P. */
872 #define RTL_LOOPING_CONST_OR_PURE_CALL_P(RTX) \
873 (RTL_FLAG_CHECK1 ("CONST_OR_PURE_CALL_P
", (RTX), CALL_INSN)->call)
875 /* 1 if RTX is a call_insn for a sibling call. */
876 #define SIBLING_CALL_P(RTX) \
879 /* 1 if RTX is a jump_insn, call_insn, or insn that is an annulling branch. */
880 #define INSN_ANNULLED_BRANCH_P(RTX) \
883 /* 1 if RTX is an insn in a delay slot and is from the target of the branch.
884 If the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
885 executed if the branch is taken. For annulled branches with this bit
886 clear, the insn should be executed only if the branch is not taken. */
887 #define INSN_FROM_TARGET_P(RTX) \
889 CALL_INSN)->in_struct)
891 /* In an ADDR_DIFF_VEC, the flags for RTX for use by branch shortening.
892 See the comments for ADDR_DIFF_VEC in rtl.def. */
893 #define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS (RTX, 4)
895 /* In a VALUE, the value cselib has assigned to RTX.
897 #define CSELIB_VAL_PTR(RTX) X0CSELIB (RTX, 0)
904 #define REG_NOTES(INSN) XEXP(INSN, 7)
908 #define ENTRY_VALUE_EXP(RTX) (RTL_CHECKC1 (RTX, 0, ENTRY_VALUE).rt_rtx)
912 #define DEF_REG_NOTE(NAME) NAME,
913 #include "reg-notes.def"
919 #define REG_NOTE_KIND(LINK) ((enum reg_note) GET_MODE (LINK))
920 #define PUT_REG_NOTE_KIND(LINK, KIND) \
921 PUT_MODE (LINK, (enum machine_mode) (KIND))
926 #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
935 #define CALL_INSN_FUNCTION_USAGE(INSN) XEXP(INSN, 8)
940 #define CODE_LABEL_NUMBER(INSN) XINT (INSN, 6)
949 #define NOTE_DATA(INSN) RTL_CHECKC1 (INSN, 4, NOTE)
950 #define NOTE_DELETED_LABEL_NAME(INSN) XCSTR (INSN, 4, NOTE)
951 #define SET_INSN_DELETED(INSN) set_insn_deleted (INSN);
952 #define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
953 #define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
954 #define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE)
955 #define NOTE_VAR_LOCATION(INSN) XCEXP (INSN, 4, NOTE)
956 #define NOTE_CFI(INSN) XCCFI (INSN, 4, NOTE)
957 #define NOTE_LABEL_NUMBER(INSN) XCINT (INSN, 4, NOTE)
961 #define NOTE_KIND(INSN) XCINT (INSN, 5, NOTE)
964 #define NOTE_INSN_BASIC_BLOCK_P(INSN) \
965 (NOTE_P (INSN) && NOTE_KIND (INSN) == NOTE_INSN_BASIC_BLOCK)
968 #define PAT_VAR_LOCATION_DECL(PAT) (XCTREE ((PAT), 0, VAR_LOCATION))
969 #define PAT_VAR_LOCATION_LOC(PAT) (XCEXP ((PAT), 1, VAR_LOCATION))
974 #define PAT_VAR_LOCATION_STATUS(PAT) \
975 ((enum var_init_status) (XCINT ((PAT), 2, VAR_LOCATION)))
978 #define NOTE_VAR_LOCATION_DECL(NOTE) \
979 PAT_VAR_LOCATION_DECL (NOTE_VAR_LOCATION (NOTE))
980 #define NOTE_VAR_LOCATION_LOC(NOTE) \
981 PAT_VAR_LOCATION_LOC (NOTE_VAR_LOCATION (NOTE))
982 #define NOTE_VAR_LOCATION_STATUS(NOTE) \
983 PAT_VAR_LOCATION_STATUS (NOTE_VAR_LOCATION (NOTE))
986 #define INSN_VAR_LOCATION(INSN) PATTERN (INSN)
989 #define INSN_VAR_LOCATION_DECL(INSN) \
990 PAT_VAR_LOCATION_DECL (INSN_VAR_LOCATION (INSN))
991 #define INSN_VAR_LOCATION_LOC(INSN) \
992 PAT_VAR_LOCATION_LOC (INSN_VAR_LOCATION (INSN))
993 #define INSN_VAR_LOCATION_STATUS(INSN) \
994 PAT_VAR_LOCATION_STATUS (INSN_VAR_LOCATION (INSN))
998 #define gen_rtx_UNKNOWN_VAR_LOC() (gen_rtx_CLOBBER (VOIDmode, const0_rtx))
1001 #define VAR_LOC_UNKNOWN_P(X) \
1002 (GET_CODE (X) == CLOBBER && XEXP ((X), 0) == const0_rtx)
1006 #define NOTE_DURING_CALL_P(RTX) \
1007 (RTL_FLAG_CHECK1 ("NOTE_VAR_LOCATION_DURING_CALL_P", (RTX), NOTE)->call)
1010 #define DEBUG_EXPR_TREE_DECL(RTX) XCTREE (RTX, 0, DEBUG_EXPR)
1013 #define DEBUG_IMPLICIT_PTR_DECL(RTX) XCTREE (RTX, 0, DEBUG_IMPLICIT_PTR)
1016 #define DEBUG_PARAMETER_REF_DECL(RTX) XCTREE (RTX, 0, DEBUG_PARAMETER_REF)
1029 #define DEF_INSN_NOTE(NAME) NAME,
1030 #include "insn-notes.def"
1031 #undef DEF_INSN_NOTE
1039 #define GET_NOTE_INSN_NAME(NOTE_CODE) \
1040 (note_insn_name[(NOTE_CODE)])
1044 #define LABEL_NAME(RTX) XCSTR (RTX, 7, CODE_LABEL)
1048 #define LABEL_NUSES(RTX) XCINT (RTX, 5, CODE_LABEL)
1061 #if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION > 2007)
1064 #define LABEL_KIND(LABEL) __extension__ \
1065 ({ __typeof (LABEL) const _label = (LABEL); \
1066 if (! LABEL_P (_label)) \
1067 rtl_check_failed_flag ("LABEL_KIND", _label, __FILE__, __LINE__, \
1069 (enum label_kind) ((_label->jump << 1) | _label->call); })
1072 #define SET_LABEL_KIND(LABEL, KIND) do { \
1073 __typeof (LABEL) const _label = (LABEL); \
1074 const unsigned int _kind = (KIND); \
1075 if (! LABEL_P (_label)) \
1076 rtl_check_failed_flag ("SET_LABEL_KIND", _label, __FILE__, __LINE__, \
1078 _label->jump = ((_kind >> 1) & 1); \
1079 _label->call = (_kind & 1); \
1085 #define LABEL_KIND(LABEL) \
1086 ((enum label_kind) (((LABEL)->jump << 1) | (LABEL)->call))
1089 #define SET_LABEL_KIND(LABEL, KIND) do { \
1090 rtx const _label = (LABEL); \
1091 const unsigned int _kind = (KIND); \
1092 _label->jump = ((_kind >> 1) & 1); \
1093 _label->call = (_kind & 1); \
1098 #define LABEL_ALT_ENTRY_P(LABEL) (LABEL_KIND (LABEL) != LABEL_NORMAL)
1103 #define JUMP_LABEL(INSN) XCEXP (INSN, 8, JUMP_INSN)
1108 #define LABEL_REFS(LABEL) XCEXP (LABEL, 4, CODE_LABEL)
1112 #define REGNO(RTX) (rhs_regno(RTX))
1113 #define SET_REGNO(RTX,N) \
1114 (df_ref_change_reg_with_loc (REGNO (RTX), N, RTX), XCUINT (RTX, 0, REG) = N)
1115 #define SET_REGNO_RAW(RTX,N) (XCUINT (RTX, 0, REG) = N)
1120 #define ORIGINAL_REGNO(RTX) X0UINT (RTX, 1)
1123 static inline unsigned int
1126 return XCUINT (x, 0, REG);
1132 #define REG_FUNCTION_VALUE_P(RTX) \
1133 (RTL_FLAG_CHECK2 ("REG_FUNCTION_VALUE_P", (RTX), REG, PARALLEL)->return_val)
1136 #define REG_USERVAR_P(RTX) \
1137 (RTL_FLAG_CHECK1 ("REG_USERVAR_P", (RTX), REG)->volatil)
1140 #define REG_POINTER(RTX) \
1141 (RTL_FLAG_CHECK1 ("REG_POINTER", (RTX), REG)->frame_related)
1144 #define MEM_POINTER(RTX) \
1145 (RTL_FLAG_CHECK1 ("MEM_POINTER", (RTX), MEM)->frame_related)
1148 #define HARD_REGISTER_P(REG) (HARD_REGISTER_NUM_P (REGNO (REG)))
1151 #define HARD_REGISTER_NUM_P(REG_NO) ((REG_NO) < FIRST_PSEUDO_REGISTER)
1154 #define INTVAL(RTX) XCWINT (RTX, 0, CONST_INT)
1155 #define UINTVAL(RTX) ((unsigned HOST_WIDE_INT) INTVAL (RTX))
1162 #define CONST_DOUBLE_LOW(r) XCMWINT (r, 0, CONST_DOUBLE, VOIDmode)
1163 #define CONST_DOUBLE_HIGH(r) XCMWINT (r, 1, CONST_DOUBLE, VOIDmode)
1164 #define CONST_DOUBLE_REAL_VALUE(r) \
1165 ((const struct real_value *) XCNMPRV (r, CONST_DOUBLE, VOIDmode))
1167 #define CONST_FIXED_VALUE(r) \
1168 ((const struct fixed_value *) XCNMPFV (r, CONST_FIXED, VOIDmode))
1169 #define CONST_FIXED_VALUE_HIGH(r) \
1170 ((HOST_WIDE_INT) (CONST_FIXED_VALUE (r)->data.high))
1171 #define CONST_FIXED_VALUE_LOW(r) \
1172 ((HOST_WIDE_INT) (CONST_FIXED_VALUE (r)->data.low))
1175 #define CONST_VECTOR_ELT(RTX, N) XCVECEXP (RTX, 0, N, CONST_VECTOR)
1178 #define CONST_VECTOR_NUNITS(RTX) XCVECLEN (RTX, 0, CONST_VECTOR)
1183 #define SUBREG_REG(RTX) XCEXP (RTX, 0, SUBREG)
1184 #define SUBREG_BYTE(RTX) XCUINT (RTX, 1, SUBREG)
1190 #define COSTS_N_INSNS(N) ((N) * 4)
1194 #define MAX_COST INT_MAX
1249 enum machine_mode
mode;
1320 extern unsigned int subreg_lsb_1 (
enum machine_mode,
enum machine_mode,
1323 unsigned int,
enum machine_mode);
1325 unsigned int,
enum machine_mode);
1328 unsigned int,
enum machine_mode);
1346 #ifndef GENERATOR_FILE
1353 return rtx_cost (x, INSN, 4, speed_p);
1391 #define SUBREG_PROMOTED_VAR_P(RTX) \
1392 (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED", (RTX), SUBREG)->in_struct)
1394 #define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL) \
1396 rtx const _rtx = RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_UNSIGNED_SET", \
1399 _rtx->volatil = 1; \
1401 _rtx->volatil = 0; \
1402 _rtx->unchanging = (VAL); \
1414 #define SUBREG_PROMOTED_UNSIGNED_P(RTX) \
1415 ((RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil) \
1416 ? -1 : (int) (RTX)->unchanging)
1420 #define LRA_SUBREG_P(RTX) \
1421 (RTL_FLAG_CHECK1 ("LRA_SUBREG_P", (RTX), SUBREG)->jump)
1425 #define ASM_OPERANDS_TEMPLATE(RTX) XCSTR (RTX, 0, ASM_OPERANDS)
1426 #define ASM_OPERANDS_OUTPUT_CONSTRAINT(RTX) XCSTR (RTX, 1, ASM_OPERANDS)
1427 #define ASM_OPERANDS_OUTPUT_IDX(RTX) XCINT (RTX, 2, ASM_OPERANDS)
1428 #define ASM_OPERANDS_INPUT_VEC(RTX) XCVEC (RTX, 3, ASM_OPERANDS)
1429 #define ASM_OPERANDS_INPUT_CONSTRAINT_VEC(RTX) XCVEC (RTX, 4, ASM_OPERANDS)
1430 #define ASM_OPERANDS_INPUT(RTX, N) XCVECEXP (RTX, 3, N, ASM_OPERANDS)
1431 #define ASM_OPERANDS_INPUT_LENGTH(RTX) XCVECLEN (RTX, 3, ASM_OPERANDS)
1432 #define ASM_OPERANDS_INPUT_CONSTRAINT_EXP(RTX, N) \
1433 XCVECEXP (RTX, 4, N, ASM_OPERANDS)
1434 #define ASM_OPERANDS_INPUT_CONSTRAINT(RTX, N) \
1435 XSTR (XCVECEXP (RTX, 4, N, ASM_OPERANDS), 0)
1436 #define ASM_OPERANDS_INPUT_MODE(RTX, N) \
1437 GET_MODE (XCVECEXP (RTX, 4, N, ASM_OPERANDS))
1438 #define ASM_OPERANDS_LABEL_VEC(RTX) XCVEC (RTX, 5, ASM_OPERANDS)
1439 #define ASM_OPERANDS_LABEL_LENGTH(RTX) XCVECLEN (RTX, 5, ASM_OPERANDS)
1440 #define ASM_OPERANDS_LABEL(RTX, N) XCVECEXP (RTX, 5, N, ASM_OPERANDS)
1441 #define ASM_OPERANDS_SOURCE_LOCATION(RTX) XCUINT (RTX, 6, ASM_OPERANDS)
1442 #define ASM_INPUT_SOURCE_LOCATION(RTX) XCUINT (RTX, 1, ASM_INPUT)
1445 #define MEM_READONLY_P(RTX) \
1446 (RTL_FLAG_CHECK1 ("MEM_READONLY_P", (RTX), MEM)->unchanging)
1451 #define MEM_KEEP_ALIAS_SET_P(RTX) \
1452 (RTL_FLAG_CHECK1 ("MEM_KEEP_ALIAS_SET_P", (RTX), MEM)->jump)
1455 #define MEM_VOLATILE_P(RTX) \
1456 (RTL_FLAG_CHECK3 ("MEM_VOLATILE_P", (RTX), MEM, ASM_OPERANDS, \
1457 ASM_INPUT)->volatil)
1460 #define MEM_NOTRAP_P(RTX) \
1461 (RTL_FLAG_CHECK1 ("MEM_NOTRAP_P", (RTX), MEM)->call)
1465 #define MEM_ATTRS(RTX) X0MEMATTR (RTX, 1)
1469 #define REG_ATTRS(RTX) X0REGATTR (RTX, 2)
1471 #ifndef GENERATOR_FILE
1478 #define MEM_ALIAS_SET(RTX) (get_mem_attrs (RTX)->alias)
1482 #define MEM_EXPR(RTX) (get_mem_attrs (RTX)->expr)
1485 #define MEM_OFFSET_KNOWN_P(RTX) (get_mem_attrs (RTX)->offset_known_p)
1488 #define MEM_OFFSET(RTX) (get_mem_attrs (RTX)->offset)
1491 #define MEM_ADDR_SPACE(RTX) (get_mem_attrs (RTX)->addrspace)
1494 #define MEM_SIZE_KNOWN_P(RTX) (get_mem_attrs (RTX)->size_known_p)
1497 #define MEM_SIZE(RTX) (get_mem_attrs (RTX)->size)
1501 #define MEM_ALIGN(RTX) (get_mem_attrs (RTX)->align)
1503 #define MEM_ADDR_SPACE(RTX) ADDR_SPACE_GENERIC
1508 #define REG_EXPR(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->decl)
1512 #define REG_OFFSET(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->offset)
1515 #define MEM_COPY_ATTRIBUTES(LHS, RHS) \
1516 (MEM_VOLATILE_P (LHS) = MEM_VOLATILE_P (RHS), \
1517 MEM_NOTRAP_P (LHS) = MEM_NOTRAP_P (RHS), \
1518 MEM_READONLY_P (LHS) = MEM_READONLY_P (RHS), \
1519 MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \
1520 MEM_POINTER (LHS) = MEM_POINTER (RHS), \
1521 MEM_ATTRS (LHS) = MEM_ATTRS (RHS))
1526 #define LABEL_REF_NONLOCAL_P(RTX) \
1527 (RTL_FLAG_CHECK1 ("LABEL_REF_NONLOCAL_P", (RTX), LABEL_REF)->volatil)
1530 #define LABEL_PRESERVE_P(RTX) \
1531 (RTL_FLAG_CHECK2 ("LABEL_PRESERVE_P", (RTX), CODE_LABEL, NOTE)->in_struct)
1535 #define SCHED_GROUP_P(RTX) \
1536 (RTL_FLAG_CHECK4 ("SCHED_GROUP_P", (RTX), DEBUG_INSN, INSN, \
1537 JUMP_INSN, CALL_INSN)->in_struct)
1541 #define SET_DEST(RTX) XC2EXP (RTX, 0, SET, CLOBBER)
1542 #define SET_SRC(RTX) XCEXP (RTX, 1, SET)
1543 #define SET_IS_RETURN_P(RTX) \
1544 (RTL_FLAG_CHECK1 ("SET_IS_RETURN_P", (RTX), SET)->jump)
1547 #define TRAP_CONDITION(RTX) XCEXP (RTX, 0, TRAP_IF)
1548 #define TRAP_CODE(RTX) XCEXP (RTX, 1, TRAP_IF)
1553 #define COND_EXEC_TEST(RTX) XCEXP (RTX, 0, COND_EXEC)
1554 #define COND_EXEC_CODE(RTX) XCEXP (RTX, 1, COND_EXEC)
1558 #define CONSTANT_POOL_ADDRESS_P(RTX) \
1559 (RTL_FLAG_CHECK1 ("CONSTANT_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->unchanging)
1563 #define TREE_CONSTANT_POOL_ADDRESS_P(RTX) \
1564 (RTL_FLAG_CHECK1 ("TREE_CONSTANT_POOL_ADDRESS_P", \
1565 (RTX), SYMBOL_REF)->frame_related)
1568 #define SYMBOL_REF_FLAG(RTX) \
1569 (RTL_FLAG_CHECK1 ("SYMBOL_REF_FLAG", (RTX), SYMBOL_REF)->volatil)
1573 #define SYMBOL_REF_USED(RTX) \
1574 (RTL_FLAG_CHECK1 ("SYMBOL_REF_USED", (RTX), SYMBOL_REF)->used)
1577 #define SYMBOL_REF_WEAK(RTX) \
1578 (RTL_FLAG_CHECK1 ("SYMBOL_REF_WEAK", (RTX), SYMBOL_REF)->return_val)
1582 #define SYMBOL_REF_DATA(RTX) X0ANY ((RTX), 2)
1586 #define SET_SYMBOL_REF_DECL(RTX, DECL) \
1587 (gcc_assert (!CONSTANT_POOL_ADDRESS_P (RTX)), X0TREE ((RTX), 2) = (DECL))
1590 #define SYMBOL_REF_DECL(RTX) \
1591 (CONSTANT_POOL_ADDRESS_P (RTX) ? NULL : X0TREE ((RTX), 2))
1594 #define SET_SYMBOL_REF_CONSTANT(RTX, C) \
1595 (gcc_assert (CONSTANT_POOL_ADDRESS_P (RTX)), X0CONSTANT ((RTX), 2) = (C))
1598 #define SYMBOL_REF_CONSTANT(RTX) \
1599 (CONSTANT_POOL_ADDRESS_P (RTX) ? X0CONSTANT ((RTX), 2) : NULL)
1608 #define SYMBOL_REF_FLAGS(RTX) X0INT ((RTX), 1)
1614 #define SYMBOL_FLAG_FUNCTION (1 << 0)
1615 #define SYMBOL_REF_FUNCTION_P(RTX) \
1616 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_FUNCTION) != 0)
1618 #define SYMBOL_FLAG_LOCAL (1 << 1)
1619 #define SYMBOL_REF_LOCAL_P(RTX) \
1620 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_LOCAL) != 0)
1622 #define SYMBOL_FLAG_SMALL (1 << 2)
1623 #define SYMBOL_REF_SMALL_P(RTX) \
1624 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_SMALL) != 0)
1627 #define SYMBOL_FLAG_TLS_SHIFT 3
1628 #define SYMBOL_REF_TLS_MODEL(RTX) \
1629 ((enum tls_model) ((SYMBOL_REF_FLAGS (RTX) >> SYMBOL_FLAG_TLS_SHIFT) & 7))
1631 #define SYMBOL_FLAG_EXTERNAL (1 << 6)
1632 #define SYMBOL_REF_EXTERNAL_P(RTX) \
1633 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_EXTERNAL) != 0)
1635 #define SYMBOL_FLAG_HAS_BLOCK_INFO (1 << 7)
1636 #define SYMBOL_REF_HAS_BLOCK_INFO_P(RTX) \
1637 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_HAS_BLOCK_INFO) != 0)
1640 #define SYMBOL_FLAG_ANCHOR (1 << 8)
1641 #define SYMBOL_REF_ANCHOR_P(RTX) \
1642 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_ANCHOR) != 0)
1645 #define SYMBOL_FLAG_MACH_DEP_SHIFT 9
1646 #define SYMBOL_FLAG_MACH_DEP (1 << SYMBOL_FLAG_MACH_DEP_SHIFT)
1651 #define SYMBOL_REF_BLOCK(RTX) (BLOCK_SYMBOL_CHECK (RTX)->block)
1657 #define SYMBOL_REF_BLOCK_OFFSET(RTX) (BLOCK_SYMBOL_CHECK (RTX)->offset)
1660 #define PREFETCH_SCHEDULE_BARRIER_P(RTX) \
1661 (RTL_FLAG_CHECK1 ("PREFETCH_SCHEDULE_BARRIER_P", (RTX), PREFETCH)->volatil)
1666 #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) \
1667 || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT) \
1668 || defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_POST_MODIFY_DISP) \
1669 || defined (HAVE_PRE_MODIFY_REG) || defined (HAVE_POST_MODIFY_REG))
1670 #define AUTO_INC_DEC
1677 #define FIND_REG_INC_NOTE(INSN, REG) \
1678 ((REG) != NULL_RTX && REG_P ((REG)) \
1679 ? find_regno_note ((INSN), REG_INC, REGNO (REG)) \
1680 : find_reg_note ((INSN), REG_INC, (REG)))
1682 #define FIND_REG_INC_NOTE(INSN, REG) 0
1685 #ifndef HAVE_PRE_INCREMENT
1686 #define HAVE_PRE_INCREMENT 0
1689 #ifndef HAVE_PRE_DECREMENT
1690 #define HAVE_PRE_DECREMENT 0
1693 #ifndef HAVE_POST_INCREMENT
1694 #define HAVE_POST_INCREMENT 0
1697 #ifndef HAVE_POST_DECREMENT
1698 #define HAVE_POST_DECREMENT 0
1701 #ifndef HAVE_POST_MODIFY_DISP
1702 #define HAVE_POST_MODIFY_DISP 0
1705 #ifndef HAVE_POST_MODIFY_REG
1706 #define HAVE_POST_MODIFY_REG 0
1709 #ifndef HAVE_PRE_MODIFY_DISP
1710 #define HAVE_PRE_MODIFY_DISP 0
1713 #ifndef HAVE_PRE_MODIFY_REG
1714 #define HAVE_PRE_MODIFY_REG 0
1722 #ifndef USE_LOAD_POST_INCREMENT
1723 #define USE_LOAD_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
1726 #ifndef USE_LOAD_POST_DECREMENT
1727 #define USE_LOAD_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
1730 #ifndef USE_LOAD_PRE_INCREMENT
1731 #define USE_LOAD_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
1734 #ifndef USE_LOAD_PRE_DECREMENT
1735 #define USE_LOAD_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
1738 #ifndef USE_STORE_POST_INCREMENT
1739 #define USE_STORE_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
1742 #ifndef USE_STORE_POST_DECREMENT
1743 #define USE_STORE_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
1746 #ifndef USE_STORE_PRE_INCREMENT
1747 #define USE_STORE_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
1750 #ifndef USE_STORE_PRE_DECREMENT
1751 #define USE_STORE_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
1768 #define rtx_alloc(c) rtx_alloc_stat (c MEM_STAT_INFO)
1782 #define shallow_copy_rtx(a) shallow_copy_rtx_stat (a MEM_STAT_INFO)
1815 #define convert_memory_address(to_mode,x) \
1816 convert_memory_address_addr_space ((to_mode), (x), ADDR_SPACE_GENERIC)
1848 #define ASLK_REDUCE_ALIGN 1
1849 #define ASLK_RECORD_PAD 2
1949 rtx,
enum machine_mode);
1959 enum machine_mode,
rtx,
rtx);
1961 enum machine_mode,
rtx,
rtx);
1998 #define single_set(I) (INSN_P (I) \
1999 ? (GET_CODE (PATTERN (I)) == SET \
2000 ? PATTERN (I) : single_set_1 (I)) \
2002 #define single_set_1(I) single_set_2 (I, PATTERN (I))
2096 rtx srcoff,
void *arg);
2105 enum machine_mode *);
2106 extern unsigned hash_rtx_cb (const_rtx,
enum machine_mode,
int *,
int *,
2140 unsigned int,
enum machine_mode,
2183 #define MAX_SAVED_CONST_INT 64
2186 #define const0_rtx (const_int_rtx[MAX_SAVED_CONST_INT])
2187 #define const1_rtx (const_int_rtx[MAX_SAVED_CONST_INT+1])
2188 #define const2_rtx (const_int_rtx[MAX_SAVED_CONST_INT+2])
2189 #define constm1_rtx (const_int_rtx[MAX_SAVED_CONST_INT-1])
2197 #define CONST0_RTX(MODE) (const_tiny_rtx[0][(int) (MODE)])
2201 #define CONST1_RTX(MODE) (const_tiny_rtx[1][(int) (MODE)])
2202 #define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
2203 #define CONSTM1_RTX(MODE) (const_tiny_rtx[3][(int) (MODE)])
2216 #ifndef HARD_FRAME_POINTER_REGNUM
2217 #define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM
2220 #ifndef HARD_FRAME_POINTER_IS_FRAME_POINTER
2221 #define HARD_FRAME_POINTER_IS_FRAME_POINTER \
2222 (HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM)
2225 #ifndef HARD_FRAME_POINTER_IS_ARG_POINTER
2226 #define HARD_FRAME_POINTER_IS_ARG_POINTER \
2227 (HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM)
2238 #if FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
2241 #if HARD_FRAME_POINTER_IS_FRAME_POINTER
2246 #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
2247 #if HARD_FRAME_POINTER_IS_ARG_POINTER
2280 rtx x_global_rtl[
GR_MAX];
2283 rtx x_pic_offset_table_rtx;
2288 rtx x_return_address_pointer_rtx;
2294 rtx x_initial_regno_reg_rtx[FIRST_PSEUDO_REGISTER];
2297 rtx x_top_of_stack[MAX_MACHINE_MODE];
2301 rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER];
2304 struct mem_attrs *x_mode_mem_attrs[(int) MAX_MACHINE_MODE];
2308 #if SWITCHABLE_TARGET
2311 #define this_target_rtl (&default_target_rtl)
2314 #define global_rtl \
2315 (this_target_rtl->x_global_rtl)
2316 #define pic_offset_table_rtx \
2317 (this_target_rtl->x_pic_offset_table_rtx)
2318 #define return_address_pointer_rtx \
2319 (this_target_rtl->x_return_address_pointer_rtx)
2320 #define top_of_stack \
2321 (this_target_rtl->x_top_of_stack)
2322 #define mode_mem_attrs \
2323 (this_target_rtl->x_mode_mem_attrs)
2328 #define stack_pointer_rtx (global_rtl[GR_STACK_POINTER])
2329 #define frame_pointer_rtx (global_rtl[GR_FRAME_POINTER])
2330 #define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
2331 #define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
2333 #ifndef GENERATOR_FILE
2349 #ifndef GENERATOR_FILE
2351 #undef gen_rtx_ASM_INPUT
2352 #define gen_rtx_ASM_INPUT(MODE, ARG0) \
2353 gen_rtx_fmt_si (ASM_INPUT, (MODE), (ARG0), 0)
2354 #define gen_rtx_ASM_INPUT_loc(MODE, ARG0, LOC) \
2355 gen_rtx_fmt_si (ASM_INPUT, (MODE), (ARG0), (LOC))
2365 extern rtx
gen_rtx_REG (
enum machine_mode,
unsigned);
2369 #define GEN_INT(N) gen_rtx_CONST_INT (VOIDmode, (N))
2377 #define FIRST_VIRTUAL_REGISTER (FIRST_PSEUDO_REGISTER)
2383 #define virtual_incoming_args_rtx (global_rtl[GR_VIRTUAL_INCOMING_ARGS])
2385 #define VIRTUAL_INCOMING_ARGS_REGNUM (FIRST_VIRTUAL_REGISTER)
2391 #define virtual_stack_vars_rtx (global_rtl[GR_VIRTUAL_STACK_ARGS])
2393 #define VIRTUAL_STACK_VARS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 1)
2399 #define virtual_stack_dynamic_rtx (global_rtl[GR_VIRTUAL_STACK_DYNAMIC])
2401 #define VIRTUAL_STACK_DYNAMIC_REGNUM ((FIRST_VIRTUAL_REGISTER) + 2)
2407 #define virtual_outgoing_args_rtx (global_rtl[GR_VIRTUAL_OUTGOING_ARGS])
2409 #define VIRTUAL_OUTGOING_ARGS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 3)
2417 #define virtual_cfa_rtx (global_rtl[GR_VIRTUAL_CFA])
2419 #define VIRTUAL_CFA_REGNUM ((FIRST_VIRTUAL_REGISTER) + 4)
2421 #define LAST_VIRTUAL_POINTER_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
2426 #define virtual_preferred_stack_boundary_rtx \
2427 (global_rtl[GR_VIRTUAL_PREFERRED_STACK_BOUNDARY])
2429 #define VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM \
2430 ((FIRST_VIRTUAL_REGISTER) + 5)
2432 #define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 5)
2435 #define REGNO_PTR_FRAME_P(REGNUM) \
2436 ((REGNUM) == STACK_POINTER_REGNUM \
2437 || (REGNUM) == FRAME_POINTER_REGNUM \
2438 || (REGNUM) == HARD_FRAME_POINTER_REGNUM \
2439 || (REGNUM) == ARG_POINTER_REGNUM \
2440 || ((REGNUM) >= FIRST_VIRTUAL_REGISTER \
2441 && (REGNUM) <= LAST_VIRTUAL_POINTER_REGISTER))
2444 #define INVALID_REGNUM (~(unsigned int) 0)
2447 #define IGNORED_DWARF_REGNUM (INVALID_REGNUM - 1)
2471 #define can_create_pseudo_p() (!reload_in_progress && !reload_completed)
2476 extern int regstack_completed;
2495 extern int exp_equiv_p (const_rtx, const_rtx,
int,
bool);
2496 extern unsigned hash_rtx (const_rtx x,
enum machine_mode,
int *,
int *,
bool);
2528 const_rtx, const_rtx);
2572 const_rtx,
unsigned int);
2575 extern unsigned int extended_count (const_rtx,
enum machine_mode,
int);
2694 enum machine_mode,
int, ...);
2702 extern bool read_rtx (
const char *, rtx *);
2713 const_rtx,
enum machine_mode, rtx);
2729 extern int stack_regs_mentioned (const_rtx insn);
2733 extern GTY(()) rtx stack_limit_rtx;
2762 rtx (*gen_lowpart_no_emit) (
enum machine_mode,
rtx);
2766 unsigned int,
unsigned int *);
2779 #define gen_lowpart rtl_hooks.gen_lowpart
2791 extern
void _fatal_insn (const
char *, const_rtx, const
char *,
int, const
char *)
2794 #define fatal_insn(msgid, insn) \
2795 _fatal_insn (msgid, insn, __FILE__, __LINE__, __FUNCTION__)
2796 #define fatal_insn_not_found(insn) \
2797 _fatal_insn_not_found (insn, __FILE__, __LINE__, __FUNCTION__)