summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/multi-alternative.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-08-14 22:58:58 -0500
committerCraig Jennings <c@cjennings.net>2025-08-14 22:58:58 -0500
commit82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch)
tree158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/gcc~13/multi-alternative.html
parent9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff)
downloaddotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz
dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/gcc~13/multi-alternative.html')
-rw-r--r--devdocs/gcc~13/multi-alternative.html8
1 files changed, 0 insertions, 8 deletions
diff --git a/devdocs/gcc~13/multi-alternative.html b/devdocs/gcc~13/multi-alternative.html
deleted file mode 100644
index 77a7f39d..00000000
--- a/devdocs/gcc~13/multi-alternative.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="subsubsection-level-extent" id="Multi-Alternative"> <div class="nav-panel"> <p> Next: <a href="modifiers" accesskey="n" rel="next">Constraint Modifier Characters</a>, Previous: <a href="simple-constraints" accesskey="p" rel="prev">Simple 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="Multiple-Alternative-Constraints"><span>6.47.3.2 Multiple Alternative Constraints<a class="copiable-link" href="#Multiple-Alternative-Constraints"> ¶</a></span></h1> <p>Sometimes a single instruction has multiple alternative sets of possible operands. For example, on the 68000, a logical-or instruction can combine register or an immediate value into memory, or it can combine any kind of operand into a register; but it cannot combine one memory location into another. </p> <p>These constraints are represented as multiple alternatives. An alternative can be described by a series of letters for each operand. The overall constraint for an operand is made from the letters for this operand from the first alternative, a comma, the letters for this operand from the second alternative, a comma, and so on until the last alternative. All operands for a single instruction must have the same number of alternatives. </p> <p>So the first alternative for the 68000’s logical-or could be written as <code class="code">"+m" (output) : "ir" (input)</code>. The second could be <code class="code">"+r"
-(output): "irm" (input)</code>. However, the fact that two memory locations cannot be used in a single instruction prevents simply using <code class="code">"+rm"
-(output) : "irm" (input)</code>. Using multi-alternatives, this might be written as <code class="code">"+m,r" (output) : "ir,irm" (input)</code>. This describes all the available alternatives to the compiler, allowing it to choose the most efficient one for the current conditions. </p> <p>There is no way within the template to determine which alternative was chosen. However you may be able to wrap your <code class="code">asm</code> statements with builtins such as <code class="code">__builtin_constant_p</code> to achieve the desired results. </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/Multi-Alternative.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Multi-Alternative.html</a>
- </p>
-</div>