comparison gcc/doc/rtl.texi @ 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 @c Copyright (C) 1988-2018 Free Software Foundation, Inc. 1 @c Copyright (C) 1988-2020 Free Software Foundation, Inc.
2 @c This is part of the GCC manual. 2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi. 3 @c For copying conditions, see the file gcc.texi.
4 4
5 @node RTL 5 @node RTL
6 @chapter RTL Representation 6 @chapter RTL Representation
1730 The number of @code{HOST_WIDE_INT}s used to represent the number. 1730 The number of @code{HOST_WIDE_INT}s used to represent the number.
1731 Note that this generally is smaller than the number of 1731 Note that this generally is smaller than the number of
1732 @code{HOST_WIDE_INT}s implied by the mode size. 1732 @code{HOST_WIDE_INT}s implied by the mode size.
1733 1733
1734 @findex CONST_WIDE_INT_ELT 1734 @findex CONST_WIDE_INT_ELT
1735 @item CONST_WIDE_INT_NUNITS (@var{code},@var{i}) 1735 @item CONST_WIDE_INT_ELT (@var{code},@var{i})
1736 Returns the @code{i}th element of the array. Element 0 is contains 1736 Returns the @code{i}th element of the array. Element 0 is contains
1737 the low order bits of the constant. 1737 the low order bits of the constant.
1738 1738
1739 @findex const_fixed 1739 @findex const_fixed
1740 @item (const_fixed:@var{m} @dots{}) 1740 @item (const_fixed:@var{m} @dots{})
1804 @end smallexample 1804 @end smallexample
1805 1805
1806 Thus the first 6 elements (@samp{@{ 0, 1, 2, 6, 3, 8 @}}) are enough 1806 Thus the first 6 elements (@samp{@{ 0, 1, 2, 6, 3, 8 @}}) are enough
1807 to determine the whole sequence; we refer to them as the ``encoded'' 1807 to determine the whole sequence; we refer to them as the ``encoded''
1808 elements. They are the only elements present in the square brackets 1808 elements. They are the only elements present in the square brackets
1809 for variable-length @code{const_vector}s (i.e. for 1809 for variable-length @code{const_vector}s (i.e.@: for
1810 @code{const_vector}s whose mode @var{m} has a variable number of 1810 @code{const_vector}s whose mode @var{m} has a variable number of
1811 elements). However, as a convenience to code that needs to handle 1811 elements). However, as a convenience to code that needs to handle
1812 both @code{const_vector}s and @code{parallel}s, all elements are 1812 both @code{const_vector}s and @code{parallel}s, all elements are
1813 present in the square brackets for fixed-length @code{const_vector}s; 1813 present in the square brackets for fixed-length @code{const_vector}s;
1814 the encoding scheme simply reduces the amount of work involved in 1814 the encoding scheme simply reduces the amount of work involved in
1881 @code{unspec}s are target-specific and typically represent some form 1881 @code{unspec}s are target-specific and typically represent some form
1882 of relocation operator. @var{m} should be a valid address mode. 1882 of relocation operator. @var{m} should be a valid address mode.
1883 1883
1884 @findex high 1884 @findex high
1885 @item (high:@var{m} @var{exp}) 1885 @item (high:@var{m} @var{exp})
1886 Represents the high-order bits of @var{exp}, usually a 1886 Represents the high-order bits of @var{exp}.
1887 @code{symbol_ref}. The number of bits is machine-dependent and is 1887 The number of bits is machine-dependent and is
1888 normally the number of bits specified in an instruction that initializes 1888 normally the number of bits specified in an instruction that initializes
1889 the high order bits of a register. It is used with @code{lo_sum} to 1889 the high order bits of a register. It is used with @code{lo_sum} to
1890 represent the typical two-instruction sequence used in RISC machines to 1890 represent the typical two-instruction sequence used in RISC machines to
1891 reference a global memory location. 1891 reference large immediate values and/or link-time constants such
1892 1892 as global memory addresses. In the latter case, @var{m} is @code{Pmode}
1893 @var{m} should be @code{Pmode}. 1893 and @var{exp} is usually a constant expression involving @code{symbol_ref}.
1894 @end table 1894 @end table
1895 1895
1896 @findex CONST0_RTX 1896 @findex CONST0_RTX
1897 @findex CONST1_RTX 1897 @findex CONST1_RTX
1898 @findex CONST2_RTX 1898 @findex CONST2_RTX
2427 @findex lo_sum 2427 @findex lo_sum
2428 @item (lo_sum:@var{m} @var{x} @var{y}) 2428 @item (lo_sum:@var{m} @var{x} @var{y})
2429 2429
2430 This expression represents the sum of @var{x} and the low-order bits 2430 This expression represents the sum of @var{x} and the low-order bits
2431 of @var{y}. It is used with @code{high} (@pxref{Constants}) to 2431 of @var{y}. It is used with @code{high} (@pxref{Constants}) to
2432 represent the typical two-instruction sequence used in RISC machines 2432 represent the typical two-instruction sequence used in RISC machines to
2433 to reference a global memory location. 2433 reference large immediate values and/or link-time constants such
2434 as global memory addresses. In the latter case, @var{m} is @code{Pmode}
2435 and @var{y} is usually a constant expression involving @code{symbol_ref}.
2434 2436
2435 The number of low order bits is machine-dependent but is 2437 The number of low order bits is machine-dependent but is
2436 normally the number of bits in a @code{Pmode} item minus the number of 2438 normally the number of bits in mode @var{m} minus the number of
2437 bits set by @code{high}. 2439 bits set by @code{high}.
2438
2439 @var{m} should be @code{Pmode}.
2440 2440
2441 @findex minus 2441 @findex minus
2442 @findex ss_minus 2442 @findex ss_minus
2443 @findex us_minus 2443 @findex us_minus
2444 @cindex RTL difference 2444 @cindex RTL difference
2895 in the @code{insv} or @code{extv} pattern. 2895 in the @code{insv} or @code{extv} pattern.
2896 2896
2897 The mode @var{m} is the same as the mode that would be used for 2897 The mode @var{m} is the same as the mode that would be used for
2898 @var{loc} if it were a register. 2898 @var{loc} if it were a register.
2899 2899
2900 A @code{sign_extract} can not appear as an lvalue, or part thereof, 2900 A @code{sign_extract} cannot appear as an lvalue, or part thereof,
2901 in RTL. 2901 in RTL.
2902 2902
2903 @findex zero_extract 2903 @findex zero_extract
2904 @item (zero_extract:@var{m} @var{loc} @var{size} @var{pos}) 2904 @item (zero_extract:@var{m} @var{loc} @var{size} @var{pos})
2905 Like @code{sign_extract} but refers to an unsigned or zero-extended 2905 Like @code{sign_extract} but refers to an unsigned or zero-extended
3155 given the value @var{x} and the rest of the register is not changed. 3155 given the value @var{x} and the rest of the register is not changed.
3156 3156
3157 If @var{lval} is a @code{zero_extract}, then the referenced part of 3157 If @var{lval} is a @code{zero_extract}, then the referenced part of
3158 the bit-field (a memory or register reference) specified by the 3158 the bit-field (a memory or register reference) specified by the
3159 @code{zero_extract} is given the value @var{x} and the rest of the 3159 @code{zero_extract} is given the value @var{x} and the rest of the
3160 bit-field is not changed. Note that @code{sign_extract} can not 3160 bit-field is not changed. Note that @code{sign_extract} cannot
3161 appear in @var{lval}. 3161 appear in @var{lval}.
3162 3162
3163 If @var{lval} is @code{(cc0)}, it has no machine mode, and @var{x} may 3163 If @var{lval} is @code{(cc0)}, it has no machine mode, and @var{x} may
3164 be either a @code{compare} expression or a value that may have any mode. 3164 be either a @code{compare} expression or a value that may have any mode.
3165 The latter case represents a ``test'' instruction. The expression 3165 The latter case represents a ``test'' instruction. The expression
3293 There is one other known use for clobbering a pseudo register in a 3293 There is one other known use for clobbering a pseudo register in a
3294 @code{parallel}: when one of the input operands of the insn is also 3294 @code{parallel}: when one of the input operands of the insn is also
3295 clobbered by the insn. In this case, using the same pseudo register in 3295 clobbered by the insn. In this case, using the same pseudo register in
3296 the clobber and elsewhere in the insn produces the expected results. 3296 the clobber and elsewhere in the insn produces the expected results.
3297 3297
3298 @findex clobber_high
3299 @item (clobber_high @var{x})
3300 Represents the storing or possible storing of an unpredictable,
3301 undescribed value into the upper parts of @var{x}. The mode of the expression
3302 represents the lower parts of the register which will not be overwritten.
3303 @code{reg} must be a reg expression.
3304
3305 One place this is used is when calling into functions where the registers are
3306 preserved, but only up to a given number of bits. For example when using
3307 Aarch64 SVE, calling a TLS descriptor will cause only the lower 128 bits of
3308 each of the vector registers to be preserved.
3309
3310 @findex use 3298 @findex use
3311 @item (use @var{x}) 3299 @item (use @var{x})
3312 Represents the use of the value of @var{x}. It indicates that the 3300 Represents the use of the value of @var{x}. It indicates that the
3313 value in @var{x} at this point in the program is needed, even though 3301 value in @var{x} at this point in the program is needed, even though
3314 it may not be apparent why this is so. Therefore, the compiler will 3302 it may not be apparent why this is so. Therefore, the compiler will
3339 that the register is live. You should think twice before adding 3327 that the register is live. You should think twice before adding
3340 @code{use} statements, more often you will want to use @code{unspec} 3328 @code{use} statements, more often you will want to use @code{unspec}
3341 instead. The @code{use} RTX is most commonly useful to describe that 3329 instead. The @code{use} RTX is most commonly useful to describe that
3342 a fixed register is implicitly used in an insn. It is also safe to use 3330 a fixed register is implicitly used in an insn. It is also safe to use
3343 in patterns where the compiler knows for other reasons that the result 3331 in patterns where the compiler knows for other reasons that the result
3344 of the whole pattern is variable, such as @samp{movmem@var{m}} or 3332 of the whole pattern is variable, such as @samp{cpymem@var{m}} or
3345 @samp{call} patterns. 3333 @samp{call} patterns.
3346 3334
3347 During the reload phase, an insn that has a @code{use} as pattern 3335 During the reload phase, an insn that has a @code{use} as pattern
3348 can carry a reg_equal note. These @code{use} insns will be deleted 3336 can carry a reg_equal note. These @code{use} insns will be deleted
3349 before the reload phase exits. 3337 before the reload phase exits.
3358 @item (parallel [@var{x0} @var{x1} @dots{}]) 3346 @item (parallel [@var{x0} @var{x1} @dots{}])
3359 Represents several side effects performed in parallel. The square 3347 Represents several side effects performed in parallel. The square
3360 brackets stand for a vector; the operand of @code{parallel} is a 3348 brackets stand for a vector; the operand of @code{parallel} is a
3361 vector of expressions. @var{x0}, @var{x1} and so on are individual 3349 vector of expressions. @var{x0}, @var{x1} and so on are individual
3362 side effect expressions---expressions of code @code{set}, @code{call}, 3350 side effect expressions---expressions of code @code{set}, @code{call},
3363 @code{return}, @code{simple_return}, @code{clobber} @code{use} or 3351 @code{return}, @code{simple_return}, @code{clobber} or @code{use}.
3364 @code{clobber_high}.
3365 3352
3366 ``In parallel'' means that first all the values used in the individual 3353 ``In parallel'' means that first all the values used in the individual
3367 side-effects are computed, and second all the actual side-effects are 3354 side-effects are computed, and second all the actual side-effects are
3368 performed. For example, 3355 performed. For example,
3369 3356
3415 3402
3416 @findex sequence 3403 @findex sequence
3417 @item (sequence [@var{insns} @dots{}]) 3404 @item (sequence [@var{insns} @dots{}])
3418 Represents a sequence of insns. If a @code{sequence} appears in the 3405 Represents a sequence of insns. If a @code{sequence} appears in the
3419 chain of insns, then each of the @var{insns} that appears in the sequence 3406 chain of insns, then each of the @var{insns} that appears in the sequence
3420 must be suitable for appearing in the chain of insns, i.e. must satisfy 3407 must be suitable for appearing in the chain of insns, i.e.@: must satisfy
3421 the @code{INSN_P} predicate. 3408 the @code{INSN_P} predicate.
3422 3409
3423 After delay-slot scheduling is completed, an insn and all the insns that 3410 After delay-slot scheduling is completed, an insn and all the insns that
3424 reside in its delay slots are grouped together into a @code{sequence}. 3411 reside in its delay slots are grouped together into a @code{sequence}.
3425 The insn requiring the delay slot is the first insn in the vector; 3412 The insn requiring the delay slot is the first insn in the vector;