summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/modifiers.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/gcc~13/modifiers.html')
-rw-r--r--devdocs/gcc~13/modifiers.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/devdocs/gcc~13/modifiers.html b/devdocs/gcc~13/modifiers.html
new file mode 100644
index 00000000..de43cf4a
--- /dev/null
+++ b/devdocs/gcc~13/modifiers.html
@@ -0,0 +1,19 @@
+<div class="subsubsection-level-extent" id="Modifiers"> <div class="nav-panel"> <p> Next: <a href="machine-constraints" accesskey="n" rel="next">Constraints for Particular Machines</a>, Previous: <a href="multi-alternative" accesskey="p" rel="prev">Multiple Alternative Constraints</a>, Up: <a href="constraints" accesskey="u" rel="up">Constraints for <code class="code">asm</code> Operands</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="subsubsection subsection-level-set-subsubsection" id="Constraint-Modifier-Characters"><span>6.47.3.3 Constraint Modifier Characters<a class="copiable-link" href="#Constraint-Modifier-Characters"> ¶</a></span></h1> <p>Here are constraint modifier characters. </p> <dl class="table"> <dt>
+<span>‘<samp class="samp">=</samp>’<a class="copiable-link" href="#index-_003d-in-constraint"> ¶</a></span>
+</dt> <dd>
+<p>Means that this operand is written to by this instruction: the previous value is discarded and replaced by new data. </p> </dd> <dt>
+<span>‘<samp class="samp">+</samp>’<a class="copiable-link" href="#index-_002b-in-constraint"> ¶</a></span>
+</dt> <dd>
+<p>Means that this operand is both read and written by the instruction. </p> <p>When the compiler fixes up the operands to satisfy the constraints, it needs to know which operands are read by the instruction and which are written by it. ‘<samp class="samp">=</samp>’ identifies an operand which is only written; ‘<samp class="samp">+</samp>’ identifies an operand that is both read and written; all other operands are assumed to only be read. </p> <p>If you specify ‘<samp class="samp">=</samp>’ or ‘<samp class="samp">+</samp>’ in a constraint, you put it in the first character of the constraint string. </p> </dd> <dt>
+ <span>‘<samp class="samp">&amp;</samp>’<a class="copiable-link" href="#index-_0026-in-constraint"> ¶</a></span>
+</dt> <dd>
+<p>Means (in a particular alternative) that this operand is an <em class="dfn">earlyclobber</em> operand, which is written before the instruction is finished using the input operands. Therefore, this operand may not lie in a register that is read by the instruction or as part of any memory address. </p> <p>‘<samp class="samp">&amp;</samp>’ applies only to the alternative in which it is written. In constraints with multiple alternatives, sometimes one alternative requires ‘<samp class="samp">&amp;</samp>’ while others do not. See, for example, the ‘<samp class="samp">movdf</samp>’ insn of the 68000. </p> <p>An operand which is read by the instruction can be tied to an earlyclobber operand if its only use as an input occurs before the early result is written. Adding alternatives of this form often allows GCC to produce better code when only some of the read operands can be affected by the earlyclobber. See, for example, the ‘<samp class="samp">mulsi3</samp>’ insn of the ARM. </p> <p>Furthermore, if the <em class="dfn">earlyclobber</em> operand is also a read/write operand, then that operand is written only after it’s used. </p> <p>‘<samp class="samp">&amp;</samp>’ does not obviate the need to write ‘<samp class="samp">=</samp>’ or ‘<samp class="samp">+</samp>’. As <em class="dfn">earlyclobber</em> operands are always written, a read-only <em class="dfn">earlyclobber</em> operand is ill-formed and will be rejected by the compiler. </p> </dd> <dt>
+<span>‘<samp class="samp">%</samp>’<a class="copiable-link" href="#index-_0025-in-constraint"> ¶</a></span>
+</dt> <dd>
+<p>Declares the instruction to be commutative for this operand and the following operand. This means that the compiler may interchange the two operands if that is the cheapest way to make all operands fit the constraints. ‘<samp class="samp">%</samp>’ applies to all alternatives and must appear as the first character in the constraint. Only read-only operands can use ‘<samp class="samp">%</samp>’. </p> <p>GCC can only handle one commutative pair in an asm; if you use more, the compiler may fail. Note that you need not use the modifier if the two alternatives are strictly identical; this would only waste time in the reload pass. </p>
+</dd> </dl> </div> <div class="nav-panel"> <p> Next: <a href="machine-constraints">Constraints for Particular Machines</a>, Previous: <a href="multi-alternative">Multiple Alternative Constraints</a>, Up: <a href="constraints">Constraints for <code class="code">asm</code> Operands</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
+ <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Modifiers.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Modifiers.html</a>
+ </p>
+</div>