comparison gcc/rtl.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Register Transfer Language (RTL) definitions for GCC 1 /* Register Transfer Language (RTL) definitions for GCC
2 Copyright (C) 1987-2018 Free Software Foundation, Inc. 2 Copyright (C) 1987-2020 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
33 #include "input.h" 33 #include "input.h"
34 #include "is-a.h" 34 #include "is-a.h"
35 #endif /* GENERATOR_FILE */ 35 #endif /* GENERATOR_FILE */
36 36
37 #include "hard-reg-set.h" 37 #include "hard-reg-set.h"
38
39 class predefined_function_abi;
38 40
39 /* Value used by some passes to "recognize" noop moves as valid 41 /* Value used by some passes to "recognize" noop moves as valid
40 instructions. */ 42 instructions. */
41 #define NOOP_MOVE_INSN_CODE INT_MAX 43 #define NOOP_MOVE_INSN_CODE INT_MAX
42 44
143 }; 145 };
144 146
145 /* Structure used to describe the attributes of a MEM. These are hashed 147 /* Structure used to describe the attributes of a MEM. These are hashed
146 so MEMs that the same attributes share a data structure. This means 148 so MEMs that the same attributes share a data structure. This means
147 they cannot be modified in place. */ 149 they cannot be modified in place. */
148 struct GTY(()) mem_attrs 150 class GTY(()) mem_attrs
149 { 151 {
152 public:
150 mem_attrs (); 153 mem_attrs ();
151 154
152 /* The expression that the MEM accesses, or null if not known. 155 /* The expression that the MEM accesses, or null if not known.
153 This expression might be larger than the memory reference itself. 156 This expression might be larger than the memory reference itself.
154 (In other words, the MEM might access only part of the object.) */ 157 (In other words, the MEM might access only part of the object.) */
185 in the same way as for mem_attrs, rather than in the same way as a 188 in the same way as for mem_attrs, rather than in the same way as a
186 SUBREG_BYTE. For example, if a big-endian target stores a byte 189 SUBREG_BYTE. For example, if a big-endian target stores a byte
187 object in the low part of a 4-byte register, the OFFSET field 190 object in the low part of a 4-byte register, the OFFSET field
188 will be -3 rather than 0. */ 191 will be -3 rather than 0. */
189 192
190 struct GTY((for_user)) reg_attrs { 193 class GTY((for_user)) reg_attrs {
194 public:
191 tree decl; /* decl corresponding to REG. */ 195 tree decl; /* decl corresponding to REG. */
192 poly_int64 offset; /* Offset from start of DECL. */ 196 poly_int64 offset; /* Offset from start of DECL. */
193 }; 197 };
194 198
195 /* Common union for an element of an rtx. */ 199 /* Common union for an element of an rtx. */
206 addr_diff_vec_flags rt_addr_diff_vec_flags; 210 addr_diff_vec_flags rt_addr_diff_vec_flags;
207 struct cselib_val *rt_cselib; 211 struct cselib_val *rt_cselib;
208 tree rt_tree; 212 tree rt_tree;
209 basic_block rt_bb; 213 basic_block rt_bb;
210 mem_attrs *rt_mem; 214 mem_attrs *rt_mem;
211 struct constant_descriptor_rtx *rt_constant; 215 class constant_descriptor_rtx *rt_constant;
212 struct dw_cfi_node *rt_cfi; 216 struct dw_cfi_node *rt_cfi;
213 }; 217 };
214 218
215 /* Describes the properties of a REG. */ 219 /* Describes the properties of a REG. */
216 struct GTY(()) reg_info { 220 struct GTY(()) reg_info {
447 } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u; 451 } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u;
448 }; 452 };
449 453
450 /* A node for constructing singly-linked lists of rtx. */ 454 /* A node for constructing singly-linked lists of rtx. */
451 455
452 class GTY(()) rtx_expr_list : public rtx_def 456 struct GTY(()) rtx_expr_list : public rtx_def
453 { 457 {
458 private:
454 /* No extra fields, but adds invariant: (GET_CODE (X) == EXPR_LIST). */ 459 /* No extra fields, but adds invariant: (GET_CODE (X) == EXPR_LIST). */
455 460
456 public: 461 public:
457 /* Get next in list. */ 462 /* Get next in list. */
458 rtx_expr_list *next () const; 463 rtx_expr_list *next () const;
467 is_a_helper <rtx_expr_list *>::test (rtx rt) 472 is_a_helper <rtx_expr_list *>::test (rtx rt)
468 { 473 {
469 return rt->code == EXPR_LIST; 474 return rt->code == EXPR_LIST;
470 } 475 }
471 476
472 class GTY(()) rtx_insn_list : public rtx_def 477 struct GTY(()) rtx_insn_list : public rtx_def
473 { 478 {
479 private:
474 /* No extra fields, but adds invariant: (GET_CODE (X) == INSN_LIST). 480 /* No extra fields, but adds invariant: (GET_CODE (X) == INSN_LIST).
475 481
476 This is an instance of: 482 This is an instance of:
477 483
478 DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA) 484 DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA)
499 } 505 }
500 506
501 /* A node with invariant GET_CODE (X) == SEQUENCE i.e. a vector of rtx, 507 /* A node with invariant GET_CODE (X) == SEQUENCE i.e. a vector of rtx,
502 typically (but not always) of rtx_insn *, used in the late passes. */ 508 typically (but not always) of rtx_insn *, used in the late passes. */
503 509
504 class GTY(()) rtx_sequence : public rtx_def 510 struct GTY(()) rtx_sequence : public rtx_def
505 { 511 {
512 private:
506 /* No extra fields, but adds invariant: (GET_CODE (X) == SEQUENCE). */ 513 /* No extra fields, but adds invariant: (GET_CODE (X) == SEQUENCE). */
507 514
508 public: 515 public:
509 /* Get number of elements in sequence. */ 516 /* Get number of elements in sequence. */
510 int len () const; 517 int len () const;
531 is_a_helper <const rtx_sequence *>::test (const_rtx rt) 538 is_a_helper <const rtx_sequence *>::test (const_rtx rt)
532 { 539 {
533 return rt->code == SEQUENCE; 540 return rt->code == SEQUENCE;
534 } 541 }
535 542
536 class GTY(()) rtx_insn : public rtx_def 543 struct GTY(()) rtx_insn : public rtx_def
537 { 544 {
538 public: 545 public:
539 /* No extra fields, but adds the invariant: 546 /* No extra fields, but adds the invariant:
540 547
541 (INSN_P (X) 548 (INSN_P (X)
565 void set_undeleted () { volatil = false; } 572 void set_undeleted () { volatil = false; }
566 }; 573 };
567 574
568 /* Subclasses of rtx_insn. */ 575 /* Subclasses of rtx_insn. */
569 576
570 class GTY(()) rtx_debug_insn : public rtx_insn 577 struct GTY(()) rtx_debug_insn : public rtx_insn
571 { 578 {
572 /* No extra fields, but adds the invariant: 579 /* No extra fields, but adds the invariant:
573 DEBUG_INSN_P (X) aka (GET_CODE (X) == DEBUG_INSN) 580 DEBUG_INSN_P (X) aka (GET_CODE (X) == DEBUG_INSN)
574 i.e. an annotation for tracking variable assignments. 581 i.e. an annotation for tracking variable assignments.
575 582
576 This is an instance of: 583 This is an instance of:
577 DEF_RTL_EXPR(DEBUG_INSN, "debug_insn", "uuBeiie", RTX_INSN) 584 DEF_RTL_EXPR(DEBUG_INSN, "debug_insn", "uuBeiie", RTX_INSN)
578 from rtl.def. */ 585 from rtl.def. */
579 }; 586 };
580 587
581 class GTY(()) rtx_nonjump_insn : public rtx_insn 588 struct GTY(()) rtx_nonjump_insn : public rtx_insn
582 { 589 {
583 /* No extra fields, but adds the invariant: 590 /* No extra fields, but adds the invariant:
584 NONJUMP_INSN_P (X) aka (GET_CODE (X) == INSN) 591 NONJUMP_INSN_P (X) aka (GET_CODE (X) == INSN)
585 i.e an instruction that cannot jump. 592 i.e an instruction that cannot jump.
586 593
587 This is an instance of: 594 This is an instance of:
588 DEF_RTL_EXPR(INSN, "insn", "uuBeiie", RTX_INSN) 595 DEF_RTL_EXPR(INSN, "insn", "uuBeiie", RTX_INSN)
589 from rtl.def. */ 596 from rtl.def. */
590 }; 597 };
591 598
592 class GTY(()) rtx_jump_insn : public rtx_insn 599 struct GTY(()) rtx_jump_insn : public rtx_insn
593 { 600 {
594 public: 601 public:
595 /* No extra fields, but adds the invariant: 602 /* No extra fields, but adds the invariant:
596 JUMP_P (X) aka (GET_CODE (X) == JUMP_INSN) 603 JUMP_P (X) aka (GET_CODE (X) == JUMP_INSN)
597 i.e. an instruction that can possibly jump. 604 i.e. an instruction that can possibly jump.
614 /* Set jump target. */ 621 /* Set jump target. */
615 622
616 inline void set_jump_target (rtx_code_label *); 623 inline void set_jump_target (rtx_code_label *);
617 }; 624 };
618 625
619 class GTY(()) rtx_call_insn : public rtx_insn 626 struct GTY(()) rtx_call_insn : public rtx_insn
620 { 627 {
621 /* No extra fields, but adds the invariant: 628 /* No extra fields, but adds the invariant:
622 CALL_P (X) aka (GET_CODE (X) == CALL_INSN) 629 CALL_P (X) aka (GET_CODE (X) == CALL_INSN)
623 i.e. an instruction that can possibly call a subroutine 630 i.e. an instruction that can possibly call a subroutine
624 but which will not change which instruction comes next 631 but which will not change which instruction comes next
627 This is an instance of: 634 This is an instance of:
628 DEF_RTL_EXPR(CALL_INSN, "call_insn", "uuBeiiee", RTX_INSN) 635 DEF_RTL_EXPR(CALL_INSN, "call_insn", "uuBeiiee", RTX_INSN)
629 from rtl.def. */ 636 from rtl.def. */
630 }; 637 };
631 638
632 class GTY(()) rtx_jump_table_data : public rtx_insn 639 struct GTY(()) rtx_jump_table_data : public rtx_insn
633 { 640 {
634 /* No extra fields, but adds the invariant: 641 /* No extra fields, but adds the invariant:
635 JUMP_TABLE_DATA_P (X) aka (GET_CODE (INSN) == JUMP_TABLE_DATA) 642 JUMP_TABLE_DATA_P (X) aka (GET_CODE (INSN) == JUMP_TABLE_DATA)
636 i.e. a data for a jump table, considered an instruction for 643 i.e. a data for a jump table, considered an instruction for
637 historical reasons. 644 historical reasons.
638 645
639 This is an instance of: 646 This is an instance of:
640 DEF_RTL_EXPR(JUMP_TABLE_DATA, "jump_table_data", "uuBe0000", RTX_INSN) 647 DEF_RTL_EXPR(JUMP_TABLE_DATA, "jump_table_data", "uuBe0000", RTX_INSN)
641 from rtl.def. */ 648 from rtl.def. */
642 649
643 public:
644
645 /* This can be either: 650 /* This can be either:
646 651
647 (a) a table of absolute jumps, in which case PATTERN (this) is an 652 (a) a table of absolute jumps, in which case PATTERN (this) is an
648 ADDR_VEC with arg 0 a vector of labels, or 653 ADDR_VEC with arg 0 a vector of labels, or
649 654
655 660
656 inline rtvec get_labels () const; 661 inline rtvec get_labels () const;
657 inline scalar_int_mode get_data_mode () const; 662 inline scalar_int_mode get_data_mode () const;
658 }; 663 };
659 664
660 class GTY(()) rtx_barrier : public rtx_insn 665 struct GTY(()) rtx_barrier : public rtx_insn
661 { 666 {
662 /* No extra fields, but adds the invariant: 667 /* No extra fields, but adds the invariant:
663 BARRIER_P (X) aka (GET_CODE (X) == BARRIER) 668 BARRIER_P (X) aka (GET_CODE (X) == BARRIER)
664 i.e. a marker that indicates that control will not flow through. 669 i.e. a marker that indicates that control will not flow through.
665 670
666 This is an instance of: 671 This is an instance of:
667 DEF_RTL_EXPR(BARRIER, "barrier", "uu00000", RTX_EXTRA) 672 DEF_RTL_EXPR(BARRIER, "barrier", "uu00000", RTX_EXTRA)
668 from rtl.def. */ 673 from rtl.def. */
669 }; 674 };
670 675
671 class GTY(()) rtx_code_label : public rtx_insn 676 struct GTY(()) rtx_code_label : public rtx_insn
672 { 677 {
673 /* No extra fields, but adds the invariant: 678 /* No extra fields, but adds the invariant:
674 LABEL_P (X) aka (GET_CODE (X) == CODE_LABEL) 679 LABEL_P (X) aka (GET_CODE (X) == CODE_LABEL)
675 i.e. a label in the assembler. 680 i.e. a label in the assembler.
676 681
677 This is an instance of: 682 This is an instance of:
678 DEF_RTL_EXPR(CODE_LABEL, "code_label", "uuB00is", RTX_EXTRA) 683 DEF_RTL_EXPR(CODE_LABEL, "code_label", "uuB00is", RTX_EXTRA)
679 from rtl.def. */ 684 from rtl.def. */
680 }; 685 };
681 686
682 class GTY(()) rtx_note : public rtx_insn 687 struct GTY(()) rtx_note : public rtx_insn
683 { 688 {
684 /* No extra fields, but adds the invariant: 689 /* No extra fields, but adds the invariant:
685 NOTE_P(X) aka (GET_CODE (X) == NOTE) 690 NOTE_P(X) aka (GET_CODE (X) == NOTE)
686 i.e. a note about the corresponding source code. 691 i.e. a note about the corresponding source code.
687 692
838 843
839 /* Predicate yielding nonzero iff X is a debug note/insn. */ 844 /* Predicate yielding nonzero iff X is a debug note/insn. */
840 #define DEBUG_INSN_P(X) (GET_CODE (X) == DEBUG_INSN) 845 #define DEBUG_INSN_P(X) (GET_CODE (X) == DEBUG_INSN)
841 846
842 /* Predicate yielding nonzero iff X is an insn that is not a debug insn. */ 847 /* Predicate yielding nonzero iff X is an insn that is not a debug insn. */
843 #define NONDEBUG_INSN_P(X) (INSN_P (X) && !DEBUG_INSN_P (X)) 848 #define NONDEBUG_INSN_P(X) (NONJUMP_INSN_P (X) || JUMP_P (X) || CALL_P (X))
844 849
845 /* Nonzero if DEBUG_MARKER_INSN_P may possibly hold. */ 850 /* Nonzero if DEBUG_MARKER_INSN_P may possibly hold. */
846 #define MAY_HAVE_DEBUG_MARKER_INSNS debug_nonbind_markers_p 851 #define MAY_HAVE_DEBUG_MARKER_INSNS debug_nonbind_markers_p
847 /* Nonzero if DEBUG_BIND_INSN_P may possibly hold. */ 852 /* Nonzero if DEBUG_BIND_INSN_P may possibly hold. */
848 #define MAY_HAVE_DEBUG_BIND_INSNS flag_var_tracking_assignments 853 #define MAY_HAVE_DEBUG_BIND_INSNS flag_var_tracking_assignments
849 /* Nonzero if DEBUG_INSN_P may possibly hold. */ 854 /* Nonzero if DEBUG_INSN_P may possibly hold. */
850 #define MAY_HAVE_DEBUG_INSNS \ 855 #define MAY_HAVE_DEBUG_INSNS \
851 (MAY_HAVE_DEBUG_MARKER_INSNS || MAY_HAVE_DEBUG_BIND_INSNS) 856 (MAY_HAVE_DEBUG_MARKER_INSNS || MAY_HAVE_DEBUG_BIND_INSNS)
852 857
853 /* Predicate yielding nonzero iff X is a real insn. */ 858 /* Predicate yielding nonzero iff X is a real insn. */
854 #define INSN_P(X) \ 859 #define INSN_P(X) (NONDEBUG_INSN_P (X) || DEBUG_INSN_P (X))
855 (NONJUMP_INSN_P (X) || DEBUG_INSN_P (X) || JUMP_P (X) || CALL_P (X))
856 860
857 /* Predicate yielding nonzero iff X is a note insn. */ 861 /* Predicate yielding nonzero iff X is a note insn. */
858 #define NOTE_P(X) (GET_CODE (X) == NOTE) 862 #define NOTE_P(X) (GET_CODE (X) == NOTE)
859 863
860 /* Predicate yielding nonzero iff X is a barrier insn. */ 864 /* Predicate yielding nonzero iff X is a barrier insn. */
1050 1054
1051 /* 1 if X is a constant value that is an integer. */ 1055 /* 1 if X is a constant value that is an integer. */
1052 1056
1053 #define CONSTANT_P(X) \ 1057 #define CONSTANT_P(X) \
1054 (GET_RTX_CLASS (GET_CODE (X)) == RTX_CONST_OBJ) 1058 (GET_RTX_CLASS (GET_CODE (X)) == RTX_CONST_OBJ)
1059
1060 /* 1 if X is a LABEL_REF. */
1061 #define LABEL_REF_P(X) \
1062 (GET_CODE (X) == LABEL_REF)
1055 1063
1056 /* 1 if X can be used to represent an object. */ 1064 /* 1 if X can be used to represent an object. */
1057 #define OBJECT_P(X) \ 1065 #define OBJECT_P(X) \
1058 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_OBJ_MASK) == RTX_OBJ_RESULT) 1066 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_OBJ_MASK) == RTX_OBJ_RESULT)
1059 1067
1622 1630
1623 extern const char * const reg_note_name[]; 1631 extern const char * const reg_note_name[];
1624 #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)]) 1632 #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
1625 1633
1626 /* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of 1634 /* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of
1627 USE and CLOBBER expressions. 1635 USE, CLOBBER and SET expressions.
1628 USE expressions list the registers filled with arguments that 1636 USE expressions list the registers filled with arguments that
1629 are passed to the function. 1637 are passed to the function.
1630 CLOBBER expressions document the registers explicitly clobbered 1638 CLOBBER expressions document the registers explicitly clobbered
1631 by this CALL_INSN. 1639 by this CALL_INSN.
1632 Pseudo registers can not be mentioned in this list. */ 1640 SET expressions say that the return value of the call (the SET_DEST)
1641 is equivalent to a value available before the call (the SET_SRC).
1642 This kind of SET is used when the return value is predictable in
1643 advance. It is purely an optimisation hint; unlike USEs and CLOBBERs,
1644 it does not affect register liveness.
1645
1646 Pseudo registers cannot be mentioned in this list. */
1633 #define CALL_INSN_FUNCTION_USAGE(INSN) XEXP(INSN, 7) 1647 #define CALL_INSN_FUNCTION_USAGE(INSN) XEXP(INSN, 7)
1634 1648
1635 /* The label-number of a code-label. The assembler label 1649 /* The label-number of a code-label. The assembler label
1636 is made from `L' and the label-number printed in decimal. 1650 is made from `L' and the label-number printed in decimal.
1637 Label numbers are unique in a compilation. */ 1651 Label numbers are unique in a compilation. */
2091 /* Describes the shape of a subreg: 2105 /* Describes the shape of a subreg:
2092 2106
2093 inner_mode == the mode of the SUBREG_REG 2107 inner_mode == the mode of the SUBREG_REG
2094 offset == the SUBREG_BYTE 2108 offset == the SUBREG_BYTE
2095 outer_mode == the mode of the SUBREG itself. */ 2109 outer_mode == the mode of the SUBREG itself. */
2096 struct subreg_shape { 2110 class subreg_shape {
2111 public:
2097 subreg_shape (machine_mode, poly_uint16, machine_mode); 2112 subreg_shape (machine_mode, poly_uint16, machine_mode);
2098 bool operator == (const subreg_shape &) const; 2113 bool operator == (const subreg_shape &) const;
2099 bool operator != (const subreg_shape &) const; 2114 bool operator != (const subreg_shape &) const;
2100 unsigned HOST_WIDE_INT unique_id () const; 2115 unsigned HOST_WIDE_INT unique_id () const;
2101 2116
2391 extern void init_rtlanal (void); 2406 extern void init_rtlanal (void);
2392 extern int rtx_cost (rtx, machine_mode, enum rtx_code, int, bool); 2407 extern int rtx_cost (rtx, machine_mode, enum rtx_code, int, bool);
2393 extern int address_cost (rtx, machine_mode, addr_space_t, bool); 2408 extern int address_cost (rtx, machine_mode, addr_space_t, bool);
2394 extern void get_full_rtx_cost (rtx, machine_mode, enum rtx_code, int, 2409 extern void get_full_rtx_cost (rtx, machine_mode, enum rtx_code, int,
2395 struct full_rtx_costs *); 2410 struct full_rtx_costs *);
2411 extern bool native_encode_rtx (machine_mode, rtx, vec<target_unit> &,
2412 unsigned int, unsigned int);
2413 extern rtx native_decode_rtx (machine_mode, vec<target_unit>,
2414 unsigned int);
2415 extern rtx native_decode_vector_rtx (machine_mode, vec<target_unit>,
2416 unsigned int, unsigned int, unsigned int);
2396 extern poly_uint64 subreg_lsb (const_rtx); 2417 extern poly_uint64 subreg_lsb (const_rtx);
2397 extern poly_uint64 subreg_lsb_1 (machine_mode, machine_mode, poly_uint64); 2418 extern poly_uint64 subreg_size_lsb (poly_uint64, poly_uint64, poly_uint64);
2398 extern poly_uint64 subreg_size_offset_from_lsb (poly_uint64, poly_uint64, 2419 extern poly_uint64 subreg_size_offset_from_lsb (poly_uint64, poly_uint64,
2399 poly_uint64); 2420 poly_uint64);
2400 extern bool read_modify_subreg_p (const_rtx); 2421 extern bool read_modify_subreg_p (const_rtx);
2422
2423 /* Given a subreg's OUTER_MODE, INNER_MODE, and SUBREG_BYTE, return the
2424 bit offset at which the subreg begins (counting from the least significant
2425 bit of the operand). */
2426
2427 inline poly_uint64
2428 subreg_lsb_1 (machine_mode outer_mode, machine_mode inner_mode,
2429 poly_uint64 subreg_byte)
2430 {
2431 return subreg_size_lsb (GET_MODE_SIZE (outer_mode),
2432 GET_MODE_SIZE (inner_mode), subreg_byte);
2433 }
2401 2434
2402 /* Return the subreg byte offset for a subreg whose outer mode is 2435 /* Return the subreg byte offset for a subreg whose outer mode is
2403 OUTER_MODE, whose inner mode is INNER_MODE, and where there are 2436 OUTER_MODE, whose inner mode is INNER_MODE, and where there are
2404 LSB_SHIFT *bits* between the lsb of the outer value and the lsb of 2437 LSB_SHIFT *bits* between the lsb of the outer value and the lsb of
2405 the inner value. This is the inverse of subreg_lsb_1 (which converts 2438 the inner value. This is the inverse of subreg_lsb_1 (which converts
2644 (RTL_FLAG_CHECK4 ("SCHED_GROUP_P", (RTX), DEBUG_INSN, INSN, \ 2677 (RTL_FLAG_CHECK4 ("SCHED_GROUP_P", (RTX), DEBUG_INSN, INSN, \
2645 JUMP_INSN, CALL_INSN)->in_struct) 2678 JUMP_INSN, CALL_INSN)->in_struct)
2646 2679
2647 /* For a SET rtx, SET_DEST is the place that is set 2680 /* For a SET rtx, SET_DEST is the place that is set
2648 and SET_SRC is the value it is set to. */ 2681 and SET_SRC is the value it is set to. */
2649 #define SET_DEST(RTX) XC3EXP (RTX, 0, SET, CLOBBER, CLOBBER_HIGH) 2682 #define SET_DEST(RTX) XC2EXP (RTX, 0, SET, CLOBBER)
2650 #define SET_SRC(RTX) XCEXP (RTX, 1, SET) 2683 #define SET_SRC(RTX) XCEXP (RTX, 1, SET)
2651 #define SET_IS_RETURN_P(RTX) \ 2684 #define SET_IS_RETURN_P(RTX) \
2652 (RTL_FLAG_CHECK1 ("SET_IS_RETURN_P", (RTX), SET)->jump) 2685 (RTL_FLAG_CHECK1 ("SET_IS_RETURN_P", (RTX), SET)->jump)
2653 2686
2654 /* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */ 2687 /* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
2924 extern rtx plus_constant (machine_mode, rtx, poly_int64, bool = false); 2957 extern rtx plus_constant (machine_mode, rtx, poly_int64, bool = false);
2925 extern HOST_WIDE_INT get_stack_check_protect (void); 2958 extern HOST_WIDE_INT get_stack_check_protect (void);
2926 2959
2927 /* In rtl.c */ 2960 /* In rtl.c */
2928 extern rtx rtx_alloc (RTX_CODE CXX_MEM_STAT_INFO); 2961 extern rtx rtx_alloc (RTX_CODE CXX_MEM_STAT_INFO);
2962 inline rtx
2963 rtx_init (rtx rt, RTX_CODE code)
2964 {
2965 memset (rt, 0, RTX_HDR_SIZE);
2966 PUT_CODE (rt, code);
2967 return rt;
2968 }
2969 #define rtx_alloca(code) \
2970 rtx_init ((rtx) alloca (RTX_CODE_SIZE ((code))), (code))
2929 extern rtx rtx_alloc_stat_v (RTX_CODE MEM_STAT_DECL, int); 2971 extern rtx rtx_alloc_stat_v (RTX_CODE MEM_STAT_DECL, int);
2930 #define rtx_alloc_v(c, SZ) rtx_alloc_stat_v (c MEM_STAT_INFO, SZ) 2972 #define rtx_alloc_v(c, SZ) rtx_alloc_stat_v (c MEM_STAT_INFO, SZ)
2931 #define const_wide_int_alloc(NWORDS) \ 2973 #define const_wide_int_alloc(NWORDS) \
2932 rtx_alloc_v (CONST_WIDE_INT, \ 2974 rtx_alloc_v (CONST_WIDE_INT, \
2933 (sizeof (struct hwivec_def) \ 2975 (sizeof (struct hwivec_def) \
3369 extern bool val_signbit_known_clear_p (machine_mode, 3411 extern bool val_signbit_known_clear_p (machine_mode,
3370 unsigned HOST_WIDE_INT); 3412 unsigned HOST_WIDE_INT);
3371 3413
3372 /* In reginfo.c */ 3414 /* In reginfo.c */
3373 extern machine_mode choose_hard_reg_mode (unsigned int, unsigned int, 3415 extern machine_mode choose_hard_reg_mode (unsigned int, unsigned int,
3374 bool); 3416 const predefined_function_abi *);
3375 extern const HARD_REG_SET &simplifiable_subregs (const subreg_shape &); 3417 extern const HARD_REG_SET &simplifiable_subregs (const subreg_shape &);
3376 3418
3377 /* In emit-rtl.c */ 3419 /* In emit-rtl.c */
3378 extern rtx set_for_reg_notes (rtx); 3420 extern rtx set_for_reg_notes (rtx);
3379 extern rtx set_unique_reg_note (rtx, enum reg_note, rtx); 3421 extern rtx set_unique_reg_note (rtx, enum reg_note, rtx);
3383 /* Functions in rtlanal.c */ 3425 /* Functions in rtlanal.c */
3384 3426
3385 extern rtx single_set_2 (const rtx_insn *, const_rtx); 3427 extern rtx single_set_2 (const rtx_insn *, const_rtx);
3386 extern bool contains_symbol_ref_p (const_rtx); 3428 extern bool contains_symbol_ref_p (const_rtx);
3387 extern bool contains_symbolic_reference_p (const_rtx); 3429 extern bool contains_symbolic_reference_p (const_rtx);
3430 extern bool contains_constant_pool_address_p (const_rtx);
3388 3431
3389 /* Handle the cheap and common cases inline for performance. */ 3432 /* Handle the cheap and common cases inline for performance. */
3390 3433
3391 inline rtx single_set (const rtx_insn *insn) 3434 inline rtx single_set (const rtx_insn *insn)
3392 { 3435 {
3404 extern int rtx_addr_can_trap_p (const_rtx); 3447 extern int rtx_addr_can_trap_p (const_rtx);
3405 extern bool nonzero_address_p (const_rtx); 3448 extern bool nonzero_address_p (const_rtx);
3406 extern int rtx_unstable_p (const_rtx); 3449 extern int rtx_unstable_p (const_rtx);
3407 extern bool rtx_varies_p (const_rtx, bool); 3450 extern bool rtx_varies_p (const_rtx, bool);
3408 extern bool rtx_addr_varies_p (const_rtx, bool); 3451 extern bool rtx_addr_varies_p (const_rtx, bool);
3409 extern rtx get_call_rtx_from (rtx); 3452 extern rtx get_call_rtx_from (const rtx_insn *);
3453 extern tree get_call_fndecl (const rtx_insn *);
3410 extern HOST_WIDE_INT get_integer_term (const_rtx); 3454 extern HOST_WIDE_INT get_integer_term (const_rtx);
3411 extern rtx get_related_value (const_rtx); 3455 extern rtx get_related_value (const_rtx);
3412 extern bool offset_within_block_p (const_rtx, HOST_WIDE_INT); 3456 extern bool offset_within_block_p (const_rtx, HOST_WIDE_INT);
3413 extern void split_const (rtx, rtx *, rtx *); 3457 extern void split_const (rtx, rtx *, rtx *);
3414 extern rtx strip_offset (rtx, poly_int64_pod *); 3458 extern rtx strip_offset (rtx, poly_int64_pod *);
3433 extern const_rtx set_of (const_rtx, const_rtx); 3477 extern const_rtx set_of (const_rtx, const_rtx);
3434 extern void record_hard_reg_sets (rtx, const_rtx, void *); 3478 extern void record_hard_reg_sets (rtx, const_rtx, void *);
3435 extern void record_hard_reg_uses (rtx *, void *); 3479 extern void record_hard_reg_uses (rtx *, void *);
3436 extern void find_all_hard_regs (const_rtx, HARD_REG_SET *); 3480 extern void find_all_hard_regs (const_rtx, HARD_REG_SET *);
3437 extern void find_all_hard_reg_sets (const rtx_insn *, HARD_REG_SET *, bool); 3481 extern void find_all_hard_reg_sets (const rtx_insn *, HARD_REG_SET *, bool);
3438 extern void note_stores (const_rtx, void (*) (rtx, const_rtx, void *), void *); 3482 extern void note_pattern_stores (const_rtx,
3483 void (*) (rtx, const_rtx, void *), void *);
3484 extern void note_stores (const rtx_insn *,
3485 void (*) (rtx, const_rtx, void *), void *);
3439 extern void note_uses (rtx *, void (*) (rtx *, void *), void *); 3486 extern void note_uses (rtx *, void (*) (rtx *, void *), void *);
3440 extern int dead_or_set_p (const rtx_insn *, const_rtx); 3487 extern int dead_or_set_p (const rtx_insn *, const_rtx);
3441 extern int dead_or_set_regno_p (const rtx_insn *, unsigned int); 3488 extern int dead_or_set_regno_p (const rtx_insn *, unsigned int);
3442 extern rtx find_reg_note (const_rtx, enum reg_note, const_rtx); 3489 extern rtx find_reg_note (const_rtx, enum reg_note, const_rtx);
3443 extern rtx find_regno_note (const_rtx, enum reg_note, unsigned int); 3490 extern rtx find_regno_note (const_rtx, enum reg_note, unsigned int);
3465 extern bool insn_could_throw_p (const_rtx); 3512 extern bool insn_could_throw_p (const_rtx);
3466 extern bool insn_nothrow_p (const_rtx); 3513 extern bool insn_nothrow_p (const_rtx);
3467 extern bool can_nonlocal_goto (const rtx_insn *); 3514 extern bool can_nonlocal_goto (const rtx_insn *);
3468 extern void copy_reg_eh_region_note_forward (rtx, rtx_insn *, rtx); 3515 extern void copy_reg_eh_region_note_forward (rtx, rtx_insn *, rtx);
3469 extern void copy_reg_eh_region_note_backward (rtx, rtx_insn *, rtx); 3516 extern void copy_reg_eh_region_note_backward (rtx, rtx_insn *, rtx);
3470 extern int inequality_comparisons_p (const_rtx);
3471 extern rtx replace_rtx (rtx, rtx, rtx, bool = false); 3517 extern rtx replace_rtx (rtx, rtx, rtx, bool = false);
3472 extern void replace_label (rtx *, rtx, rtx, bool); 3518 extern void replace_label (rtx *, rtx, rtx, bool);
3473 extern void replace_label_in_insn (rtx_insn *, rtx_insn *, rtx_insn *, bool); 3519 extern void replace_label_in_insn (rtx_insn *, rtx_insn *, rtx_insn *, bool);
3474 extern bool rtx_referenced_p (const_rtx, const_rtx); 3520 extern bool rtx_referenced_p (const_rtx, const_rtx);
3475 extern bool tablejump_p (const rtx_insn *, rtx_insn **, rtx_jump_table_data **); 3521 extern bool tablejump_p (const rtx_insn *, rtx_insn **, rtx_jump_table_data **);
3522 extern rtx tablejump_casesi_pattern (const rtx_insn *insn);
3476 extern int computed_jump_p (const rtx_insn *); 3523 extern int computed_jump_p (const rtx_insn *);
3477 extern bool tls_referenced_p (const_rtx); 3524 extern bool tls_referenced_p (const_rtx);
3478 extern bool contains_mem_rtx_p (rtx x); 3525 extern bool contains_mem_rtx_p (rtx x);
3479 extern bool reg_is_clobbered_by_clobber_high (unsigned int, machine_mode,
3480 const_rtx);
3481
3482 /* Convenient wrapper for reg_is_clobbered_by_clobber_high. */
3483 inline bool
3484 reg_is_clobbered_by_clobber_high (const_rtx x, const_rtx clobber_high_op)
3485 {
3486 return reg_is_clobbered_by_clobber_high (REGNO (x), GET_MODE (x),
3487 clobber_high_op);
3488 }
3489 3526
3490 /* Overload for refers_to_regno_p for checking a single register. */ 3527 /* Overload for refers_to_regno_p for checking a single register. */
3491 inline bool 3528 inline bool
3492 refers_to_regno_p (unsigned int regnum, const_rtx x, rtx* loc = NULL) 3529 refers_to_regno_p (unsigned int regnum, const_rtx x, rtx* loc = NULL)
3493 { 3530 {
3716 /* Static hunks of RTL used by the aliasing code; these are treated 3753 /* Static hunks of RTL used by the aliasing code; these are treated
3717 as persistent to avoid unnecessary RTL allocations. */ 3754 as persistent to avoid unnecessary RTL allocations. */
3718 rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER]; 3755 rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER];
3719 3756
3720 /* The default memory attributes for each mode. */ 3757 /* The default memory attributes for each mode. */
3721 struct mem_attrs *x_mode_mem_attrs[(int) MAX_MACHINE_MODE]; 3758 class mem_attrs *x_mode_mem_attrs[(int) MAX_MACHINE_MODE];
3722 3759
3723 /* Track if RTL has been initialized. */ 3760 /* Track if RTL has been initialized. */
3724 bool target_specific_initialized; 3761 bool target_specific_initialized;
3725 }; 3762 };
3726 3763
3750 #define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER]) 3787 #define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
3751 #define arg_pointer_rtx (global_rtl[GR_ARG_POINTER]) 3788 #define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
3752 3789
3753 #ifndef GENERATOR_FILE 3790 #ifndef GENERATOR_FILE
3754 /* Return the attributes of a MEM rtx. */ 3791 /* Return the attributes of a MEM rtx. */
3755 static inline const struct mem_attrs * 3792 static inline const class mem_attrs *
3756 get_mem_attrs (const_rtx x) 3793 get_mem_attrs (const_rtx x)
3757 { 3794 {
3758 struct mem_attrs *attrs; 3795 class mem_attrs *attrs;
3759 3796
3760 attrs = MEM_ATTRS (x); 3797 attrs = MEM_ATTRS (x);
3761 if (!attrs) 3798 if (!attrs)
3762 attrs = mode_mem_attrs[(int) GET_MODE (x)]; 3799 attrs = mode_mem_attrs[(int) GET_MODE (x)];
3763 return attrs; 3800 return attrs;
3786 basic_block bb, rtx pattern, int location, int code, 3823 basic_block bb, rtx pattern, int location, int code,
3787 rtx reg_notes); 3824 rtx reg_notes);
3788 extern rtx gen_rtx_CONST_INT (machine_mode, HOST_WIDE_INT); 3825 extern rtx gen_rtx_CONST_INT (machine_mode, HOST_WIDE_INT);
3789 extern rtx gen_rtx_CONST_VECTOR (machine_mode, rtvec); 3826 extern rtx gen_rtx_CONST_VECTOR (machine_mode, rtvec);
3790 extern void set_mode_and_regno (rtx, machine_mode, unsigned int); 3827 extern void set_mode_and_regno (rtx, machine_mode, unsigned int);
3828 extern rtx init_raw_REG (rtx, machine_mode, unsigned int);
3791 extern rtx gen_raw_REG (machine_mode, unsigned int); 3829 extern rtx gen_raw_REG (machine_mode, unsigned int);
3830 #define alloca_raw_REG(mode, regno) \
3831 init_raw_REG (rtx_alloca (REG), (mode), (regno))
3792 extern rtx gen_rtx_REG (machine_mode, unsigned int); 3832 extern rtx gen_rtx_REG (machine_mode, unsigned int);
3793 extern rtx gen_rtx_SUBREG (machine_mode, rtx, poly_uint64); 3833 extern rtx gen_rtx_SUBREG (machine_mode, rtx, poly_uint64);
3794 extern rtx gen_rtx_MEM (machine_mode, rtx); 3834 extern rtx gen_rtx_MEM (machine_mode, rtx);
3795 extern rtx gen_rtx_VAR_LOCATION (machine_mode, tree, rtx, 3835 extern rtx gen_rtx_VAR_LOCATION (machine_mode, tree, rtx,
3796 enum var_init_status); 3836 enum var_init_status);
4043 /* In stmt.c */ 4083 /* In stmt.c */
4044 extern void expand_null_return (void); 4084 extern void expand_null_return (void);
4045 extern void expand_naked_return (void); 4085 extern void expand_naked_return (void);
4046 extern void emit_jump (rtx); 4086 extern void emit_jump (rtx);
4047 4087
4088 /* Memory operation built-ins differ by return value. Mapping
4089 of the enum values is following:
4090 - RETURN_BEGIN - return destination, e.g. memcpy
4091 - RETURN_END - return destination + n, e.g. mempcpy
4092 - RETURN_END_MINUS_ONE - return a pointer to the terminating
4093 null byte of the string, e.g. strcpy
4094 */
4095
4096 enum memop_ret
4097 {
4098 RETURN_BEGIN,
4099 RETURN_END,
4100 RETURN_END_MINUS_ONE
4101 };
4102
4048 /* In expr.c */ 4103 /* In expr.c */
4049 extern rtx move_by_pieces (rtx, rtx, unsigned HOST_WIDE_INT, 4104 extern rtx move_by_pieces (rtx, rtx, unsigned HOST_WIDE_INT,
4050 unsigned int, int); 4105 unsigned int, memop_ret);
4051 extern poly_int64 find_args_size_adjust (rtx_insn *); 4106 extern poly_int64 find_args_size_adjust (rtx_insn *);
4052 extern poly_int64 fixup_args_size_notes (rtx_insn *, rtx_insn *, poly_int64); 4107 extern poly_int64 fixup_args_size_notes (rtx_insn *, rtx_insn *, poly_int64);
4053 4108
4054 /* In expmed.c */ 4109 /* In expmed.c */
4055 extern void init_expmed (void); 4110 extern void init_expmed (void);
4060 extern void init_lower_subreg (void); 4115 extern void init_lower_subreg (void);
4061 4116
4062 /* In gcse.c */ 4117 /* In gcse.c */
4063 extern bool can_copy_p (machine_mode); 4118 extern bool can_copy_p (machine_mode);
4064 extern bool can_assign_to_reg_without_clobbers_p (rtx, machine_mode); 4119 extern bool can_assign_to_reg_without_clobbers_p (rtx, machine_mode);
4120 extern rtx_insn *prepare_copy_insn (rtx, rtx);
4121
4122 /* In cprop.c */
4065 extern rtx fis_get_condition (rtx_insn *); 4123 extern rtx fis_get_condition (rtx_insn *);
4066 4124
4067 /* In ira.c */ 4125 /* In ira.c */
4068 extern HARD_REG_SET eliminable_regset; 4126 extern HARD_REG_SET eliminable_regset;
4069 extern void mark_elimination (int, int); 4127 extern void mark_elimination (int, int);
4259 extern void end_alias_analysis (void); 4317 extern void end_alias_analysis (void);
4260 extern void vt_equate_reg_base_value (const_rtx, const_rtx); 4318 extern void vt_equate_reg_base_value (const_rtx, const_rtx);
4261 extern bool memory_modified_in_insn_p (const_rtx, const_rtx); 4319 extern bool memory_modified_in_insn_p (const_rtx, const_rtx);
4262 extern bool may_be_sp_based_p (rtx); 4320 extern bool may_be_sp_based_p (rtx);
4263 extern rtx gen_hard_reg_clobber (machine_mode, unsigned int); 4321 extern rtx gen_hard_reg_clobber (machine_mode, unsigned int);
4264 extern rtx gen_hard_reg_clobber_high (machine_mode, unsigned int);
4265 extern rtx get_reg_known_value (unsigned int); 4322 extern rtx get_reg_known_value (unsigned int);
4266 extern bool get_reg_known_equiv_p (unsigned int); 4323 extern bool get_reg_known_equiv_p (unsigned int);
4267 extern rtx get_reg_base_value (unsigned int); 4324 extern rtx get_reg_base_value (unsigned int);
4268 4325
4269 #ifdef STACK_REGS 4326 #ifdef STACK_REGS
4314 4371
4315 extern void insn_locations_init (void); 4372 extern void insn_locations_init (void);
4316 extern void insn_locations_finalize (void); 4373 extern void insn_locations_finalize (void);
4317 extern void set_curr_insn_location (location_t); 4374 extern void set_curr_insn_location (location_t);
4318 extern location_t curr_insn_location (void); 4375 extern location_t curr_insn_location (void);
4376 extern void set_insn_locations (rtx_insn *, location_t);
4319 4377
4320 /* rtl-error.c */ 4378 /* rtl-error.c */
4321 extern void _fatal_insn_not_found (const_rtx, const char *, int, const char *) 4379 extern void _fatal_insn_not_found (const_rtx, const char *, int, const char *)
4322 ATTRIBUTE_NORETURN ATTRIBUTE_COLD; 4380 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
4323 extern void _fatal_insn (const char *, const_rtx, const char *, int, const char *) 4381 extern void _fatal_insn (const char *, const_rtx, const char *, int, const char *)
4333 4391
4334 /* Information about the function that is propagated by the RTL backend. 4392 /* Information about the function that is propagated by the RTL backend.
4335 Available only for functions that has been already assembled. */ 4393 Available only for functions that has been already assembled. */
4336 4394
4337 struct GTY(()) cgraph_rtl_info { 4395 struct GTY(()) cgraph_rtl_info {
4338 unsigned int preferred_incoming_stack_boundary; 4396 unsigned int preferred_incoming_stack_boundary;
4339 4397
4340 /* Call unsaved hard registers really used by the corresponding 4398 /* Which registers the function clobbers, either directly or by
4341 function (including ones used by functions called by the 4399 calling another function. */
4342 function). */
4343 HARD_REG_SET function_used_regs; 4400 HARD_REG_SET function_used_regs;
4344 /* Set if function_used_regs is valid. */
4345 unsigned function_used_regs_valid: 1;
4346 }; 4401 };
4347 4402
4348 /* If loads from memories of mode MODE always sign or zero extend, 4403 /* If loads from memories of mode MODE always sign or zero extend,
4349 return SIGN_EXTEND or ZERO_EXTEND as appropriate. Return UNKNOWN 4404 return SIGN_EXTEND or ZERO_EXTEND as appropriate. Return UNKNOWN
4350 otherwise. */ 4405 otherwise. */
4372 *offset = poly_uint64 (*offset) + suboffset; 4427 *offset = poly_uint64 (*offset) + suboffset;
4373 } 4428 }
4374 return x; 4429 return x;
4375 } 4430 }
4376 4431
4432 /* Return true if X is an operation that always operates on the full
4433 registers for WORD_REGISTER_OPERATIONS architectures. */
4434
4435 inline bool
4436 word_register_operation_p (const_rtx x)
4437 {
4438 switch (GET_CODE (x))
4439 {
4440 case CONST_INT:
4441 case ROTATE:
4442 case ROTATERT:
4443 case SIGN_EXTRACT:
4444 case ZERO_EXTRACT:
4445 return false;
4446
4447 default:
4448 return true;
4449 }
4450 }
4451
4377 /* gtype-desc.c. */ 4452 /* gtype-desc.c. */
4378 extern void gt_ggc_mx (rtx &); 4453 extern void gt_ggc_mx (rtx &);
4379 extern void gt_pch_nx (rtx &); 4454 extern void gt_pch_nx (rtx &);
4380 extern void gt_pch_nx (rtx &, gt_pointer_operator, void *); 4455 extern void gt_pch_nx (rtx &, gt_pointer_operator, void *);
4381 4456