]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/doc/rtl.texi
Update copyright years.
[thirdparty/gcc.git] / gcc / doc / rtl.texi
index 5af71137a878b33a0331f9dcb74189215e26dbdf..34034a95ec404588f23cd7104efc329eaf79ded8 100644 (file)
@@ -1,4 +1,4 @@
-@c Copyright (C) 1988-2021 Free Software Foundation, Inc.
+@c Copyright (C) 1988-2024 Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
@@ -144,7 +144,7 @@ Currently, @file{rtl.def} defines these classes:
 @item RTX_OBJ
 An RTX code that represents an actual object, such as a register
 (@code{REG}) or a memory location (@code{MEM}, @code{SYMBOL_REF}).
-@code{LO_SUM}) is also included; instead, @code{SUBREG} and
+@code{LO_SUM} is also included; instead, @code{SUBREG} and
 @code{STRICT_LOW_PART} are not in this class, but in class
 @code{RTX_EXTRA}.
 
@@ -1028,8 +1028,8 @@ the symbol has already been written.
 
 @findex volatil
 @cindex @samp{/v} in RTL dump
-@item volatil
 @cindex volatile memory references
+@item volatil
 In a @code{mem}, @code{asm_operands}, or @code{asm_input}
 expression, it is 1 if the memory
 reference is volatile.  Volatile memory references may not be deleted,
@@ -2187,14 +2187,14 @@ laid out in memory order.  The memory order of bytes is defined by
 two target macros, @code{WORDS_BIG_ENDIAN} and @code{BYTES_BIG_ENDIAN}:
 
 @itemize
-@item
 @cindex @code{WORDS_BIG_ENDIAN}, effect on @code{subreg}
+@item
 @code{WORDS_BIG_ENDIAN}, if set to 1, says that byte number zero is
 part of the most significant word; otherwise, it is part of the least
 significant word.
 
-@item
 @cindex @code{BYTES_BIG_ENDIAN}, effect on @code{subreg}
+@item
 @code{BYTES_BIG_ENDIAN}, if set to 1, says that byte number zero is
 the most significant byte within a word; otherwise, it is the least
 significant byte within a word.
@@ -2205,7 +2205,7 @@ On a few targets, @code{FLOAT_WORDS_BIG_ENDIAN} disagrees with
 @code{WORDS_BIG_ENDIAN}.  However, most parts of the compiler treat
 floating point values as if they had the same endianness as integer
 values.  This works because they handle them solely as a collection of
-integer values, with no particular numerical value.  Only real.c and
+integer values, with no particular numerical value.  Only real.cc and
 the runtime libraries care about @code{FLOAT_WORDS_BIG_ENDIAN}.
 
 Thus,
@@ -2336,8 +2336,8 @@ that both performs the arithmetic and sets the condition code register.
 For examples, search for @samp{addcc} and @samp{andcc} in @file{sparc.md}.
 
 @findex pc
-@item (pc)
 @cindex program counter
+@item (pc)
 This represents the machine's program counter.  It has no operands and
 may not have a machine mode.  @code{(pc)} may be validly used only in
 certain specific contexts in jump instructions.
@@ -2524,7 +2524,19 @@ not be the same.
 For unsigned widening multiplication, use the same idiom, but with
 @code{zero_extend} instead of @code{sign_extend}.
 
+@findex smul_highpart
+@findex umul_highpart
+@cindex high-part multiplication
+@cindex multiplication high part
+@item (smul_highpart:@var{m} @var{x} @var{y})
+@itemx (umul_highpart:@var{m} @var{x} @var{y})
+Represents the high-part multiplication of @var{x} and @var{y} carried
+out in machine mode @var{m}.  @code{smul_highpart} returns the high part
+of a signed multiplication, @code{umul_highpart} returns the high part
+of an unsigned multiplication.
+
 @findex fma
+@cindex fused multiply-add
 @item (fma:@var{m} @var{x} @var{y} @var{z})
 Represents the @code{fma}, @code{fmaf}, and @code{fmal} builtin
 functions, which compute @samp{@var{x} * @var{y} + @var{z}}
@@ -2730,6 +2742,17 @@ integer of mode @var{m}.  The mode of @var{x} must be @var{m} or
 Represents the value @var{x} with the order of bytes reversed, carried out
 in mode @var{m}, which must be a fixed-point machine mode.
 The mode of @var{x} must be @var{m} or @code{VOIDmode}.
+
+@findex bitreverse
+@item (bitreverse:@var{m} @var{x})
+Represents the value @var{x} with the order of bits reversed, carried out
+in mode @var{m}, which must be a fixed-point machine mode.
+The mode of @var{x} must be @var{m} or @code{VOIDmode}.
+
+@findex copysign
+@item (copysign:@var{m} @var{x} @var{y})
+Represents the value @var{x} with the sign of @var{y}.
+Both @var{x} and @var{y} must have floating point machine mode @var{m}.
 @end table
 
 @node Comparisons
@@ -3834,7 +3857,7 @@ equivalent to testing whether @samp{LABEL_KIND (label) == LABEL_NORMAL}.
 The only place that cares about the distinction between static, global,
 and weak alternate entry points, besides the front-end code that creates
 them, is the function @code{output_alternate_entry_point}, in
-@file{final.c}.
+@file{final.cc}.
 
 To set the kind of a label, use the @code{SET_LABEL_KIND} macro.
 
@@ -4923,7 +4946,7 @@ It returns true on success or false if no suitable location exists.
 
 The pass should also tentatively change the pattern of the instruction
 to whatever form the pass wants the instruction to have.  This should use
-the facilities provided by @file{recog.c}.  For example:
+the facilities provided by @file{recog.cc}.  For example:
 
 @smallexample
 rtl_insn *rtl = insn->rtl ();
@@ -4941,7 +4964,7 @@ the pass should check whether the new pattern matches a target
 instruction or satisfies the requirements of an inline asm:
 
 @smallexample
-if (!rtl_ssa::recog (change))
+if (!rtl_ssa::recog (attempt, change))
   return false;
 @end smallexample
 
@@ -4992,7 +5015,7 @@ if (!rtl_ssa::restrict_movement (change))
 insn_change_watermark watermark;
 // Use validate_change etc. to change INSN's pattern.
 @dots{}
-if (!rtl_ssa::recog (change)
+if (!rtl_ssa::recog (attempt, change)
     || !rtl_ssa::change_is_worthwhile (change))
   return false;
 
@@ -5025,7 +5048,7 @@ For example, if a pass is changing exactly two instructions,
 it might do:
 
 @smallexample
-rtl_ssa::insn_change *changes[] = @{ &change1, change2 @};
+rtl_ssa::insn_change *changes[] = @{ &change1, &change2 @};
 @end smallexample
 
 where @code{change1}'s instruction must come before @code{change2}'s.
@@ -5043,7 +5066,7 @@ in the correct order with respect to each other.
 The way to do this is:
 
 @smallexample
-if (!rtl_ssa::restrict_movement (change, insn_is_changing (changes)))
+if (!rtl_ssa::restrict_movement_ignoring (change, insn_is_changing (changes)))
   return false;
 @end smallexample
 
@@ -5055,7 +5078,7 @@ changing instructions (which might, for example, no longer need
 to clobber the flags register).  The way to do this is:
 
 @smallexample
-if (!rtl_ssa::recog (change, insn_is_changing (changes)))
+if (!rtl_ssa::recog_ignoring (attempt, change, insn_is_changing (changes)))
   return false;
 @end smallexample
 
@@ -5095,28 +5118,28 @@ Putting all this together, the process for a two-instruction change is:
 @smallexample
 auto attempt = crtl->ssa->new_change_attempt ();
 
-rtl_ssa::insn_change change (insn1);
+rtl_ssa::insn_change change1 (insn1);
 change1.new_defs = @dots{};
 change1.new_uses = @dots{};
 change1.move_range = @dots{};
 
-rtl_ssa::insn_change change (insn2);
+rtl_ssa::insn_change change2 (insn2);
 change2.new_defs = @dots{};
 change2.new_uses = @dots{};
 change2.move_range = @dots{};
 
-rtl_ssa::insn_change *changes[] = @{ &change1, change2 @};
+rtl_ssa::insn_change *changes[] = @{ &change1, &change2 @};
 
 auto is_changing = insn_is_changing (changes);
-if (!rtl_ssa::restrict_movement (change1, is_changing)
-    || !rtl_ssa::restrict_movement (change2, is_changing))
+if (!rtl_ssa::restrict_movement_ignoring (change1, is_changing)
+    || !rtl_ssa::restrict_movement_ignoring (change2, is_changing))
   return false;
 
 insn_change_watermark watermark;
 // Use validate_change etc. to change INSN1's and INSN2's patterns.
 @dots{}
-if (!rtl_ssa::recog (change1, is_changing)
-    || !rtl_ssa::recog (change2, is_changing)
+if (!rtl_ssa::recog_ignoring (attempt, change1, is_changing)
+    || !rtl_ssa::recog_ignoring (attempt, change2, is_changing)
     || !rtl_ssa::changes_are_worthwhile (changes)
     || !crtl->ssa->verify_insn_changes (changes))
   return false;
@@ -5211,7 +5234,7 @@ side-effects on other insns.
 @item
 During initial RTL generation, shared structure is freely introduced.
 After all the RTL for a function has been generated, all shared
-structure is copied by @code{unshare_all_rtl} in @file{emit-rtl.c},
+structure is copied by @code{unshare_all_rtl} in @file{emit-rtl.cc},
 after which the above rules are guaranteed to be followed.
 
 @findex copy_rtx_if_shared
@@ -5228,7 +5251,7 @@ combiner is finished with the insn.  This is done by calling
 
 To read an RTL object from a file, call @code{read_rtx}.  It takes one
 argument, a stdio stream, and returns a single RTL object.  This routine
-is defined in @file{read-rtl.c}.  It is not available in the compiler
+is defined in @file{read-rtl.cc}.  It is not available in the compiler
 itself, only the various programs that generate the compiler back end
 from the machine description.