comparison gcc/doc/rtl.texi @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 @c Copyright (C) 1988, 1989, 1992, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 1 @c Copyright (C) 1988-2017 Free Software Foundation, Inc.
2 @c 2003, 2004, 2005, 2006, 2007, 2008, 2010
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual. 2 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi. 3 @c For copying conditions, see the file gcc.texi.
6 4
7 @node RTL 5 @node RTL
8 @chapter RTL Representation 6 @chapter RTL Representation
193 An RTX code for something that matches in insns, such as 191 An RTX code for something that matches in insns, such as
194 @code{MATCH_DUP}. These only occur in machine descriptions. 192 @code{MATCH_DUP}. These only occur in machine descriptions.
195 193
196 @item RTX_AUTOINC 194 @item RTX_AUTOINC
197 An RTX code for an auto-increment addressing mode, such as 195 An RTX code for an auto-increment addressing mode, such as
198 @code{POST_INC}. 196 @code{POST_INC}. @samp{XEXP (@var{x}, 0)} gives the auto-modified
197 register.
199 198
200 @item RTX_EXTRA 199 @item RTX_EXTRA
201 All other RTX codes. This category includes the remaining codes used 200 All other RTX codes. This category includes the remaining codes used
202 only in machine descriptions (@code{DEFINE_*}, etc.). It also includes 201 only in machine descriptions (@code{DEFINE_*}, etc.). It also includes
203 all the codes describing side effects (@code{SET}, @code{USE}, 202 all the codes describing side effects (@code{SET}, @code{USE},
407 @code{COMPONENT_REF}, in which case this is some field reference, 406 @code{COMPONENT_REF}, in which case this is some field reference,
408 and @code{TREE_OPERAND (@var{x}, 0)} contains the declaration, 407 and @code{TREE_OPERAND (@var{x}, 0)} contains the declaration,
409 or another @code{COMPONENT_REF}, or null if there is no compile-time 408 or another @code{COMPONENT_REF}, or null if there is no compile-time
410 object associated with the reference. 409 object associated with the reference.
411 410
411 @findex MEM_OFFSET_KNOWN_P
412 @item MEM_OFFSET_KNOWN_P (@var{x})
413 True if the offset of the memory reference from @code{MEM_EXPR} is known.
414 @samp{MEM_OFFSET (@var{x})} provides the offset if so.
415
412 @findex MEM_OFFSET 416 @findex MEM_OFFSET
413 @item MEM_OFFSET (@var{x}) 417 @item MEM_OFFSET (@var{x})
414 The offset from the start of @code{MEM_EXPR} as a @code{CONST_INT} rtx. 418 The offset from the start of @code{MEM_EXPR}. The value is only valid if
419 @samp{MEM_OFFSET_KNOWN_P (@var{x})} is true.
420
421 @findex MEM_SIZE_KNOWN_P
422 @item MEM_SIZE_KNOWN_P (@var{x})
423 True if the size of the memory reference is known.
424 @samp{MEM_SIZE (@var{x})} provides its size if so.
415 425
416 @findex MEM_SIZE 426 @findex MEM_SIZE
417 @item MEM_SIZE (@var{x}) 427 @item MEM_SIZE (@var{x})
418 The size in bytes of the memory reference as a @code{CONST_INT} rtx. 428 The size in bytes of the memory reference.
419 This is mostly relevant for @code{BLKmode} references as otherwise 429 This is mostly relevant for @code{BLKmode} references as otherwise
420 the size is implied by the mode. 430 the size is implied by the mode. The value is only valid if
431 @samp{MEM_SIZE_KNOWN_P (@var{x})} is true.
421 432
422 @findex MEM_ALIGN 433 @findex MEM_ALIGN
423 @item MEM_ALIGN (@var{x}) 434 @item MEM_ALIGN (@var{x})
424 The known alignment in bits of the memory reference. 435 The known alignment in bits of the memory reference.
425 436
611 @findex INSN_DELETED_P 622 @findex INSN_DELETED_P
612 @cindex @code{insn} and @samp{/v} 623 @cindex @code{insn} and @samp{/v}
613 @cindex @code{call_insn} and @samp{/v} 624 @cindex @code{call_insn} and @samp{/v}
614 @cindex @code{jump_insn} and @samp{/v} 625 @cindex @code{jump_insn} and @samp{/v}
615 @cindex @code{code_label} and @samp{/v} 626 @cindex @code{code_label} and @samp{/v}
627 @cindex @code{jump_table_data} and @samp{/v}
616 @cindex @code{barrier} and @samp{/v} 628 @cindex @code{barrier} and @samp{/v}
617 @cindex @code{note} and @samp{/v} 629 @cindex @code{note} and @samp{/v}
618 @cindex @code{volatil}, in @code{insn}, @code{call_insn}, @code{jump_insn}, @code{code_label}, @code{barrier}, and @code{note} 630 @cindex @code{volatil}, in @code{insn}, @code{call_insn}, @code{jump_insn}, @code{code_label}, @code{jump_table_data}, @code{barrier}, and @code{note}
619 @item INSN_DELETED_P (@var{x}) 631 @item INSN_DELETED_P (@var{x})
620 In an @code{insn}, @code{call_insn}, @code{jump_insn}, @code{code_label}, 632 In an @code{insn}, @code{call_insn}, @code{jump_insn}, @code{code_label},
621 @code{barrier}, or @code{note}, 633 @code{jump_table_data}, @code{barrier}, or @code{note},
622 nonzero if the insn has been deleted. Stored in the 634 nonzero if the insn has been deleted. Stored in the
623 @code{volatil} field and printed as @samp{/v}. 635 @code{volatil} field and printed as @samp{/v}.
624 636
625 @findex INSN_FROM_TARGET_P 637 @findex INSN_FROM_TARGET_P
626 @cindex @code{insn} and @samp{/s} 638 @cindex @code{insn} and @samp{/s}
655 @item LABEL_REF_NONLOCAL_P (@var{x}) 667 @item LABEL_REF_NONLOCAL_P (@var{x})
656 In @code{label_ref} and @code{reg_label} expressions, nonzero if this is 668 In @code{label_ref} and @code{reg_label} expressions, nonzero if this is
657 a reference to a non-local label. 669 a reference to a non-local label.
658 Stored in the @code{volatil} field and printed as @samp{/v}. 670 Stored in the @code{volatil} field and printed as @samp{/v}.
659 671
660 @findex MEM_IN_STRUCT_P
661 @cindex @code{mem} and @samp{/s}
662 @cindex @code{in_struct}, in @code{mem}
663 @item MEM_IN_STRUCT_P (@var{x})
664 In @code{mem} expressions, nonzero for reference to an entire structure,
665 union or array, or to a component of one. Zero for references to a
666 scalar variable or through a pointer to a scalar. If both this flag and
667 @code{MEM_SCALAR_P} are clear, then we don't know whether this @code{mem}
668 is in a structure or not. Both flags should never be simultaneously set.
669 Stored in the @code{in_struct} field and printed as @samp{/s}.
670
671 @findex MEM_KEEP_ALIAS_SET_P 672 @findex MEM_KEEP_ALIAS_SET_P
672 @cindex @code{mem} and @samp{/j} 673 @cindex @code{mem} and @samp{/j}
673 @cindex @code{jump}, in @code{mem} 674 @cindex @code{jump}, in @code{mem}
674 @item MEM_KEEP_ALIAS_SET_P (@var{x}) 675 @item MEM_KEEP_ALIAS_SET_P (@var{x})
675 In @code{mem} expressions, 1 if we should keep the alias set for this 676 In @code{mem} expressions, 1 if we should keep the alias set for this
676 mem unchanged when we access a component. Set to 1, for example, when we 677 mem unchanged when we access a component. Set to 1, for example, when we
677 are already in a non-addressable component of an aggregate. 678 are already in a non-addressable component of an aggregate.
678 Stored in the @code{jump} field and printed as @samp{/j}. 679 Stored in the @code{jump} field and printed as @samp{/j}.
679
680 @findex MEM_SCALAR_P
681 @cindex @code{mem} and @samp{/i}
682 @cindex @code{return_val}, in @code{mem}
683 @item MEM_SCALAR_P (@var{x})
684 In @code{mem} expressions, nonzero for reference to a scalar known not
685 to be a member of a structure, union, or array. Zero for such
686 references and for indirections through pointers, even pointers pointing
687 to scalar types. If both this flag and @code{MEM_IN_STRUCT_P} are clear,
688 then we don't know whether this @code{mem} is in a structure or not.
689 Both flags should never be simultaneously set.
690 Stored in the @code{return_val} field and printed as @samp{/i}.
691 680
692 @findex MEM_VOLATILE_P 681 @findex MEM_VOLATILE_P
693 @cindex @code{mem} and @samp{/v} 682 @cindex @code{mem} and @samp{/v}
694 @cindex @code{asm_input} and @samp{/v} 683 @cindex @code{asm_input} and @samp{/v}
695 @cindex @code{asm_operands} and @samp{/v} 684 @cindex @code{asm_operands} and @samp{/v}
784 773
785 Read-only in this context means never modified during the lifetime of the 774 Read-only in this context means never modified during the lifetime of the
786 program, not necessarily in ROM or in write-disabled pages. A common 775 program, not necessarily in ROM or in write-disabled pages. A common
787 example of the later is a shared library's global offset table. This 776 example of the later is a shared library's global offset table. This
788 table is initialized by the runtime loader, so the memory is technically 777 table is initialized by the runtime loader, so the memory is technically
789 writable, but after control is transfered from the runtime loader to the 778 writable, but after control is transferred from the runtime loader to the
790 application, this memory will never be subsequently modified. 779 application, this memory will never be subsequently modified.
791 780
792 Stored in the @code{unchanging} field and printed as @samp{/u}. 781 Stored in the @code{unchanging} field and printed as @samp{/u}.
793 782
794 @findex SCHED_GROUP_P 783 @findex SCHED_GROUP_P
795 @cindex @code{insn} and @samp{/s} 784 @cindex @code{insn} and @samp{/s}
796 @cindex @code{call_insn} and @samp{/s} 785 @cindex @code{call_insn} and @samp{/s}
797 @cindex @code{jump_insn} and @samp{/s} 786 @cindex @code{jump_insn} and @samp{/s}
798 @cindex @code{in_struct}, in @code{insn}, @code{jump_insn} and @code{call_insn} 787 @cindex @code{jump_table_data} and @samp{/s}
788 @cindex @code{in_struct}, in @code{insn}, @code{call_insn}, @code{jump_insn} and @code{jump_table_data}
799 @item SCHED_GROUP_P (@var{x}) 789 @item SCHED_GROUP_P (@var{x})
800 During instruction scheduling, in an @code{insn}, @code{call_insn} or 790 During instruction scheduling, in an @code{insn}, @code{call_insn},
801 @code{jump_insn}, indicates that the 791 @code{jump_insn} or @code{jump_table_data}, indicates that the
802 previous insn must be scheduled together with this insn. This is used to 792 previous insn must be scheduled together with this insn. This is used to
803 ensure that certain groups of instructions will not be split up by the 793 ensure that certain groups of instructions will not be split up by the
804 instruction scheduling pass, for example, @code{use} insns before 794 instruction scheduling pass, for example, @code{use} insns before
805 a @code{call_insn} may not be separated from the @code{call_insn}. 795 a @code{call_insn} may not be separated from the @code{call_insn}.
806 Stored in the @code{in_struct} field and printed as @samp{/s}. 796 Stored in the @code{in_struct} field and printed as @samp{/s}.
930 In an RTL dump, this flag is represented as @samp{/f}. 920 In an RTL dump, this flag is represented as @samp{/f}.
931 921
932 @findex in_struct 922 @findex in_struct
933 @cindex @samp{/s} in RTL dump 923 @cindex @samp{/s} in RTL dump
934 @item in_struct 924 @item in_struct
935 In @code{mem} expressions, it is 1 if the memory datum referred to is
936 all or part of a structure or array; 0 if it is (or might be) a scalar
937 variable. A reference through a C pointer has 0 because the pointer
938 might point to a scalar variable. This information allows the compiler
939 to determine something about possible cases of aliasing.
940
941 In @code{reg} expressions, it is 1 if the register has its entire life 925 In @code{reg} expressions, it is 1 if the register has its entire life
942 contained within the test expression of some loop. 926 contained within the test expression of some loop.
943 927
944 In @code{subreg} expressions, 1 means that the @code{subreg} is accessing 928 In @code{subreg} expressions, 1 means that the @code{subreg} is accessing
945 an object that has had its mode promoted from a wider mode. 929 an object that has had its mode promoted from a wider mode.
972 the value to be returned by the current function. On 956 the value to be returned by the current function. On
973 machines that pass parameters in registers, the same register number 957 machines that pass parameters in registers, the same register number
974 may be used for parameters as well, but this flag is not set on such 958 may be used for parameters as well, but this flag is not set on such
975 uses. 959 uses.
976 960
977 In @code{mem} expressions, 1 means the memory reference is to a scalar
978 known not to be a member of a structure, union, or array.
979
980 In @code{symbol_ref} expressions, 1 means the referenced symbol is weak. 961 In @code{symbol_ref} expressions, 1 means the referenced symbol is weak.
981 962
982 In @code{call} expressions, 1 means the call is pure. 963 In @code{call} expressions, 1 means the call is pure.
983 964
984 In an RTL dump, this flag is represented as @samp{/i}. 965 In an RTL dump, this flag is represented as @samp{/i}.
1057 1038
1058 @node Machine Modes 1039 @node Machine Modes
1059 @section Machine Modes 1040 @section Machine Modes
1060 @cindex machine modes 1041 @cindex machine modes
1061 1042
1062 @findex enum machine_mode 1043 @findex machine_mode
1063 A machine mode describes a size of data object and the representation used 1044 A machine mode describes a size of data object and the representation used
1064 for it. In the C code, machine modes are represented by an enumeration 1045 for it. In the C code, machine modes are represented by an enumeration
1065 type, @code{enum machine_mode}, defined in @file{machmode.def}. Each RTL 1046 type, @code{machine_mode}, defined in @file{machmode.def}. Each RTL
1066 expression has room for a machine mode and so do certain kinds of tree 1047 expression has room for a machine mode and so do certain kinds of tree
1067 expressions (declarations and types, to be precise). 1048 expressions (declarations and types, to be precise).
1068 1049
1069 In debugging dumps and machine descriptions, the machine mode of an RTL 1050 In debugging dumps and machine descriptions, the machine mode of an RTL
1070 expression is written after the expression code with a colon to separate 1051 expression is written after the expression code with a colon to separate
1114 ``Tetra Integer'' (?) mode represents a sixteen-byte integer. 1095 ``Tetra Integer'' (?) mode represents a sixteen-byte integer.
1115 1096
1116 @findex OImode 1097 @findex OImode
1117 @item OImode 1098 @item OImode
1118 ``Octa Integer'' (?) mode represents a thirty-two-byte integer. 1099 ``Octa Integer'' (?) mode represents a thirty-two-byte integer.
1100
1101 @findex XImode
1102 @item XImode
1103 ``Hexadeca Integer'' (?) mode represents a sixty-four-byte integer.
1119 1104
1120 @findex QFmode 1105 @findex QFmode
1121 @item QFmode 1106 @item QFmode
1122 ``Quarter-Floating'' mode represents a quarter-precision (single byte) 1107 ``Quarter-Floating'' mode represents a quarter-precision (single byte)
1123 floating point number. 1108 floating point number.
1309 @item CQImode, CHImode, CSImode, CDImode, CTImode, COImode 1294 @item CQImode, CHImode, CSImode, CDImode, CTImode, COImode
1310 These modes stand for a complex number represented as a pair of integer 1295 These modes stand for a complex number represented as a pair of integer
1311 values. The integer values are in @code{QImode}, @code{HImode}, 1296 values. The integer values are in @code{QImode}, @code{HImode},
1312 @code{SImode}, @code{DImode}, @code{TImode}, and @code{OImode}, 1297 @code{SImode}, @code{DImode}, @code{TImode}, and @code{OImode},
1313 respectively. 1298 respectively.
1299
1300 @findex BND32mode
1301 @findex BND64mode
1302 @item BND32mode BND64mode
1303 These modes stand for bounds for pointer of 32 and 64 bit size respectively.
1304 Mode size is double pointer mode size.
1314 @end table 1305 @end table
1315 1306
1316 The machine description defines @code{Pmode} as a C macro which expands 1307 The machine description defines @code{Pmode} as a C macro which expands
1317 into the machine mode used for addresses. Normally this is the mode 1308 into the machine mode used for addresses. Normally this is the mode
1318 whose size is @code{BITS_PER_WORD}, @code{SImode} on 32-bit machines. 1309 whose size is @code{BITS_PER_WORD}, @code{SImode} on 32-bit machines.
1392 (These are not currently implemented). 1383 (These are not currently implemented).
1393 1384
1394 @findex MODE_CC 1385 @findex MODE_CC
1395 @item MODE_CC 1386 @item MODE_CC
1396 Modes representing condition code values. These are @code{CCmode} plus 1387 Modes representing condition code values. These are @code{CCmode} plus
1397 any @code{CC_MODE} modes listed in the @file{@var{machine}-modes.def}. 1388 any @code{CC_MODE} modes listed in the @file{@var{machine}-modes.def}.
1398 @xref{Jump Patterns}, 1389 @xref{Jump Patterns},
1399 also see @ref{Condition Code}. 1390 also see @ref{Condition Code}.
1391
1392 @findex MODE_POINTER_BOUNDS
1393 @item MODE_POINTER_BOUNDS
1394 Pointer bounds modes. Used to represent values of pointer bounds type.
1395 Operations in these modes may be executed as NOPs depending on hardware
1396 features and environment setup.
1400 1397
1401 @findex MODE_RANDOM 1398 @findex MODE_RANDOM
1402 @item MODE_RANDOM 1399 @item MODE_RANDOM
1403 This is a catchall mode class for modes which don't fit into the above 1400 This is a catchall mode class for modes which don't fit into the above
1404 classes. Currently @code{VOIDmode} and @code{BLKmode} are in 1401 classes. Currently @code{VOIDmode} and @code{BLKmode} are in
1476 @findex GET_CLASS_NARROWEST_MODE 1473 @findex GET_CLASS_NARROWEST_MODE
1477 @item GET_CLASS_NARROWEST_MODE (@var{c}) 1474 @item GET_CLASS_NARROWEST_MODE (@var{c})
1478 Returns the narrowest mode in mode class @var{c}. 1475 Returns the narrowest mode in mode class @var{c}.
1479 @end table 1476 @end table
1480 1477
1478 The following 3 variables are defined on every target. They can be
1479 used to allocate buffers that are guaranteed to be large enough to
1480 hold any value that can be represented on the target. The first two
1481 can be overridden by defining them in the target's mode.def file,
1482 however, the value must be a constant that can determined very early
1483 in the compilation process. The third symbol cannot be overridden.
1484
1485 @table @code
1486 @findex BITS_PER_UNIT
1487 @item BITS_PER_UNIT
1488 The number of bits in an addressable storage unit (byte). If you do
1489 not define this, the default is 8.
1490
1491 @findex MAX_BITSIZE_MODE_ANY_INT
1492 @item MAX_BITSIZE_MODE_ANY_INT
1493 The maximum bitsize of any mode that is used in integer math. This
1494 should be overridden by the target if it uses large integers as
1495 containers for larger vectors but otherwise never uses the contents to
1496 compute integer values.
1497
1498 @findex MAX_BITSIZE_MODE_ANY_MODE
1499 @item MAX_BITSIZE_MODE_ANY_MODE
1500 The bitsize of the largest mode on the target.
1501 @end table
1502
1481 @findex byte_mode 1503 @findex byte_mode
1482 @findex word_mode 1504 @findex word_mode
1483 The global variables @code{byte_mode} and @code{word_mode} contain modes 1505 The global variables @code{byte_mode} and @code{word_mode} contain modes
1484 whose classes are @code{MODE_INT} and whose bitsizes are either 1506 whose classes are @code{MODE_INT} and whose bitsizes are either
1485 @code{BITS_PER_UNIT} or @code{BITS_PER_WORD}, respectively. On 32-bit 1507 @code{BITS_PER_UNIT} or @code{BITS_PER_WORD}, respectively. On 32-bit
1497 @item (const_int @var{i}) 1519 @item (const_int @var{i})
1498 This type of expression represents the integer value @var{i}. @var{i} 1520 This type of expression represents the integer value @var{i}. @var{i}
1499 is customarily accessed with the macro @code{INTVAL} as in 1521 is customarily accessed with the macro @code{INTVAL} as in
1500 @code{INTVAL (@var{exp})}, which is equivalent to @code{XWINT (@var{exp}, 0)}. 1522 @code{INTVAL (@var{exp})}, which is equivalent to @code{XWINT (@var{exp}, 0)}.
1501 1523
1502 Constants generated for modes with fewer bits than @code{HOST_WIDE_INT} 1524 Constants generated for modes with fewer bits than in
1503 must be sign extended to full width (e.g., with @code{gen_int_mode}). 1525 @code{HOST_WIDE_INT} must be sign extended to full width (e.g., with
1526 @code{gen_int_mode}). For constants for modes with more bits than in
1527 @code{HOST_WIDE_INT} the implied high order bits of that constant are
1528 copies of the top bit. Note however that values are neither
1529 inherently signed nor inherently unsigned; where necessary, signedness
1530 is determined by the rtl operation instead.
1504 1531
1505 @findex const0_rtx 1532 @findex const0_rtx
1506 @findex const1_rtx 1533 @findex const1_rtx
1507 @findex const2_rtx 1534 @findex const2_rtx
1508 @findex constm1_rtx 1535 @findex constm1_rtx
1524 @code{STORE_FLAG_VALUE} is @minus{}1, @code{const_true_rtx} and 1551 @code{STORE_FLAG_VALUE} is @minus{}1, @code{const_true_rtx} and
1525 @code{constm1_rtx} will point to the same object. 1552 @code{constm1_rtx} will point to the same object.
1526 1553
1527 @findex const_double 1554 @findex const_double
1528 @item (const_double:@var{m} @var{i0} @var{i1} @dots{}) 1555 @item (const_double:@var{m} @var{i0} @var{i1} @dots{})
1529 Represents either a floating-point constant of mode @var{m} or an 1556 This represents either a floating-point constant of mode @var{m} or
1530 integer constant too large to fit into @code{HOST_BITS_PER_WIDE_INT} 1557 (on older ports that do not define
1531 bits but small enough to fit within twice that number of bits (GCC 1558 @code{TARGET_SUPPORTS_WIDE_INT}) an integer constant too large to fit
1532 does not provide a mechanism to represent even larger constants). In 1559 into @code{HOST_BITS_PER_WIDE_INT} bits but small enough to fit within
1533 the latter case, @var{m} will be @code{VOIDmode}. 1560 twice that number of bits. In the latter case, @var{m} will be
1561 @code{VOIDmode}. For integral values constants for modes with more
1562 bits than twice the number in @code{HOST_WIDE_INT} the implied high
1563 order bits of that constant are copies of the top bit of
1564 @code{CONST_DOUBLE_HIGH}. Note however that integral values are
1565 neither inherently signed nor inherently unsigned; where necessary,
1566 signedness is determined by the rtl operation instead.
1567
1568 On more modern ports, @code{CONST_DOUBLE} only represents floating
1569 point values. New ports define @code{TARGET_SUPPORTS_WIDE_INT} to
1570 make this designation.
1534 1571
1535 @findex CONST_DOUBLE_LOW 1572 @findex CONST_DOUBLE_LOW
1536 If @var{m} is @code{VOIDmode}, the bits of the value are stored in 1573 If @var{m} is @code{VOIDmode}, the bits of the value are stored in
1537 @var{i0} and @var{i1}. @var{i0} is customarily accessed with the macro 1574 @var{i0} and @var{i1}. @var{i0} is customarily accessed with the macro
1538 @code{CONST_DOUBLE_LOW} and @var{i1} with @code{CONST_DOUBLE_HIGH}. 1575 @code{CONST_DOUBLE_LOW} and @var{i1} with @code{CONST_DOUBLE_HIGH}.
1542 @code{REAL_VALUE_TYPE} (@pxref{Floating Point}). The integers 1579 @code{REAL_VALUE_TYPE} (@pxref{Floating Point}). The integers
1543 represent a floating point number, but not precisely in the target 1580 represent a floating point number, but not precisely in the target
1544 machine's or host machine's floating point format. To convert them to 1581 machine's or host machine's floating point format. To convert them to
1545 the precise bit pattern used by the target machine, use the macro 1582 the precise bit pattern used by the target machine, use the macro
1546 @code{REAL_VALUE_TO_TARGET_DOUBLE} and friends (@pxref{Data Output}). 1583 @code{REAL_VALUE_TO_TARGET_DOUBLE} and friends (@pxref{Data Output}).
1584
1585 @findex CONST_WIDE_INT
1586 @item (const_wide_int:@var{m} @var{nunits} @var{elt0} @dots{})
1587 This contains an array of @code{HOST_WIDE_INT}s that is large enough
1588 to hold any constant that can be represented on the target. This form
1589 of rtl is only used on targets that define
1590 @code{TARGET_SUPPORTS_WIDE_INT} to be nonzero and then
1591 @code{CONST_DOUBLE}s are only used to hold floating-point values. If
1592 the target leaves @code{TARGET_SUPPORTS_WIDE_INT} defined as 0,
1593 @code{CONST_WIDE_INT}s are not used and @code{CONST_DOUBLE}s are as
1594 they were before.
1595
1596 The values are stored in a compressed format. The higher-order
1597 0s or -1s are not represented if they are just the logical sign
1598 extension of the number that is represented.
1599
1600 @findex CONST_WIDE_INT_VEC
1601 @item CONST_WIDE_INT_VEC (@var{code})
1602 Returns the entire array of @code{HOST_WIDE_INT}s that are used to
1603 store the value. This macro should be rarely used.
1604
1605 @findex CONST_WIDE_INT_NUNITS
1606 @item CONST_WIDE_INT_NUNITS (@var{code})
1607 The number of @code{HOST_WIDE_INT}s used to represent the number.
1608 Note that this generally is smaller than the number of
1609 @code{HOST_WIDE_INT}s implied by the mode size.
1610
1611 @findex CONST_WIDE_INT_ELT
1612 @item CONST_WIDE_INT_NUNITS (@var{code},@var{i})
1613 Returns the @code{i}th element of the array. Element 0 is contains
1614 the low order bits of the constant.
1547 1615
1548 @findex const_fixed 1616 @findex const_fixed
1549 @item (const_fixed:@var{m} @dots{}) 1617 @item (const_fixed:@var{m} @dots{})
1550 Represents a fixed-point constant of mode @var{m}. 1618 Represents a fixed-point constant of mode @var{m}.
1551 The operand is a data structure of type @code{struct fixed_value} and 1619 The operand is a data structure of type @code{struct fixed_value} and
1716 @item VIRTUAL_STACK_VARS_REGNUM 1784 @item VIRTUAL_STACK_VARS_REGNUM
1717 If @code{FRAME_GROWS_DOWNWARD} is defined to a nonzero value, this points 1785 If @code{FRAME_GROWS_DOWNWARD} is defined to a nonzero value, this points
1718 to immediately above the first variable on the stack. Otherwise, it points 1786 to immediately above the first variable on the stack. Otherwise, it points
1719 to the first variable on the stack. 1787 to the first variable on the stack.
1720 1788
1721 @cindex @code{STARTING_FRAME_OFFSET} and virtual registers 1789 @cindex @code{TARGET_STARTING_FRAME_OFFSET} and virtual registers
1722 @cindex @code{FRAME_POINTER_REGNUM} and virtual registers 1790 @cindex @code{FRAME_POINTER_REGNUM} and virtual registers
1723 @code{VIRTUAL_STACK_VARS_REGNUM} is replaced with the sum of the 1791 @code{VIRTUAL_STACK_VARS_REGNUM} is replaced with the sum of the
1724 register given by @code{FRAME_POINTER_REGNUM} and the value 1792 register given by @code{FRAME_POINTER_REGNUM} and the value
1725 @code{STARTING_FRAME_OFFSET}. 1793 @code{TARGET_STARTING_FRAME_OFFSET}.
1726 1794
1727 @findex VIRTUAL_STACK_DYNAMIC_REGNUM 1795 @findex VIRTUAL_STACK_DYNAMIC_REGNUM
1728 @item VIRTUAL_STACK_DYNAMIC_REGNUM 1796 @item VIRTUAL_STACK_DYNAMIC_REGNUM
1729 This points to the location of dynamically allocated memory on the stack 1797 This points to the location of dynamically allocated memory on the stack
1730 immediately after the stack pointer has been adjusted by the amount of 1798 immediately after the stack pointer has been adjusted by the amount of
1753 mode other than its natural one, or to refer to one register of 1821 mode other than its natural one, or to refer to one register of
1754 a multi-part @code{reg} that actually refers to several registers. 1822 a multi-part @code{reg} that actually refers to several registers.
1755 1823
1756 Each pseudo register has a natural mode. If it is necessary to 1824 Each pseudo register has a natural mode. If it is necessary to
1757 operate on it in a different mode, the register must be 1825 operate on it in a different mode, the register must be
1758 enclosed in a @code{subreg}. 1826 enclosed in a @code{subreg}.
1759 1827
1760 There are currently three supported types for the first operand of a 1828 There are currently three supported types for the first operand of a
1761 @code{subreg}: 1829 @code{subreg}:
1762 @itemize 1830 @itemize
1763 @item pseudo registers 1831 @item pseudo registers
1802 When @var{m1} is strictly wider than @var{m2}, the @code{subreg} 1870 When @var{m1} is strictly wider than @var{m2}, the @code{subreg}
1803 expression is called @dfn{paradoxical}. The canonical test for this 1871 expression is called @dfn{paradoxical}. The canonical test for this
1804 class of @code{subreg} is: 1872 class of @code{subreg} is:
1805 1873
1806 @smallexample 1874 @smallexample
1807 GET_MODE_SIZE (@var{m1}) > GET_MODE_SIZE (@var{m2}) 1875 paradoxical_subreg_p (@var{m1}, @var{m2})
1808 @end smallexample 1876 @end smallexample
1809 1877
1810 Paradoxical @code{subreg}s can be used as both lvalues and rvalues. 1878 Paradoxical @code{subreg}s can be used as both lvalues and rvalues.
1811 When used as an lvalue, the low-order bits of the source value 1879 When used as an lvalue, the low-order bits of the source value
1812 are stored in @var{reg} and the high-order bits are discarded. 1880 are stored in @var{reg} and the high-order bits are discarded.
1813 When used as an rvalue, the low-order bits of the @code{subreg} are 1881 When used as an rvalue, the low-order bits of the @code{subreg} are
1814 taken from @var{reg} while the high-order bits may or may not be 1882 taken from @var{reg} while the high-order bits may or may not be
1815 defined. 1883 defined.
1816 1884
1817 The high-order bits of rvalues are in the following circumstances: 1885 The high-order bits of rvalues are defined in the following circumstances:
1818 1886
1819 @itemize 1887 @itemize
1820 @item @code{subreg}s of @code{mem} 1888 @item @code{subreg}s of @code{mem}
1821 When @var{m2} is smaller than a word, the macro @code{LOAD_EXTEND_OP}, 1889 When @var{m2} is smaller than a word, the macro @code{LOAD_EXTEND_OP},
1822 can control how the high-order bits are defined. 1890 can control how the high-order bits are defined.
1847 1915
1848 would set the lower two bytes of @var{z} to @var{y} and set the upper 1916 would set the lower two bytes of @var{z} to @var{y} and set the upper
1849 two bytes to an unknown value assuming @code{SUBREG_PROMOTED_VAR_P} is 1917 two bytes to an unknown value assuming @code{SUBREG_PROMOTED_VAR_P} is
1850 false. 1918 false.
1851 1919
1852 @item Normal subregs 1920 @item Normal subregs
1853 When @var{m1} is at least as narrow as @var{m2} the @code{subreg} 1921 When @var{m1} is at least as narrow as @var{m2} the @code{subreg}
1854 expression is called @dfn{normal}. 1922 expression is called @dfn{normal}.
1855 1923
1856 Normal @code{subreg}s restrict consideration to certain bits of 1924 Normal @code{subreg}s restrict consideration to certain bits of
1857 @var{reg}. There are two cases. If @var{m1} is smaller than a word, 1925 @var{reg}. There are two cases. If @var{m1} is smaller than a word,
1896 floating point values as if they had the same endianness as integer 1964 floating point values as if they had the same endianness as integer
1897 values. This works because they handle them solely as a collection of 1965 values. This works because they handle them solely as a collection of
1898 integer values, with no particular numerical value. Only real.c and 1966 integer values, with no particular numerical value. Only real.c and
1899 the runtime libraries care about @code{FLOAT_WORDS_BIG_ENDIAN}. 1967 the runtime libraries care about @code{FLOAT_WORDS_BIG_ENDIAN}.
1900 1968
1901 Thus, 1969 Thus,
1902 1970
1903 @smallexample 1971 @smallexample
1904 (subreg:HI (reg:SI @var{x}) 2) 1972 (subreg:HI (reg:SI @var{x}) 2)
1905 @end smallexample 1973 @end smallexample
1906 1974
1954 @end smallexample 2022 @end smallexample
1955 2023
1956 does not guarantee that @samp{(subreg:HI (reg:PSI 0) 0)} has the 2024 does not guarantee that @samp{(subreg:HI (reg:PSI 0) 0)} has the
1957 value @samp{(reg:HI 4)}. 2025 value @samp{(reg:HI 4)}.
1958 2026
1959 @cindex @code{CANNOT_CHANGE_MODE_CLASS} and subreg semantics 2027 @cindex @code{TARGET_CAN_CHANGE_MODE_CLASS} and subreg semantics
1960 The rules above apply to both pseudo @var{reg}s and hard @var{reg}s. 2028 The rules above apply to both pseudo @var{reg}s and hard @var{reg}s.
1961 If the semantics are not correct for particular combinations of 2029 If the semantics are not correct for particular combinations of
1962 @var{m1}, @var{m2} and hard @var{reg}, the target-specific code 2030 @var{m1}, @var{m2} and hard @var{reg}, the target-specific code
1963 must ensure that those combinations are never used. For example: 2031 must ensure that those combinations are never used. For example:
1964 2032
1965 @smallexample 2033 @smallexample
1966 CANNOT_CHANGE_MODE_CLASS (@var{m2}, @var{m1}, @var{class}) 2034 TARGET_CAN_CHANGE_MODE_CLASS (@var{m2}, @var{m1}, @var{class})
1967 @end smallexample 2035 @end smallexample
1968 2036
1969 must be true for every class @var{class} that includes @var{reg}. 2037 must be false for every class @var{class} that includes @var{reg}.
1970 2038
1971 @findex SUBREG_REG 2039 @findex SUBREG_REG
1972 @findex SUBREG_BYTE 2040 @findex SUBREG_BYTE
1973 The first operand of a @code{subreg} expression is customarily accessed 2041 The first operand of a @code{subreg} expression is customarily accessed
1974 with the @code{SUBREG_REG} macro and the second operand is customarily 2042 with the @code{SUBREG_REG} macro and the second operand is customarily
2155 @item (compare:@var{m} @var{x} @var{y}) 2223 @item (compare:@var{m} @var{x} @var{y})
2156 Represents the result of subtracting @var{y} from @var{x} for purposes 2224 Represents the result of subtracting @var{y} from @var{x} for purposes
2157 of comparison. The result is computed without overflow, as if with 2225 of comparison. The result is computed without overflow, as if with
2158 infinite precision. 2226 infinite precision.
2159 2227
2160 Of course, machines can't really subtract with infinite precision. 2228 Of course, machines cannot really subtract with infinite precision.
2161 However, they can pretend to do so when only the sign of the result will 2229 However, they can pretend to do so when only the sign of the result will
2162 be used, which is the case when the result is stored in the condition 2230 be used, which is the case when the result is stored in the condition
2163 code. And that is the @emph{only} way this kind of expression may 2231 code. And that is the @emph{only} way this kind of expression may
2164 validly be used: as a value to be stored in the condition codes, either 2232 validly be used: as a value to be stored in the condition codes, either
2165 @code{(cc0)} or a register. @xref{Comparisons}. 2233 @code{(cc0)} or a register. @xref{Comparisons}.
2236 @code{zero_extend} instead of @code{sign_extend}. 2304 @code{zero_extend} instead of @code{sign_extend}.
2237 2305
2238 @findex fma 2306 @findex fma
2239 @item (fma:@var{m} @var{x} @var{y} @var{z}) 2307 @item (fma:@var{m} @var{x} @var{y} @var{z})
2240 Represents the @code{fma}, @code{fmaf}, and @code{fmal} builtin 2308 Represents the @code{fma}, @code{fmaf}, and @code{fmal} builtin
2241 functions that do a combined multiply of @var{x} and @var{y} and then 2309 functions, which compute @samp{@var{x} * @var{y} + @var{z}}
2242 adding to@var{z} without doing an intermediate rounding step. 2310 without doing an intermediate rounding step.
2243 2311
2244 @findex div 2312 @findex div
2245 @findex ss_div 2313 @findex ss_div
2246 @cindex division 2314 @cindex division
2247 @cindex signed division 2315 @cindex signed division
2394 2462
2395 @findex ffs 2463 @findex ffs
2396 @item (ffs:@var{m} @var{x}) 2464 @item (ffs:@var{m} @var{x})
2397 Represents one plus the index of the least significant 1-bit in 2465 Represents one plus the index of the least significant 1-bit in
2398 @var{x}, represented as an integer of mode @var{m}. (The value is 2466 @var{x}, represented as an integer of mode @var{m}. (The value is
2399 zero if @var{x} is zero.) The mode of @var{x} need not be @var{m}; 2467 zero if @var{x} is zero.) The mode of @var{x} must be @var{m}
2400 depending on the target machine, various mode combinations may be 2468 or @code{VOIDmode}.
2401 valid. 2469
2470 @findex clrsb
2471 @item (clrsb:@var{m} @var{x})
2472 Represents the number of redundant leading sign bits in @var{x},
2473 represented as an integer of mode @var{m}, starting at the most
2474 significant bit position. This is one less than the number of leading
2475 sign bits (either 0 or 1), with no special cases. The mode of @var{x}
2476 must be @var{m} or @code{VOIDmode}.
2402 2477
2403 @findex clz 2478 @findex clz
2404 @item (clz:@var{m} @var{x}) 2479 @item (clz:@var{m} @var{x})
2405 Represents the number of leading 0-bits in @var{x}, represented as an 2480 Represents the number of leading 0-bits in @var{x}, represented as an
2406 integer of mode @var{m}, starting at the most significant bit position. 2481 integer of mode @var{m}, starting at the most significant bit position.
2407 If @var{x} is zero, the value is determined by 2482 If @var{x} is zero, the value is determined by
2408 @code{CLZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}). Note that this is one of 2483 @code{CLZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}). Note that this is one of
2409 the few expressions that is not invariant under widening. The mode of 2484 the few expressions that is not invariant under widening. The mode of
2410 @var{x} will usually be an integer mode. 2485 @var{x} must be @var{m} or @code{VOIDmode}.
2411 2486
2412 @findex ctz 2487 @findex ctz
2413 @item (ctz:@var{m} @var{x}) 2488 @item (ctz:@var{m} @var{x})
2414 Represents the number of trailing 0-bits in @var{x}, represented as an 2489 Represents the number of trailing 0-bits in @var{x}, represented as an
2415 integer of mode @var{m}, starting at the least significant bit position. 2490 integer of mode @var{m}, starting at the least significant bit position.
2416 If @var{x} is zero, the value is determined by 2491 If @var{x} is zero, the value is determined by
2417 @code{CTZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}). Except for this case, 2492 @code{CTZ_DEFINED_VALUE_AT_ZERO} (@pxref{Misc}). Except for this case,
2418 @code{ctz(x)} is equivalent to @code{ffs(@var{x}) - 1}. The mode of 2493 @code{ctz(x)} is equivalent to @code{ffs(@var{x}) - 1}. The mode of
2419 @var{x} will usually be an integer mode. 2494 @var{x} must be @var{m} or @code{VOIDmode}.
2420 2495
2421 @findex popcount 2496 @findex popcount
2422 @item (popcount:@var{m} @var{x}) 2497 @item (popcount:@var{m} @var{x})
2423 Represents the number of 1-bits in @var{x}, represented as an integer of 2498 Represents the number of 1-bits in @var{x}, represented as an integer of
2424 mode @var{m}. The mode of @var{x} will usually be an integer mode. 2499 mode @var{m}. The mode of @var{x} must be @var{m} or @code{VOIDmode}.
2425 2500
2426 @findex parity 2501 @findex parity
2427 @item (parity:@var{m} @var{x}) 2502 @item (parity:@var{m} @var{x})
2428 Represents the number of 1-bits modulo 2 in @var{x}, represented as an 2503 Represents the number of 1-bits modulo 2 in @var{x}, represented as an
2429 integer of mode @var{m}. The mode of @var{x} will usually be an integer 2504 integer of mode @var{m}. The mode of @var{x} must be @var{m} or
2430 mode. 2505 @code{VOIDmode}.
2431 2506
2432 @findex bswap 2507 @findex bswap
2433 @item (bswap:@var{m} @var{x}) 2508 @item (bswap:@var{m} @var{x})
2434 Represents the value @var{x} with the order of bytes reversed, carried out 2509 Represents the value @var{x} with the order of bytes reversed, carried out
2435 in mode @var{m}, which must be a fixed-point machine mode. 2510 in mode @var{m}, which must be a fixed-point machine mode.
2511 The mode of @var{x} must be @var{m} or @code{VOIDmode}.
2436 @end table 2512 @end table
2437 2513
2438 @node Comparisons 2514 @node Comparisons
2439 @section Comparison Operations 2515 @section Comparison Operations
2440 @cindex RTL comparison operations 2516 @cindex RTL comparison operations
2622 @findex vec_select 2698 @findex vec_select
2623 @item (vec_select:@var{m} @var{vec1} @var{selection}) 2699 @item (vec_select:@var{m} @var{vec1} @var{selection})
2624 This describes an operation that selects parts of a vector. @var{vec1} is 2700 This describes an operation that selects parts of a vector. @var{vec1} is
2625 the source vector, and @var{selection} is a @code{parallel} that contains a 2701 the source vector, and @var{selection} is a @code{parallel} that contains a
2626 @code{const_int} for each of the subparts of the result vector, giving the 2702 @code{const_int} for each of the subparts of the result vector, giving the
2627 number of the source subpart that should be stored into it. 2703 number of the source subpart that should be stored into it.
2628 The result mode @var{m} is either the submode for a single element of 2704 The result mode @var{m} is either the submode for a single element of
2629 @var{vec1} (if only one subpart is selected), or another vector mode 2705 @var{vec1} (if only one subpart is selected), or another vector mode
2630 with that element submode (if multiple subparts are selected). 2706 with that element submode (if multiple subparts are selected).
2631 2707
2632 @findex vec_concat 2708 @findex vec_concat
2633 @item (vec_concat:@var{m} @var{vec1} @var{vec2}) 2709 @item (vec_concat:@var{m} @var{x1} @var{x2})
2634 Describes a vector concat operation. The result is a concatenation of the 2710 Describes a vector concat operation. The result is a concatenation of the
2635 vectors @var{vec1} and @var{vec2}; its length is the sum of the lengths of 2711 vectors or scalars @var{x1} and @var{x2}; its length is the sum of the
2636 the two inputs. 2712 lengths of the two inputs.
2637 2713
2638 @findex vec_duplicate 2714 @findex vec_duplicate
2639 @item (vec_duplicate:@var{m} @var{vec}) 2715 @item (vec_duplicate:@var{m} @var{x})
2640 This operation converts a small vector into a larger one by duplicating the 2716 This operation converts a scalar into a vector or a small vector into a
2641 input values. The output vector mode must have the same submodes as the 2717 larger one by duplicating the input values. The output vector mode must have
2642 input vector mode, and the number of output parts must be an integer multiple 2718 the same submodes as the input vector mode or the scalar modes, and the
2643 of the number of input parts. 2719 number of output parts must be an integer multiple of the number of input
2720 parts.
2644 2721
2645 @end table 2722 @end table
2646 2723
2647 @node Conversions 2724 @node Conversions
2648 @section Conversions 2725 @section Conversions
2893 placed in @code{pc} to return to the caller. 2970 placed in @code{pc} to return to the caller.
2894 2971
2895 Note that an insn pattern of @code{(return)} is logically equivalent to 2972 Note that an insn pattern of @code{(return)} is logically equivalent to
2896 @code{(set (pc) (return))}, but the latter form is never used. 2973 @code{(set (pc) (return))}, but the latter form is never used.
2897 2974
2975 @findex simple_return
2976 @item (simple_return)
2977 Like @code{(return)}, but truly represents only a function return, while
2978 @code{(return)} may represent an insn that also performs other functions
2979 of the function epilogue. Like @code{(return)}, this may also occur in
2980 conditional jumps.
2981
2898 @findex call 2982 @findex call
2899 @item (call @var{function} @var{nargs}) 2983 @item (call @var{function} @var{nargs})
2900 Represents a function call. @var{function} is a @code{mem} expression 2984 Represents a function call. @var{function} is a @code{mem} expression
2901 whose address is the address of the function to be called. 2985 whose address is the address of the function to be called.
2902 @var{nargs} is an expression which can be used for two purposes: on 2986 @var{nargs} is an expression which can be used for two purposes: on
3022 @item (parallel [@var{x0} @var{x1} @dots{}]) 3106 @item (parallel [@var{x0} @var{x1} @dots{}])
3023 Represents several side effects performed in parallel. The square 3107 Represents several side effects performed in parallel. The square
3024 brackets stand for a vector; the operand of @code{parallel} is a 3108 brackets stand for a vector; the operand of @code{parallel} is a
3025 vector of expressions. @var{x0}, @var{x1} and so on are individual 3109 vector of expressions. @var{x0}, @var{x1} and so on are individual
3026 side effect expressions---expressions of code @code{set}, @code{call}, 3110 side effect expressions---expressions of code @code{set}, @code{call},
3027 @code{return}, @code{clobber} or @code{use}. 3111 @code{return}, @code{simple_return}, @code{clobber} or @code{use}.
3028 3112
3029 ``In parallel'' means that first all the values used in the individual 3113 ``In parallel'' means that first all the values used in the individual
3030 side-effects are computed, and second all the actual side-effects are 3114 side-effects are computed, and second all the actual side-effects are
3031 performed. For example, 3115 performed. For example,
3032 3116
3063 Peephole optimization, which takes place together with final assembly 3147 Peephole optimization, which takes place together with final assembly
3064 code output, can produce insns whose patterns consist of a @code{parallel} 3148 code output, can produce insns whose patterns consist of a @code{parallel}
3065 whose elements are the operands needed to output the resulting 3149 whose elements are the operands needed to output the resulting
3066 assembler code---often @code{reg}, @code{mem} or constant expressions. 3150 assembler code---often @code{reg}, @code{mem} or constant expressions.
3067 This would not be well-formed RTL at any other stage in compilation, 3151 This would not be well-formed RTL at any other stage in compilation,
3068 but it is ok then because no further optimization remains to be done. 3152 but it is OK then because no further optimization remains to be done.
3069 However, the definition of the macro @code{NOTICE_UPDATE_CC}, if 3153 However, the definition of the macro @code{NOTICE_UPDATE_CC}, if
3070 any, must deal with such insns if you define any peephole optimizations. 3154 any, must deal with such insns if you define any peephole optimizations.
3071 3155
3072 @findex cond_exec 3156 @findex cond_exec
3073 @item (cond_exec [@var{cond} @var{expr}]) 3157 @item (cond_exec [@var{cond} @var{expr}])
3076 must not have side-effects, but the @var{expr} may very well have 3160 must not have side-effects, but the @var{expr} may very well have
3077 side-effects. 3161 side-effects.
3078 3162
3079 @findex sequence 3163 @findex sequence
3080 @item (sequence [@var{insns} @dots{}]) 3164 @item (sequence [@var{insns} @dots{}])
3081 Represents a sequence of insns. Each of the @var{insns} that appears 3165 Represents a sequence of insns. If a @code{sequence} appears in the
3082 in the vector is suitable for appearing in the chain of insns, so it 3166 chain of insns, then each of the @var{insns} that appears in the sequence
3083 must be an @code{insn}, @code{jump_insn}, @code{call_insn}, 3167 must be suitable for appearing in the chain of insns, i.e. must satisfy
3084 @code{code_label}, @code{barrier} or @code{note}. 3168 the @code{INSN_P} predicate.
3085
3086 A @code{sequence} RTX is never placed in an actual insn during RTL
3087 generation. It represents the sequence of insns that result from a
3088 @code{define_expand} @emph{before} those insns are passed to
3089 @code{emit_insn} to insert them in the chain of insns. When actually
3090 inserted, the individual sub-insns are separated out and the
3091 @code{sequence} is forgotten.
3092 3169
3093 After delay-slot scheduling is completed, an insn and all the insns that 3170 After delay-slot scheduling is completed, an insn and all the insns that
3094 reside in its delay slots are grouped together into a @code{sequence}. 3171 reside in its delay slots are grouped together into a @code{sequence}.
3095 The insn requiring the delay slot is the first insn in the vector; 3172 The insn requiring the delay slot is the first insn in the vector;
3096 subsequent insns are to be placed in the delay slot. 3173 subsequent insns are to be placed in the delay slot.
3100 the effect of the insns in the delay slots. In such a case, 3177 the effect of the insns in the delay slots. In such a case,
3101 @code{INSN_FROM_TARGET_P} indicates that the insn is from the target of 3178 @code{INSN_FROM_TARGET_P} indicates that the insn is from the target of
3102 the branch and should be executed only if the branch is taken; otherwise 3179 the branch and should be executed only if the branch is taken; otherwise
3103 the insn should be executed only if the branch is not taken. 3180 the insn should be executed only if the branch is not taken.
3104 @xref{Delay Slots}. 3181 @xref{Delay Slots}.
3182
3183 Some back ends also use @code{sequence} objects for purposes other than
3184 delay-slot groups. This is not supported in the common parts of the
3185 compiler, which treat such sequences as delay-slot groups.
3186
3187 DWARF2 Call Frame Address (CFA) adjustments are sometimes also expressed
3188 using @code{sequence} objects as the value of a @code{RTX_FRAME_RELATED_P}
3189 note. This only happens if the CFA adjustments cannot be easily derived
3190 from the pattern of the instruction to which the note is attached. In
3191 such cases, the value of the note is used instead of best-guesing the
3192 semantics of the instruction. The back end can attach notes containing
3193 a @code{sequence} of @code{set} patterns that express the effect of the
3194 parent instruction.
3105 @end table 3195 @end table
3106 3196
3107 These expression codes appear in place of a side effect, as the body of 3197 These expression codes appear in place of a side effect, as the body of
3108 an insn, though strictly speaking they do not always describe side 3198 an insn, though strictly speaking they do not always describe side
3109 effects as such: 3199 effects as such:
3433 as @code{REG_LABEL_TARGET} notes. The exception is @code{addr_vec} 3523 as @code{REG_LABEL_TARGET} notes. The exception is @code{addr_vec}
3434 and @code{addr_diff_vec}, where @code{JUMP_LABEL} is @code{NULL_RTX} 3524 and @code{addr_diff_vec}, where @code{JUMP_LABEL} is @code{NULL_RTX}
3435 and the only way to find the labels is to scan the entire body of the 3525 and the only way to find the labels is to scan the entire body of the
3436 insn. 3526 insn.
3437 3527
3438 Return insns count as jumps, but since they do not refer to any 3528 Return insns count as jumps, but their @code{JUMP_LABEL} is @code{RETURN}
3439 labels, their @code{JUMP_LABEL} is @code{NULL_RTX}. 3529 or @code{SIMPLE_RETURN}.
3440 3530
3441 @findex call_insn 3531 @findex call_insn
3442 @item call_insn 3532 @item call_insn
3443 The expression code @code{call_insn} is used for instructions that may do 3533 The expression code @code{call_insn} is used for instructions that may do
3444 function calls. It is important to distinguish these instructions because 3534 function calls. It is important to distinguish these instructions because
3447 3537
3448 @findex CALL_INSN_FUNCTION_USAGE 3538 @findex CALL_INSN_FUNCTION_USAGE
3449 @code{call_insn} insns have the same extra fields as @code{insn} insns, 3539 @code{call_insn} insns have the same extra fields as @code{insn} insns,
3450 accessed in the same way and in addition contain a field 3540 accessed in the same way and in addition contain a field
3451 @code{CALL_INSN_FUNCTION_USAGE}, which contains a list (chain of 3541 @code{CALL_INSN_FUNCTION_USAGE}, which contains a list (chain of
3452 @code{expr_list} expressions) containing @code{use} and @code{clobber} 3542 @code{expr_list} expressions) containing @code{use}, @code{clobber} and
3453 expressions that denote hard registers and @code{MEM}s used or 3543 sometimes @code{set} expressions that denote hard registers and
3454 clobbered by the called function. 3544 @code{mem}s used or clobbered by the called function.
3455 3545
3456 A @code{MEM} generally points to a stack slots in which arguments passed 3546 A @code{mem} generally points to a stack slot in which arguments passed
3457 to the libcall by reference (@pxref{Register Arguments, 3547 to the libcall by reference (@pxref{Register Arguments,
3458 TARGET_PASS_BY_REFERENCE}) are stored. If the argument is 3548 TARGET_PASS_BY_REFERENCE}) are stored. If the argument is
3459 caller-copied (@pxref{Register Arguments, TARGET_CALLEE_COPIES}), 3549 caller-copied (@pxref{Register Arguments, TARGET_CALLEE_COPIES}),
3460 the stack slot will be mentioned in @code{CLOBBER} and @code{USE} 3550 the stack slot will be mentioned in @code{clobber} and @code{use}
3461 entries; if it's callee-copied, only a @code{USE} will appear, and the 3551 entries; if it's callee-copied, only a @code{use} will appear, and the
3462 @code{MEM} may point to addresses that are not stack slots. 3552 @code{mem} may point to addresses that are not stack slots.
3463 3553
3464 @code{CLOBBER}ed registers in this list augment registers specified in 3554 Registers occurring inside a @code{clobber} in this list augment
3465 @code{CALL_USED_REGISTERS} (@pxref{Register Basics}). 3555 registers specified in @code{CALL_USED_REGISTERS} (@pxref{Register
3556 Basics}).
3557
3558 If the list contains a @code{set} involving two registers, it indicates
3559 that the function returns one of its arguments. Such a @code{set} may
3560 look like a no-op if the same register holds the argument and the return
3561 value.
3466 3562
3467 @findex code_label 3563 @findex code_label
3468 @findex CODE_LABEL_NUMBER 3564 @findex CODE_LABEL_NUMBER
3469 @item code_label 3565 @item code_label
3470 A @code{code_label} insn represents a label that a jump insn can jump 3566 A @code{code_label} insn represents a label that a jump insn can jump
3510 them, is the function @code{output_alternate_entry_point}, in 3606 them, is the function @code{output_alternate_entry_point}, in
3511 @file{final.c}. 3607 @file{final.c}.
3512 3608
3513 To set the kind of a label, use the @code{SET_LABEL_KIND} macro. 3609 To set the kind of a label, use the @code{SET_LABEL_KIND} macro.
3514 3610
3611 @findex jump_table_data
3612 @item jump_table_data
3613 A @code{jump_table_data} insn is a placeholder for the jump-table data
3614 of a @code{casesi} or @code{tablejump} insn. They are placed after
3615 a @code{tablejump_p} insn. A @code{jump_table_data} insn is not part o
3616 a basic blockm but it is associated with the basic block that ends with
3617 the @code{tablejump_p} insn. The @code{PATTERN} of a @code{jump_table_data}
3618 is always either an @code{addr_vec} or an @code{addr_diff_vec}, and a
3619 @code{jump_table_data} insn is always preceded by a @code{code_label}.
3620 The @code{tablejump_p} insn refers to that @code{code_label} via its
3621 @code{JUMP_LABEL}.
3622
3515 @findex barrier 3623 @findex barrier
3516 @item barrier 3624 @item barrier
3517 Barriers are placed in the instruction stream when control cannot flow 3625 Barriers are placed in the instruction stream when control cannot flow
3518 past them. They are placed after unconditional jump instructions to 3626 past them. They are placed after unconditional jump instructions to
3519 indicate that the jumps are unconditional and after calls to 3627 indicate that the jumps are unconditional and after calls to
3561 @findex NOTE_INSN_EH_REGION_BEG 3669 @findex NOTE_INSN_EH_REGION_BEG
3562 @findex NOTE_INSN_EH_REGION_END 3670 @findex NOTE_INSN_EH_REGION_END
3563 @item NOTE_INSN_EH_REGION_BEG 3671 @item NOTE_INSN_EH_REGION_BEG
3564 @itemx NOTE_INSN_EH_REGION_END 3672 @itemx NOTE_INSN_EH_REGION_END
3565 These types of notes indicate the position of the beginning and end of a 3673 These types of notes indicate the position of the beginning and end of a
3566 level of scoping for exception handling. @code{NOTE_BLOCK_NUMBER} 3674 level of scoping for exception handling. @code{NOTE_EH_HANDLER}
3567 identifies which @code{CODE_LABEL} or @code{note} of type 3675 identifies which region is associated with these notes.
3568 @code{NOTE_INSN_DELETED_LABEL} is associated with the given region.
3569
3570 @findex NOTE_INSN_LOOP_BEG
3571 @findex NOTE_INSN_LOOP_END
3572 @item NOTE_INSN_LOOP_BEG
3573 @itemx NOTE_INSN_LOOP_END
3574 These types of notes indicate the position of the beginning and end
3575 of a @code{while} or @code{for} loop. They enable the loop optimizer
3576 to find loops quickly.
3577
3578 @findex NOTE_INSN_LOOP_CONT
3579 @item NOTE_INSN_LOOP_CONT
3580 Appears at the place in a loop that @code{continue} statements jump to.
3581
3582 @findex NOTE_INSN_LOOP_VTOP
3583 @item NOTE_INSN_LOOP_VTOP
3584 This note indicates the place in a loop where the exit test begins for
3585 those loops in which the exit test has been duplicated. This position
3586 becomes another virtual start of the loop when considering loop
3587 invariants.
3588 3676
3589 @findex NOTE_INSN_FUNCTION_BEG 3677 @findex NOTE_INSN_FUNCTION_BEG
3590 @item NOTE_INSN_FUNCTION_BEG 3678 @item NOTE_INSN_FUNCTION_BEG
3591 Appears at the start of the function body, after the function 3679 Appears at the start of the function body, after the function
3592 prologue. 3680 prologue.
3661 and @code{call_insn} insns: 3749 and @code{call_insn} insns:
3662 3750
3663 @table @code 3751 @table @code
3664 @findex PATTERN 3752 @findex PATTERN
3665 @item PATTERN (@var{i}) 3753 @item PATTERN (@var{i})
3666 An expression for the side effect performed by this insn. This must be 3754 An expression for the side effect performed by this insn. This must
3667 one of the following codes: @code{set}, @code{call}, @code{use}, 3755 be one of the following codes: @code{set}, @code{call}, @code{use},
3668 @code{clobber}, @code{return}, @code{asm_input}, @code{asm_output}, 3756 @code{clobber}, @code{return}, @code{simple_return}, @code{asm_input},
3669 @code{addr_vec}, @code{addr_diff_vec}, @code{trap_if}, @code{unspec}, 3757 @code{asm_output}, @code{addr_vec}, @code{addr_diff_vec},
3670 @code{unspec_volatile}, @code{parallel}, @code{cond_exec}, or @code{sequence}. If it is a @code{parallel}, 3758 @code{trap_if}, @code{unspec}, @code{unspec_volatile},
3671 each element of the @code{parallel} must be one these codes, except that 3759 @code{parallel}, @code{cond_exec}, or @code{sequence}. If it is a
3672 @code{parallel} expressions cannot be nested and @code{addr_vec} and 3760 @code{parallel}, each element of the @code{parallel} must be one these
3673 @code{addr_diff_vec} are not permitted inside a @code{parallel} expression. 3761 codes, except that @code{parallel} expressions cannot be nested and
3762 @code{addr_vec} and @code{addr_diff_vec} are not permitted inside a
3763 @code{parallel} expression.
3674 3764
3675 @findex INSN_CODE 3765 @findex INSN_CODE
3676 @item INSN_CODE (@var{i}) 3766 @item INSN_CODE (@var{i})
3677 An integer that says which pattern in the machine description matches 3767 An integer that says which pattern in the machine description matches
3678 this insn, or @minus{}1 if the matching has not yet been attempted. 3768 this insn, or @minus{}1 if the matching has not yet been attempted.
3695 @item LOG_LINKS (@var{i}) 3785 @item LOG_LINKS (@var{i})
3696 A list (chain of @code{insn_list} expressions) giving information about 3786 A list (chain of @code{insn_list} expressions) giving information about
3697 dependencies between instructions within a basic block. Neither a jump 3787 dependencies between instructions within a basic block. Neither a jump
3698 nor a label may come between the related insns. These are only used by 3788 nor a label may come between the related insns. These are only used by
3699 the schedulers and by combine. This is a deprecated data structure. 3789 the schedulers and by combine. This is a deprecated data structure.
3700 Def-use and use-def chains are now preferred. 3790 Def-use and use-def chains are now preferred.
3701 3791
3702 @findex REG_NOTES 3792 @findex REG_NOTES
3703 @item REG_NOTES (@var{i}) 3793 @item REG_NOTES (@var{i})
3704 A list (chain of @code{expr_list} and @code{insn_list} expressions) 3794 A list (chain of @code{expr_list}, @code{insn_list} and @code{int_list}
3705 giving miscellaneous information about the insn. It is often 3795 expressions) giving miscellaneous information about the insn. It is often
3706 information pertaining to the registers used in this insn. 3796 information pertaining to the registers used in this insn.
3707 @end table 3797 @end table
3708 3798
3709 The @code{LOG_LINKS} field of an insn is a chain of @code{insn_list} 3799 The @code{LOG_LINKS} field of an insn is a chain of @code{insn_list}
3710 expressions. Each of these has two operands: the first is an insn, 3800 expressions. Each of these has two operands: the first is an insn,
3719 which can be used for instruction combination. For each insn, the flow 3809 which can be used for instruction combination. For each insn, the flow
3720 analysis pass adds a link to insns which store into registers values 3810 analysis pass adds a link to insns which store into registers values
3721 that are used for the first time in this insn. 3811 that are used for the first time in this insn.
3722 3812
3723 The @code{REG_NOTES} field of an insn is a chain similar to the 3813 The @code{REG_NOTES} field of an insn is a chain similar to the
3724 @code{LOG_LINKS} field but it includes @code{expr_list} expressions in 3814 @code{LOG_LINKS} field but it includes @code{expr_list} and @code{int_list}
3725 addition to @code{insn_list} expressions. There are several kinds of 3815 expressions in addition to @code{insn_list} expressions. There are several
3726 register notes, which are distinguished by the machine mode, which in a 3816 kinds of register notes, which are distinguished by the machine mode, which
3727 register note is really understood as being an @code{enum reg_note}. 3817 in a register note is really understood as being an @code{enum reg_note}.
3728 The first operand @var{op} of the note is data whose meaning depends on 3818 The first operand @var{op} of the note is data whose meaning depends on
3729 the kind of note. 3819 the kind of note.
3730 3820
3731 @findex REG_NOTE_KIND 3821 @findex REG_NOTE_KIND
3732 @findex PUT_REG_NOTE_KIND 3822 @findex PUT_REG_NOTE_KIND
3806 instruction should not be ``collapsed'' into a simpler branching 3896 instruction should not be ``collapsed'' into a simpler branching
3807 construct. It is used when the optimization to partition basic blocks 3897 construct. It is used when the optimization to partition basic blocks
3808 into hot and cold sections is turned on. 3898 into hot and cold sections is turned on.
3809 3899
3810 @findex REG_SETJMP 3900 @findex REG_SETJMP
3811 @item REG_SETJMP 3901 @item REG_SETJMP
3812 Appears attached to each @code{CALL_INSN} to @code{setjmp} or a 3902 Appears attached to each @code{CALL_INSN} to @code{setjmp} or a
3813 related function. 3903 related function.
3814 @end table 3904 @end table
3815 3905
3816 The following notes describe attributes of outputs of an insn: 3906 The following notes describe attributes of outputs of an insn:
3817 3907
3823 This note is only valid on an insn that sets only one register and 3913 This note is only valid on an insn that sets only one register and
3824 indicates that that register will be equal to @var{op} at run time; the 3914 indicates that that register will be equal to @var{op} at run time; the
3825 scope of this equivalence differs between the two types of notes. The 3915 scope of this equivalence differs between the two types of notes. The
3826 value which the insn explicitly copies into the register may look 3916 value which the insn explicitly copies into the register may look
3827 different from @var{op}, but they will be equal at run time. If the 3917 different from @var{op}, but they will be equal at run time. If the
3828 output of the single @code{set} is a @code{strict_low_part} expression, 3918 output of the single @code{set} is a @code{strict_low_part} or
3829 the note refers to the register that is contained in @code{SUBREG_REG} 3919 @code{zero_extract} expression, the note refers to the register that
3830 of the @code{subreg} expression. 3920 is contained in its first operand.
3831 3921
3832 For @code{REG_EQUIV}, the register is equivalent to @var{op} throughout 3922 For @code{REG_EQUIV}, the register is equivalent to @var{op} throughout
3833 the entire function, and could validly be replaced in all its 3923 the entire function, and could validly be replaced in all its
3834 occurrences by @var{op}. (``Validly'' here refers to the data flow of 3924 occurrences by @var{op}. (``Validly'' here refers to the data flow of
3835 the program; simple replacement may make some insns invalid.) For 3925 the program; simple replacement may make some insns invalid.) For
3923 This indicates an anti dependence (a write after read dependence). 4013 This indicates an anti dependence (a write after read dependence).
3924 4014
3925 @end table 4015 @end table
3926 4016
3927 These notes describe information gathered from gcov profile data. They 4017 These notes describe information gathered from gcov profile data. They
3928 are stored in the @code{REG_NOTES} field of an insn as an 4018 are stored in the @code{REG_NOTES} field of an insn.
3929 @code{expr_list}.
3930 4019
3931 @table @code 4020 @table @code
3932 @findex REG_BR_PROB 4021 @findex REG_BR_PROB
3933 @item REG_BR_PROB 4022 @item REG_BR_PROB
3934 This is used to specify the ratio of branches to non-branches of a 4023 This is used to specify the ratio of branches to non-branches of a
3935 branch insn according to the profile data. The value is stored as a 4024 branch insn according to the profile data. The note is represented
3936 value between 0 and REG_BR_PROB_BASE; larger values indicate a higher 4025 as an @code{int_list} expression whose integer value is an encoding
3937 probability that the branch will be taken. 4026 of @code{profile_probability} type. @code{profile_probability} provide
4027 member function @code{from_reg_br_prob_note} and @code{to_reg_br_prob_note}
4028 to extract and store the probability into the RTL encoding.
3938 4029
3939 @findex REG_BR_PRED 4030 @findex REG_BR_PRED
3940 @item REG_BR_PRED 4031 @item REG_BR_PRED
3941 These notes are found in JUMP insns after delayed branch scheduling 4032 These notes are found in JUMP insns after delayed branch scheduling
3942 has taken place. They indicate both the direction and the likelihood 4033 has taken place. They indicate both the direction and the likelihood
3945 @findex REG_FRAME_RELATED_EXPR 4036 @findex REG_FRAME_RELATED_EXPR
3946 @item REG_FRAME_RELATED_EXPR 4037 @item REG_FRAME_RELATED_EXPR
3947 This is used on an RTX_FRAME_RELATED_P insn wherein the attached expression 4038 This is used on an RTX_FRAME_RELATED_P insn wherein the attached expression
3948 is used in place of the actual insn pattern. This is done in cases where 4039 is used in place of the actual insn pattern. This is done in cases where
3949 the pattern is either complex or misleading. 4040 the pattern is either complex or misleading.
4041 @end table
4042
4043 The note @code{REG_CALL_NOCF_CHECK} is used in conjunction with the
4044 @option{-fcf-protection=branch} option. The note is set if a
4045 @code{nocf_check} attribute is specified for a function type or a
4046 pointer to function type. The note is stored in the @code{REG_NOTES}
4047 field of an insn.
4048
4049 @table @code
4050 @findex REG_CALL_NOCF_CHECK
4051 @item REG_CALL_NOCF_CHECK
4052 Users have control through the @code{nocf_check} attribute to identify
4053 which calls to a function should be skipped from control-flow instrumentation
4054 when the option @option{-fcf-protection=branch} is specified. The compiler
4055 puts a @code{REG_CALL_NOCF_CHECK} note on each @code{CALL_INSN} instruction
4056 that has a function type marked with a @code{nocf_check} attribute.
3950 @end table 4057 @end table
3951 4058
3952 For convenience, the machine mode in an @code{insn_list} or 4059 For convenience, the machine mode in an @code{insn_list} or
3953 @code{expr_list} is printed using these symbolic codes in debugging dumps. 4060 @code{expr_list} is printed using these symbolic codes in debugging dumps.
3954 4061