Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

3258 lines
162KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Standard Names (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Standard Names (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Standard Names (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Machine-Desc.html#Machine-Desc" rel="up" title="Machine Desc">
  30. <link href="Pattern-Ordering.html#Pattern-Ordering" rel="next" title="Pattern Ordering">
  31. <link href="C-Constraint-Interface.html#C-Constraint-Interface" rel="prev" title="C Constraint Interface">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Standard-Names"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Pattern-Ordering.html#Pattern-Ordering" accesskey="n" rel="next">Pattern Ordering</a>, Previous: <a href="Constraints.html#Constraints" accesskey="p" rel="prev">Constraints</a>, Up: <a href="Machine-Desc.html#Machine-Desc" accesskey="u" rel="up">Machine Desc</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Standard-Pattern-Names-For-Generation"></a>
  68. <h3 class="section">17.9 Standard Pattern Names For Generation</h3>
  69. <a name="index-standard-pattern-names"></a>
  70. <a name="index-pattern-names"></a>
  71. <a name="index-names_002c-pattern"></a>
  72. <p>Here is a table of the instruction names that are meaningful in the RTL
  73. generation pass of the compiler. Giving one of these names to an
  74. instruction pattern tells the RTL generation pass that it can use the
  75. pattern to accomplish a certain task.
  76. </p>
  77. <dl compact="compact">
  78. <dd><a name="index-movm-instruction-pattern"></a>
  79. </dd>
  80. <dt>&lsquo;<samp>mov<var>m</var></samp>&rsquo;</dt>
  81. <dd><p>Here <var>m</var> stands for a two-letter machine mode name, in lowercase.
  82. This instruction pattern moves data with that machine mode from operand
  83. 1 to operand 0. For example, &lsquo;<samp>movsi</samp>&rsquo; moves full-word data.
  84. </p>
  85. <p>If operand 0 is a <code>subreg</code> with mode <var>m</var> of a register whose
  86. own mode is wider than <var>m</var>, the effect of this instruction is
  87. to store the specified value in the part of the register that corresponds
  88. to mode <var>m</var>. Bits outside of <var>m</var>, but which are within the
  89. same target word as the <code>subreg</code> are undefined. Bits which are
  90. outside the target word are left unchanged.
  91. </p>
  92. <p>This class of patterns is special in several ways. First of all, each
  93. of these names up to and including full word size <em>must</em> be defined,
  94. because there is no other way to copy a datum from one place to another.
  95. If there are patterns accepting operands in larger modes,
  96. &lsquo;<samp>mov<var>m</var></samp>&rsquo; must be defined for integer modes of those sizes.
  97. </p>
  98. <p>Second, these patterns are not used solely in the RTL generation pass.
  99. Even the reload pass can generate move insns to copy values from stack
  100. slots into temporary registers. When it does so, one of the operands is
  101. a hard register and the other is an operand that can need to be reloaded
  102. into a register.
  103. </p>
  104. <a name="index-force_005freg"></a>
  105. <p>Therefore, when given such a pair of operands, the pattern must generate
  106. RTL which needs no reloading and needs no temporary registers&mdash;no
  107. registers other than the operands. For example, if you support the
  108. pattern with a <code>define_expand</code>, then in such a case the
  109. <code>define_expand</code> mustn&rsquo;t call <code>force_reg</code> or any other such
  110. function which might generate new pseudo registers.
  111. </p>
  112. <p>This requirement exists even for subword modes on a RISC machine where
  113. fetching those modes from memory normally requires several insns and
  114. some temporary registers.
  115. </p>
  116. <a name="index-change_005faddress"></a>
  117. <p>During reload a memory reference with an invalid address may be passed
  118. as an operand. Such an address will be replaced with a valid address
  119. later in the reload pass. In this case, nothing may be done with the
  120. address except to use it as it stands. If it is copied, it will not be
  121. replaced with a valid address. No attempt should be made to make such
  122. an address into a valid address and no routine (such as
  123. <code>change_address</code>) that will do so may be called. Note that
  124. <code>general_operand</code> will fail when applied to such an address.
  125. </p>
  126. <a name="index-reload_005fin_005fprogress"></a>
  127. <p>The global variable <code>reload_in_progress</code> (which must be explicitly
  128. declared if required) can be used to determine whether such special
  129. handling is required.
  130. </p>
  131. <p>The variety of operands that have reloads depends on the rest of the
  132. machine description, but typically on a RISC machine these can only be
  133. pseudo registers that did not get hard registers, while on other
  134. machines explicit memory references will get optional reloads.
  135. </p>
  136. <p>If a scratch register is required to move an object to or from memory,
  137. it can be allocated using <code>gen_reg_rtx</code> prior to life analysis.
  138. </p>
  139. <p>If there are cases which need scratch registers during or after reload,
  140. you must provide an appropriate secondary_reload target hook.
  141. </p>
  142. <a name="index-can_005fcreate_005fpseudo_005fp"></a>
  143. <p>The macro <code>can_create_pseudo_p</code> can be used to determine if it
  144. is unsafe to create new pseudo registers. If this variable is nonzero, then
  145. it is unsafe to call <code>gen_reg_rtx</code> to allocate a new pseudo.
  146. </p>
  147. <p>The constraints on a &lsquo;<samp>mov<var>m</var></samp>&rsquo; must permit moving any hard
  148. register to any other hard register provided that
  149. <code>TARGET_HARD_REGNO_MODE_OK</code> permits mode <var>m</var> in both registers and
  150. <code>TARGET_REGISTER_MOVE_COST</code> applied to their classes returns a value
  151. of 2.
  152. </p>
  153. <p>It is obligatory to support floating point &lsquo;<samp>mov<var>m</var></samp>&rsquo;
  154. instructions into and out of any registers that can hold fixed point
  155. values, because unions and structures (which have modes <code>SImode</code> or
  156. <code>DImode</code>) can be in those registers and they may have floating
  157. point members.
  158. </p>
  159. <p>There may also be a need to support fixed point &lsquo;<samp>mov<var>m</var></samp>&rsquo;
  160. instructions in and out of floating point registers. Unfortunately, I
  161. have forgotten why this was so, and I don&rsquo;t know whether it is still
  162. true. If <code>TARGET_HARD_REGNO_MODE_OK</code> rejects fixed point values in
  163. floating point registers, then the constraints of the fixed point
  164. &lsquo;<samp>mov<var>m</var></samp>&rsquo; instructions must be designed to avoid ever trying to
  165. reload into a floating point register.
  166. </p>
  167. <a name="index-reload_005fin-instruction-pattern"></a>
  168. <a name="index-reload_005fout-instruction-pattern"></a>
  169. </dd>
  170. <dt>&lsquo;<samp>reload_in<var>m</var></samp>&rsquo;</dt>
  171. <dt>&lsquo;<samp>reload_out<var>m</var></samp>&rsquo;</dt>
  172. <dd><p>These named patterns have been obsoleted by the target hook
  173. <code>secondary_reload</code>.
  174. </p>
  175. <p>Like &lsquo;<samp>mov<var>m</var></samp>&rsquo;, but used when a scratch register is required to
  176. move between operand 0 and operand 1. Operand 2 describes the scratch
  177. register. See the discussion of the <code>SECONDARY_RELOAD_CLASS</code>
  178. macro in see <a href="Register-Classes.html#Register-Classes">Register Classes</a>.
  179. </p>
  180. <p>There are special restrictions on the form of the <code>match_operand</code>s
  181. used in these patterns. First, only the predicate for the reload
  182. operand is examined, i.e., <code>reload_in</code> examines operand 1, but not
  183. the predicates for operand 0 or 2. Second, there may be only one
  184. alternative in the constraints. Third, only a single register class
  185. letter may be used for the constraint; subsequent constraint letters
  186. are ignored. As a special exception, an empty constraint string
  187. matches the <code>ALL_REGS</code> register class. This may relieve ports
  188. of the burden of defining an <code>ALL_REGS</code> constraint letter just
  189. for these patterns.
  190. </p>
  191. <a name="index-movstrictm-instruction-pattern"></a>
  192. </dd>
  193. <dt>&lsquo;<samp>movstrict<var>m</var></samp>&rsquo;</dt>
  194. <dd><p>Like &lsquo;<samp>mov<var>m</var></samp>&rsquo; except that if operand 0 is a <code>subreg</code>
  195. with mode <var>m</var> of a register whose natural mode is wider,
  196. the &lsquo;<samp>movstrict<var>m</var></samp>&rsquo; instruction is guaranteed not to alter
  197. any of the register except the part which belongs to mode <var>m</var>.
  198. </p>
  199. <a name="index-movmisalignm-instruction-pattern"></a>
  200. </dd>
  201. <dt>&lsquo;<samp>movmisalign<var>m</var></samp>&rsquo;</dt>
  202. <dd><p>This variant of a move pattern is designed to load or store a value
  203. from a memory address that is not naturally aligned for its mode.
  204. For a store, the memory will be in operand 0; for a load, the memory
  205. will be in operand 1. The other operand is guaranteed not to be a
  206. memory, so that it&rsquo;s easy to tell whether this is a load or store.
  207. </p>
  208. <p>This pattern is used by the autovectorizer, and when expanding a
  209. <code>MISALIGNED_INDIRECT_REF</code> expression.
  210. </p>
  211. <a name="index-load_005fmultiple-instruction-pattern"></a>
  212. </dd>
  213. <dt>&lsquo;<samp>load_multiple</samp>&rsquo;</dt>
  214. <dd><p>Load several consecutive memory locations into consecutive registers.
  215. Operand 0 is the first of the consecutive registers, operand 1
  216. is the first memory location, and operand 2 is a constant: the
  217. number of consecutive registers.
  218. </p>
  219. <p>Define this only if the target machine really has such an instruction;
  220. do not define this if the most efficient way of loading consecutive
  221. registers from memory is to do them one at a time.
  222. </p>
  223. <p>On some machines, there are restrictions as to which consecutive
  224. registers can be stored into memory, such as particular starting or
  225. ending register numbers or only a range of valid counts. For those
  226. machines, use a <code>define_expand</code> (see <a href="Expander-Definitions.html#Expander-Definitions">Expander Definitions</a>)
  227. and make the pattern fail if the restrictions are not met.
  228. </p>
  229. <p>Write the generated insn as a <code>parallel</code> with elements being a
  230. <code>set</code> of one register from the appropriate memory location (you may
  231. also need <code>use</code> or <code>clobber</code> elements). Use a
  232. <code>match_parallel</code> (see <a href="RTL-Template.html#RTL-Template">RTL Template</a>) to recognize the insn. See
  233. <samp>rs6000.md</samp> for examples of the use of this insn pattern.
  234. </p>
  235. <a name="index-store_005fmultiple-instruction-pattern"></a>
  236. </dd>
  237. <dt>&lsquo;<samp>store_multiple</samp>&rsquo;</dt>
  238. <dd><p>Similar to &lsquo;<samp>load_multiple</samp>&rsquo;, but store several consecutive registers
  239. into consecutive memory locations. Operand 0 is the first of the
  240. consecutive memory locations, operand 1 is the first register, and
  241. operand 2 is a constant: the number of consecutive registers.
  242. </p>
  243. <a name="index-vec_005fload_005flanesmn-instruction-pattern"></a>
  244. </dd>
  245. <dt>&lsquo;<samp>vec_load_lanes<var>m</var><var>n</var></samp>&rsquo;</dt>
  246. <dd><p>Perform an interleaved load of several vectors from memory operand 1
  247. into register operand 0. Both operands have mode <var>m</var>. The register
  248. operand is viewed as holding consecutive vectors of mode <var>n</var>,
  249. while the memory operand is a flat array that contains the same number
  250. of elements. The operation is equivalent to:
  251. </p>
  252. <div class="smallexample">
  253. <pre class="smallexample">int c = GET_MODE_SIZE (<var>m</var>) / GET_MODE_SIZE (<var>n</var>);
  254. for (j = 0; j &lt; GET_MODE_NUNITS (<var>n</var>); j++)
  255. for (i = 0; i &lt; c; i++)
  256. operand0[i][j] = operand1[j * c + i];
  257. </pre></div>
  258. <p>For example, &lsquo;<samp>vec_load_lanestiv4hi</samp>&rsquo; loads 8 16-bit values
  259. from memory into a register of mode &lsquo;<samp>TI</samp>&rsquo;. The register
  260. contains two consecutive vectors of mode &lsquo;<samp>V4HI</samp>&rsquo;.
  261. </p>
  262. <p>This pattern can only be used if:
  263. </p><div class="smallexample">
  264. <pre class="smallexample">TARGET_ARRAY_MODE_SUPPORTED_P (<var>n</var>, <var>c</var>)
  265. </pre></div>
  266. <p>is true. GCC assumes that, if a target supports this kind of
  267. instruction for some mode <var>n</var>, it also supports unaligned
  268. loads for vectors of mode <var>n</var>.
  269. </p>
  270. <p>This pattern is not allowed to <code>FAIL</code>.
  271. </p>
  272. <a name="index-vec_005fmask_005fload_005flanesmn-instruction-pattern"></a>
  273. </dd>
  274. <dt>&lsquo;<samp>vec_mask_load_lanes<var>m</var><var>n</var></samp>&rsquo;</dt>
  275. <dd><p>Like &lsquo;<samp>vec_load_lanes<var>m</var><var>n</var></samp>&rsquo;, but takes an additional
  276. mask operand (operand 2) that specifies which elements of the destination
  277. vectors should be loaded. Other elements of the destination
  278. vectors are set to zero. The operation is equivalent to:
  279. </p>
  280. <div class="smallexample">
  281. <pre class="smallexample">int c = GET_MODE_SIZE (<var>m</var>) / GET_MODE_SIZE (<var>n</var>);
  282. for (j = 0; j &lt; GET_MODE_NUNITS (<var>n</var>); j++)
  283. if (operand2[j])
  284. for (i = 0; i &lt; c; i++)
  285. operand0[i][j] = operand1[j * c + i];
  286. else
  287. for (i = 0; i &lt; c; i++)
  288. operand0[i][j] = 0;
  289. </pre></div>
  290. <p>This pattern is not allowed to <code>FAIL</code>.
  291. </p>
  292. <a name="index-vec_005fstore_005flanesmn-instruction-pattern"></a>
  293. </dd>
  294. <dt>&lsquo;<samp>vec_store_lanes<var>m</var><var>n</var></samp>&rsquo;</dt>
  295. <dd><p>Equivalent to &lsquo;<samp>vec_load_lanes<var>m</var><var>n</var></samp>&rsquo;, with the memory
  296. and register operands reversed. That is, the instruction is
  297. equivalent to:
  298. </p>
  299. <div class="smallexample">
  300. <pre class="smallexample">int c = GET_MODE_SIZE (<var>m</var>) / GET_MODE_SIZE (<var>n</var>);
  301. for (j = 0; j &lt; GET_MODE_NUNITS (<var>n</var>); j++)
  302. for (i = 0; i &lt; c; i++)
  303. operand0[j * c + i] = operand1[i][j];
  304. </pre></div>
  305. <p>for a memory operand 0 and register operand 1.
  306. </p>
  307. <p>This pattern is not allowed to <code>FAIL</code>.
  308. </p>
  309. <a name="index-vec_005fmask_005fstore_005flanesmn-instruction-pattern"></a>
  310. </dd>
  311. <dt>&lsquo;<samp>vec_mask_store_lanes<var>m</var><var>n</var></samp>&rsquo;</dt>
  312. <dd><p>Like &lsquo;<samp>vec_store_lanes<var>m</var><var>n</var></samp>&rsquo;, but takes an additional
  313. mask operand (operand 2) that specifies which elements of the source
  314. vectors should be stored. The operation is equivalent to:
  315. </p>
  316. <div class="smallexample">
  317. <pre class="smallexample">int c = GET_MODE_SIZE (<var>m</var>) / GET_MODE_SIZE (<var>n</var>);
  318. for (j = 0; j &lt; GET_MODE_NUNITS (<var>n</var>); j++)
  319. if (operand2[j])
  320. for (i = 0; i &lt; c; i++)
  321. operand0[j * c + i] = operand1[i][j];
  322. </pre></div>
  323. <p>This pattern is not allowed to <code>FAIL</code>.
  324. </p>
  325. <a name="index-gather_005floadmn-instruction-pattern"></a>
  326. </dd>
  327. <dt>&lsquo;<samp>gather_load<var>m</var><var>n</var></samp>&rsquo;</dt>
  328. <dd><p>Load several separate memory locations into a vector of mode <var>m</var>.
  329. Operand 1 is a scalar base address and operand 2 is a vector of mode <var>n</var>
  330. containing offsets from that base. Operand 0 is a destination vector with
  331. the same number of elements as <var>n</var>. For each element index <var>i</var>:
  332. </p>
  333. <ul>
  334. <li> extend the offset element <var>i</var> to address width, using zero
  335. extension if operand 3 is 1 and sign extension if operand 3 is zero;
  336. </li><li> multiply the extended offset by operand 4;
  337. </li><li> add the result to the base; and
  338. </li><li> load the value at that address into element <var>i</var> of operand 0.
  339. </li></ul>
  340. <p>The value of operand 3 does not matter if the offsets are already
  341. address width.
  342. </p>
  343. <a name="index-mask_005fgather_005floadmn-instruction-pattern"></a>
  344. </dd>
  345. <dt>&lsquo;<samp>mask_gather_load<var>m</var><var>n</var></samp>&rsquo;</dt>
  346. <dd><p>Like &lsquo;<samp>gather_load<var>m</var><var>n</var></samp>&rsquo;, but takes an extra mask operand as
  347. operand 5. Bit <var>i</var> of the mask is set if element <var>i</var>
  348. of the result should be loaded from memory and clear if element <var>i</var>
  349. of the result should be set to zero.
  350. </p>
  351. <a name="index-scatter_005fstoremn-instruction-pattern"></a>
  352. </dd>
  353. <dt>&lsquo;<samp>scatter_store<var>m</var><var>n</var></samp>&rsquo;</dt>
  354. <dd><p>Store a vector of mode <var>m</var> into several distinct memory locations.
  355. Operand 0 is a scalar base address and operand 1 is a vector of mode
  356. <var>n</var> containing offsets from that base. Operand 4 is the vector of
  357. values that should be stored, which has the same number of elements as
  358. <var>n</var>. For each element index <var>i</var>:
  359. </p>
  360. <ul>
  361. <li> extend the offset element <var>i</var> to address width, using zero
  362. extension if operand 2 is 1 and sign extension if operand 2 is zero;
  363. </li><li> multiply the extended offset by operand 3;
  364. </li><li> add the result to the base; and
  365. </li><li> store element <var>i</var> of operand 4 to that address.
  366. </li></ul>
  367. <p>The value of operand 2 does not matter if the offsets are already
  368. address width.
  369. </p>
  370. <a name="index-mask_005fscatter_005fstoremn-instruction-pattern"></a>
  371. </dd>
  372. <dt>&lsquo;<samp>mask_scatter_store<var>m</var><var>n</var></samp>&rsquo;</dt>
  373. <dd><p>Like &lsquo;<samp>scatter_store<var>m</var><var>n</var></samp>&rsquo;, but takes an extra mask operand as
  374. operand 5. Bit <var>i</var> of the mask is set if element <var>i</var>
  375. of the result should be stored to memory.
  376. </p>
  377. <a name="index-vec_005fsetm-instruction-pattern"></a>
  378. </dd>
  379. <dt>&lsquo;<samp>vec_set<var>m</var></samp>&rsquo;</dt>
  380. <dd><p>Set given field in the vector value. Operand 0 is the vector to modify,
  381. operand 1 is new value of field and operand 2 specify the field index.
  382. </p>
  383. <a name="index-vec_005fextractmn-instruction-pattern"></a>
  384. </dd>
  385. <dt>&lsquo;<samp>vec_extract<var>m</var><var>n</var></samp>&rsquo;</dt>
  386. <dd><p>Extract given field from the vector value. Operand 1 is the vector, operand 2
  387. specify field index and operand 0 place to store value into. The
  388. <var>n</var> mode is the mode of the field or vector of fields that should be
  389. extracted, should be either element mode of the vector mode <var>m</var>, or
  390. a vector mode with the same element mode and smaller number of elements.
  391. If <var>n</var> is a vector mode, the index is counted in units of that mode.
  392. </p>
  393. <a name="index-vec_005finitmn-instruction-pattern"></a>
  394. </dd>
  395. <dt>&lsquo;<samp>vec_init<var>m</var><var>n</var></samp>&rsquo;</dt>
  396. <dd><p>Initialize the vector to given values. Operand 0 is the vector to initialize
  397. and operand 1 is parallel containing values for individual fields. The
  398. <var>n</var> mode is the mode of the elements, should be either element mode of
  399. the vector mode <var>m</var>, or a vector mode with the same element mode and
  400. smaller number of elements.
  401. </p>
  402. <a name="index-vec_005fduplicatem-instruction-pattern"></a>
  403. </dd>
  404. <dt>&lsquo;<samp>vec_duplicate<var>m</var></samp>&rsquo;</dt>
  405. <dd><p>Initialize vector output operand 0 so that each element has the value given
  406. by scalar input operand 1. The vector has mode <var>m</var> and the scalar has
  407. the mode appropriate for one element of <var>m</var>.
  408. </p>
  409. <p>This pattern only handles duplicates of non-constant inputs. Constant
  410. vectors go through the <code>mov<var>m</var></code> pattern instead.
  411. </p>
  412. <p>This pattern is not allowed to <code>FAIL</code>.
  413. </p>
  414. <a name="index-vec_005fseriesm-instruction-pattern"></a>
  415. </dd>
  416. <dt>&lsquo;<samp>vec_series<var>m</var></samp>&rsquo;</dt>
  417. <dd><p>Initialize vector output operand 0 so that element <var>i</var> is equal to
  418. operand 1 plus <var>i</var> times operand 2. In other words, create a linear
  419. series whose base value is operand 1 and whose step is operand 2.
  420. </p>
  421. <p>The vector output has mode <var>m</var> and the scalar inputs have the mode
  422. appropriate for one element of <var>m</var>. This pattern is not used for
  423. floating-point vectors, in order to avoid having to specify the
  424. rounding behavior for <var>i</var> &gt; 1.
  425. </p>
  426. <p>This pattern is not allowed to <code>FAIL</code>.
  427. </p>
  428. <a name="index-while_005fultmn-instruction-pattern"></a>
  429. </dd>
  430. <dt><code>while_ult<var>m</var><var>n</var></code></dt>
  431. <dd><p>Set operand 0 to a mask that is true while incrementing operand 1
  432. gives a value that is less than operand 2. Operand 0 has mode <var>n</var>
  433. and operands 1 and 2 are scalar integers of mode <var>m</var>.
  434. The operation is equivalent to:
  435. </p>
  436. <div class="smallexample">
  437. <pre class="smallexample">operand0[0] = operand1 &lt; operand2;
  438. for (i = 1; i &lt; GET_MODE_NUNITS (<var>n</var>); i++)
  439. operand0[i] = operand0[i - 1] &amp;&amp; (operand1 + i &lt; operand2);
  440. </pre></div>
  441. <a name="index-check_005fraw_005fptrsm-instruction-pattern"></a>
  442. </dd>
  443. <dt>&lsquo;<samp>check_raw_ptrs<var>m</var></samp>&rsquo;</dt>
  444. <dd><p>Check whether, given two pointers <var>a</var> and <var>b</var> and a length <var>len</var>,
  445. a write of <var>len</var> bytes at <var>a</var> followed by a read of <var>len</var> bytes
  446. at <var>b</var> can be split into interleaved byte accesses
  447. &lsquo;<samp><var>a</var>[0], <var>b</var>[0], <var>a</var>[1], <var>b</var>[1], &hellip;</samp>&rsquo;
  448. without affecting the dependencies between the bytes. Set operand 0
  449. to true if the split is possible and false otherwise.
  450. </p>
  451. <p>Operands 1, 2 and 3 provide the values of <var>a</var>, <var>b</var> and <var>len</var>
  452. respectively. Operand 4 is a constant integer that provides the known
  453. common alignment of <var>a</var> and <var>b</var>. All inputs have mode <var>m</var>.
  454. </p>
  455. <p>This split is possible if:
  456. </p>
  457. <div class="smallexample">
  458. <pre class="smallexample"><var>a</var> == <var>b</var> || <var>a</var> + <var>len</var> &lt;= <var>b</var> || <var>b</var> + <var>len</var> &lt;= <var>a</var>
  459. </pre></div>
  460. <p>You should only define this pattern if the target has a way of accelerating
  461. the test without having to do the individual comparisons.
  462. </p>
  463. <a name="index-check_005fwar_005fptrsm-instruction-pattern"></a>
  464. </dd>
  465. <dt>&lsquo;<samp>check_war_ptrs<var>m</var></samp>&rsquo;</dt>
  466. <dd><p>Like &lsquo;<samp>check_raw_ptrs<var>m</var></samp>&rsquo;, but with the read and write swapped round.
  467. The split is possible in this case if:
  468. </p>
  469. <div class="smallexample">
  470. <pre class="smallexample"><var>b</var> &lt;= <var>a</var> || <var>a</var> + <var>len</var> &lt;= <var>b</var>
  471. </pre></div>
  472. <a name="index-vec_005fcmpmn-instruction-pattern"></a>
  473. </dd>
  474. <dt>&lsquo;<samp>vec_cmp<var>m</var><var>n</var></samp>&rsquo;</dt>
  475. <dd><p>Output a vector comparison. Operand 0 of mode <var>n</var> is the destination for
  476. predicate in operand 1 which is a signed vector comparison with operands of
  477. mode <var>m</var> in operands 2 and 3. Predicate is computed by element-wise
  478. evaluation of the vector comparison with a truth value of all-ones and a false
  479. value of all-zeros.
  480. </p>
  481. <a name="index-vec_005fcmpumn-instruction-pattern"></a>
  482. </dd>
  483. <dt>&lsquo;<samp>vec_cmpu<var>m</var><var>n</var></samp>&rsquo;</dt>
  484. <dd><p>Similar to <code>vec_cmp<var>m</var><var>n</var></code> but perform unsigned vector comparison.
  485. </p>
  486. <a name="index-vec_005fcmpeqmn-instruction-pattern"></a>
  487. </dd>
  488. <dt>&lsquo;<samp>vec_cmpeq<var>m</var><var>n</var></samp>&rsquo;</dt>
  489. <dd><p>Similar to <code>vec_cmp<var>m</var><var>n</var></code> but perform equality or non-equality
  490. vector comparison only. If <code>vec_cmp<var>m</var><var>n</var></code>
  491. or <code>vec_cmpu<var>m</var><var>n</var></code> instruction pattern is supported,
  492. it will be preferred over <code>vec_cmpeq<var>m</var><var>n</var></code>, so there is
  493. no need to define this instruction pattern if the others are supported.
  494. </p>
  495. <a name="index-vcondmn-instruction-pattern"></a>
  496. </dd>
  497. <dt>&lsquo;<samp>vcond<var>m</var><var>n</var></samp>&rsquo;</dt>
  498. <dd><p>Output a conditional vector move. Operand 0 is the destination to
  499. receive a combination of operand 1 and operand 2, which are of mode <var>m</var>,
  500. dependent on the outcome of the predicate in operand 3 which is a signed
  501. vector comparison with operands of mode <var>n</var> in operands 4 and 5. The
  502. modes <var>m</var> and <var>n</var> should have the same size. Operand 0
  503. will be set to the value <var>op1</var> &amp; <var>msk</var> | <var>op2</var> &amp; ~<var>msk</var>
  504. where <var>msk</var> is computed by element-wise evaluation of the vector
  505. comparison with a truth value of all-ones and a false value of all-zeros.
  506. </p>
  507. <a name="index-vcondumn-instruction-pattern"></a>
  508. </dd>
  509. <dt>&lsquo;<samp>vcondu<var>m</var><var>n</var></samp>&rsquo;</dt>
  510. <dd><p>Similar to <code>vcond<var>m</var><var>n</var></code> but performs unsigned vector
  511. comparison.
  512. </p>
  513. <a name="index-vcondeqmn-instruction-pattern"></a>
  514. </dd>
  515. <dt>&lsquo;<samp>vcondeq<var>m</var><var>n</var></samp>&rsquo;</dt>
  516. <dd><p>Similar to <code>vcond<var>m</var><var>n</var></code> but performs equality or
  517. non-equality vector comparison only. If <code>vcond<var>m</var><var>n</var></code>
  518. or <code>vcondu<var>m</var><var>n</var></code> instruction pattern is supported,
  519. it will be preferred over <code>vcondeq<var>m</var><var>n</var></code>, so there is
  520. no need to define this instruction pattern if the others are supported.
  521. </p>
  522. <a name="index-vcond_005fmask_005fmn-instruction-pattern"></a>
  523. </dd>
  524. <dt>&lsquo;<samp>vcond_mask_<var>m</var><var>n</var></samp>&rsquo;</dt>
  525. <dd><p>Similar to <code>vcond<var>m</var><var>n</var></code> but operand 3 holds a pre-computed
  526. result of vector comparison.
  527. </p>
  528. <a name="index-maskloadmn-instruction-pattern"></a>
  529. </dd>
  530. <dt>&lsquo;<samp>maskload<var>m</var><var>n</var></samp>&rsquo;</dt>
  531. <dd><p>Perform a masked load of vector from memory operand 1 of mode <var>m</var>
  532. into register operand 0. Mask is provided in register operand 2 of
  533. mode <var>n</var>.
  534. </p>
  535. <p>This pattern is not allowed to <code>FAIL</code>.
  536. </p>
  537. <a name="index-maskstoremn-instruction-pattern"></a>
  538. </dd>
  539. <dt>&lsquo;<samp>maskstore<var>m</var><var>n</var></samp>&rsquo;</dt>
  540. <dd><p>Perform a masked store of vector from register operand 1 of mode <var>m</var>
  541. into memory operand 0. Mask is provided in register operand 2 of
  542. mode <var>n</var>.
  543. </p>
  544. <p>This pattern is not allowed to <code>FAIL</code>.
  545. </p>
  546. <a name="index-vec_005fpermm-instruction-pattern"></a>
  547. </dd>
  548. <dt>&lsquo;<samp>vec_perm<var>m</var></samp>&rsquo;</dt>
  549. <dd><p>Output a (variable) vector permutation. Operand 0 is the destination
  550. to receive elements from operand 1 and operand 2, which are of mode
  551. <var>m</var>. Operand 3 is the <em>selector</em>. It is an integral mode
  552. vector of the same width and number of elements as mode <var>m</var>.
  553. </p>
  554. <p>The input elements are numbered from 0 in operand 1 through
  555. <em>2*<var>N</var>-1</em> in operand 2. The elements of the selector must
  556. be computed modulo <em>2*<var>N</var></em>. Note that if
  557. <code>rtx_equal_p(operand1, operand2)</code>, this can be implemented
  558. with just operand 1 and selector elements modulo <var>N</var>.
  559. </p>
  560. <p>In order to make things easy for a number of targets, if there is no
  561. &lsquo;<samp>vec_perm</samp>&rsquo; pattern for mode <var>m</var>, but there is for mode <var>q</var>
  562. where <var>q</var> is a vector of <code>QImode</code> of the same width as <var>m</var>,
  563. the middle-end will lower the mode <var>m</var> <code>VEC_PERM_EXPR</code> to
  564. mode <var>q</var>.
  565. </p>
  566. <p>See also <code>TARGET_VECTORIZER_VEC_PERM_CONST</code>, which performs
  567. the analogous operation for constant selectors.
  568. </p>
  569. <a name="index-pushm1-instruction-pattern"></a>
  570. </dd>
  571. <dt>&lsquo;<samp>push<var>m</var>1</samp>&rsquo;</dt>
  572. <dd><p>Output a push instruction. Operand 0 is value to push. Used only when
  573. <code>PUSH_ROUNDING</code> is defined. For historical reason, this pattern may be
  574. missing and in such case an <code>mov</code> expander is used instead, with a
  575. <code>MEM</code> expression forming the push operation. The <code>mov</code> expander
  576. method is deprecated.
  577. </p>
  578. <a name="index-addm3-instruction-pattern"></a>
  579. </dd>
  580. <dt>&lsquo;<samp>add<var>m</var>3</samp>&rsquo;</dt>
  581. <dd><p>Add operand 2 and operand 1, storing the result in operand 0. All operands
  582. must have mode <var>m</var>. This can be used even on two-address machines, by
  583. means of constraints requiring operands 1 and 0 to be the same location.
  584. </p>
  585. <a name="index-ssaddm3-instruction-pattern"></a>
  586. <a name="index-usaddm3-instruction-pattern"></a>
  587. <a name="index-subm3-instruction-pattern"></a>
  588. <a name="index-sssubm3-instruction-pattern"></a>
  589. <a name="index-ussubm3-instruction-pattern"></a>
  590. <a name="index-mulm3-instruction-pattern"></a>
  591. <a name="index-ssmulm3-instruction-pattern"></a>
  592. <a name="index-usmulm3-instruction-pattern"></a>
  593. <a name="index-divm3-instruction-pattern"></a>
  594. <a name="index-ssdivm3-instruction-pattern"></a>
  595. <a name="index-udivm3-instruction-pattern"></a>
  596. <a name="index-usdivm3-instruction-pattern"></a>
  597. <a name="index-modm3-instruction-pattern"></a>
  598. <a name="index-umodm3-instruction-pattern"></a>
  599. <a name="index-uminm3-instruction-pattern"></a>
  600. <a name="index-umaxm3-instruction-pattern"></a>
  601. <a name="index-andm3-instruction-pattern"></a>
  602. <a name="index-iorm3-instruction-pattern"></a>
  603. <a name="index-xorm3-instruction-pattern"></a>
  604. </dd>
  605. <dt>&lsquo;<samp>ssadd<var>m</var>3</samp>&rsquo;, &lsquo;<samp>usadd<var>m</var>3</samp>&rsquo;</dt>
  606. <dt>&lsquo;<samp>sub<var>m</var>3</samp>&rsquo;, &lsquo;<samp>sssub<var>m</var>3</samp>&rsquo;, &lsquo;<samp>ussub<var>m</var>3</samp>&rsquo;</dt>
  607. <dt>&lsquo;<samp>mul<var>m</var>3</samp>&rsquo;, &lsquo;<samp>ssmul<var>m</var>3</samp>&rsquo;, &lsquo;<samp>usmul<var>m</var>3</samp>&rsquo;</dt>
  608. <dt>&lsquo;<samp>div<var>m</var>3</samp>&rsquo;, &lsquo;<samp>ssdiv<var>m</var>3</samp>&rsquo;</dt>
  609. <dt>&lsquo;<samp>udiv<var>m</var>3</samp>&rsquo;, &lsquo;<samp>usdiv<var>m</var>3</samp>&rsquo;</dt>
  610. <dt>&lsquo;<samp>mod<var>m</var>3</samp>&rsquo;, &lsquo;<samp>umod<var>m</var>3</samp>&rsquo;</dt>
  611. <dt>&lsquo;<samp>umin<var>m</var>3</samp>&rsquo;, &lsquo;<samp>umax<var>m</var>3</samp>&rsquo;</dt>
  612. <dt>&lsquo;<samp>and<var>m</var>3</samp>&rsquo;, &lsquo;<samp>ior<var>m</var>3</samp>&rsquo;, &lsquo;<samp>xor<var>m</var>3</samp>&rsquo;</dt>
  613. <dd><p>Similar, for other arithmetic operations.
  614. </p>
  615. <a name="index-addvm4-instruction-pattern"></a>
  616. </dd>
  617. <dt>&lsquo;<samp>addv<var>m</var>4</samp>&rsquo;</dt>
  618. <dd><p>Like <code>add<var>m</var>3</code> but takes a <code>code_label</code> as operand 3 and
  619. emits code to jump to it if signed overflow occurs during the addition.
  620. This pattern is used to implement the built-in functions performing
  621. signed integer addition with overflow checking.
  622. </p>
  623. <a name="index-subvm4-instruction-pattern"></a>
  624. <a name="index-mulvm4-instruction-pattern"></a>
  625. </dd>
  626. <dt>&lsquo;<samp>subv<var>m</var>4</samp>&rsquo;, &lsquo;<samp>mulv<var>m</var>4</samp>&rsquo;</dt>
  627. <dd><p>Similar, for other signed arithmetic operations.
  628. </p>
  629. <a name="index-uaddvm4-instruction-pattern"></a>
  630. </dd>
  631. <dt>&lsquo;<samp>uaddv<var>m</var>4</samp>&rsquo;</dt>
  632. <dd><p>Like <code>addv<var>m</var>4</code> but for unsigned addition. That is to
  633. say, the operation is the same as signed addition but the jump
  634. is taken only on unsigned overflow.
  635. </p>
  636. <a name="index-usubvm4-instruction-pattern"></a>
  637. <a name="index-umulvm4-instruction-pattern"></a>
  638. </dd>
  639. <dt>&lsquo;<samp>usubv<var>m</var>4</samp>&rsquo;, &lsquo;<samp>umulv<var>m</var>4</samp>&rsquo;</dt>
  640. <dd><p>Similar, for other unsigned arithmetic operations.
  641. </p>
  642. <a name="index-addptrm3-instruction-pattern"></a>
  643. </dd>
  644. <dt>&lsquo;<samp>addptr<var>m</var>3</samp>&rsquo;</dt>
  645. <dd><p>Like <code>add<var>m</var>3</code> but is guaranteed to only be used for address
  646. calculations. The expanded code is not allowed to clobber the
  647. condition code. It only needs to be defined if <code>add<var>m</var>3</code>
  648. sets the condition code. If adds used for address calculations and
  649. normal adds are not compatible it is required to expand a distinct
  650. pattern (e.g. using an unspec). The pattern is used by LRA to emit
  651. address calculations. <code>add<var>m</var>3</code> is used if
  652. <code>addptr<var>m</var>3</code> is not defined.
  653. </p>
  654. <a name="index-fmam4-instruction-pattern"></a>
  655. </dd>
  656. <dt>&lsquo;<samp>fma<var>m</var>4</samp>&rsquo;</dt>
  657. <dd><p>Multiply operand 2 and operand 1, then add operand 3, storing the
  658. result in operand 0 without doing an intermediate rounding step. All
  659. operands must have mode <var>m</var>. This pattern is used to implement
  660. the <code>fma</code>, <code>fmaf</code>, and <code>fmal</code> builtin functions from
  661. the ISO C99 standard.
  662. </p>
  663. <a name="index-fmsm4-instruction-pattern"></a>
  664. </dd>
  665. <dt>&lsquo;<samp>fms<var>m</var>4</samp>&rsquo;</dt>
  666. <dd><p>Like <code>fma<var>m</var>4</code>, except operand 3 subtracted from the
  667. product instead of added to the product. This is represented
  668. in the rtl as
  669. </p>
  670. <div class="smallexample">
  671. <pre class="smallexample">(fma:<var>m</var> <var>op1</var> <var>op2</var> (neg:<var>m</var> <var>op3</var>))
  672. </pre></div>
  673. <a name="index-fnmam4-instruction-pattern"></a>
  674. </dd>
  675. <dt>&lsquo;<samp>fnma<var>m</var>4</samp>&rsquo;</dt>
  676. <dd><p>Like <code>fma<var>m</var>4</code> except that the intermediate product
  677. is negated before being added to operand 3. This is represented
  678. in the rtl as
  679. </p>
  680. <div class="smallexample">
  681. <pre class="smallexample">(fma:<var>m</var> (neg:<var>m</var> <var>op1</var>) <var>op2</var> <var>op3</var>)
  682. </pre></div>
  683. <a name="index-fnmsm4-instruction-pattern"></a>
  684. </dd>
  685. <dt>&lsquo;<samp>fnms<var>m</var>4</samp>&rsquo;</dt>
  686. <dd><p>Like <code>fms<var>m</var>4</code> except that the intermediate product
  687. is negated before subtracting operand 3. This is represented
  688. in the rtl as
  689. </p>
  690. <div class="smallexample">
  691. <pre class="smallexample">(fma:<var>m</var> (neg:<var>m</var> <var>op1</var>) <var>op2</var> (neg:<var>m</var> <var>op3</var>))
  692. </pre></div>
  693. <a name="index-minm3-instruction-pattern"></a>
  694. <a name="index-maxm3-instruction-pattern"></a>
  695. </dd>
  696. <dt>&lsquo;<samp>smin<var>m</var>3</samp>&rsquo;, &lsquo;<samp>smax<var>m</var>3</samp>&rsquo;</dt>
  697. <dd><p>Signed minimum and maximum operations. When used with floating point,
  698. if both operands are zeros, or if either operand is <code>NaN</code>, then
  699. it is unspecified which of the two operands is returned as the result.
  700. </p>
  701. <a name="index-fminm3-instruction-pattern"></a>
  702. <a name="index-fmaxm3-instruction-pattern"></a>
  703. </dd>
  704. <dt>&lsquo;<samp>fmin<var>m</var>3</samp>&rsquo;, &lsquo;<samp>fmax<var>m</var>3</samp>&rsquo;</dt>
  705. <dd><p>IEEE-conformant minimum and maximum operations. If one operand is a quiet
  706. <code>NaN</code>, then the other operand is returned. If both operands are quiet
  707. <code>NaN</code>, then a quiet <code>NaN</code> is returned. In the case when gcc supports
  708. signaling <code>NaN</code> (-fsignaling-nans) an invalid floating point exception is
  709. raised and a quiet <code>NaN</code> is returned.
  710. </p>
  711. <p>All operands have mode <var>m</var>, which is a scalar or vector
  712. floating-point mode. These patterns are not allowed to <code>FAIL</code>.
  713. </p>
  714. <a name="index-reduc_005fsmin_005fscal_005fm-instruction-pattern"></a>
  715. <a name="index-reduc_005fsmax_005fscal_005fm-instruction-pattern"></a>
  716. </dd>
  717. <dt>&lsquo;<samp>reduc_smin_scal_<var>m</var></samp>&rsquo;, &lsquo;<samp>reduc_smax_scal_<var>m</var></samp>&rsquo;</dt>
  718. <dd><p>Find the signed minimum/maximum of the elements of a vector. The vector is
  719. operand 1, and operand 0 is the scalar result, with mode equal to the mode of
  720. the elements of the input vector.
  721. </p>
  722. <a name="index-reduc_005fumin_005fscal_005fm-instruction-pattern"></a>
  723. <a name="index-reduc_005fumax_005fscal_005fm-instruction-pattern"></a>
  724. </dd>
  725. <dt>&lsquo;<samp>reduc_umin_scal_<var>m</var></samp>&rsquo;, &lsquo;<samp>reduc_umax_scal_<var>m</var></samp>&rsquo;</dt>
  726. <dd><p>Find the unsigned minimum/maximum of the elements of a vector. The vector is
  727. operand 1, and operand 0 is the scalar result, with mode equal to the mode of
  728. the elements of the input vector.
  729. </p>
  730. <a name="index-reduc_005fplus_005fscal_005fm-instruction-pattern"></a>
  731. </dd>
  732. <dt>&lsquo;<samp>reduc_plus_scal_<var>m</var></samp>&rsquo;</dt>
  733. <dd><p>Compute the sum of the elements of a vector. The vector is operand 1, and
  734. operand 0 is the scalar result, with mode equal to the mode of the elements of
  735. the input vector.
  736. </p>
  737. <a name="index-reduc_005fand_005fscal_005fm-instruction-pattern"></a>
  738. </dd>
  739. <dt>&lsquo;<samp>reduc_and_scal_<var>m</var></samp>&rsquo;</dt>
  740. <dd><a name="index-reduc_005fior_005fscal_005fm-instruction-pattern"></a>
  741. </dd>
  742. <dt>&lsquo;<samp>reduc_ior_scal_<var>m</var></samp>&rsquo;</dt>
  743. <dd><a name="index-reduc_005fxor_005fscal_005fm-instruction-pattern"></a>
  744. </dd>
  745. <dt>&lsquo;<samp>reduc_xor_scal_<var>m</var></samp>&rsquo;</dt>
  746. <dd><p>Compute the bitwise <code>AND</code>/<code>IOR</code>/<code>XOR</code> reduction of the elements
  747. of a vector of mode <var>m</var>. Operand 1 is the vector input and operand 0
  748. is the scalar result. The mode of the scalar result is the same as one
  749. element of <var>m</var>.
  750. </p>
  751. <a name="index-extract_005flast_005fm-instruction-pattern"></a>
  752. </dd>
  753. <dt><code>extract_last_<var>m</var></code></dt>
  754. <dd><p>Find the last set bit in mask operand 1 and extract the associated element
  755. of vector operand 2. Store the result in scalar operand 0. Operand 2
  756. has vector mode <var>m</var> while operand 0 has the mode appropriate for one
  757. element of <var>m</var>. Operand 1 has the usual mask mode for vectors of mode
  758. <var>m</var>; see <code>TARGET_VECTORIZE_GET_MASK_MODE</code>.
  759. </p>
  760. <a name="index-fold_005fextract_005flast_005fm-instruction-pattern"></a>
  761. </dd>
  762. <dt><code>fold_extract_last_<var>m</var></code></dt>
  763. <dd><p>If any bits of mask operand 2 are set, find the last set bit, extract
  764. the associated element from vector operand 3, and store the result
  765. in operand 0. Store operand 1 in operand 0 otherwise. Operand 3
  766. has mode <var>m</var> and operands 0 and 1 have the mode appropriate for
  767. one element of <var>m</var>. Operand 2 has the usual mask mode for vectors
  768. of mode <var>m</var>; see <code>TARGET_VECTORIZE_GET_MASK_MODE</code>.
  769. </p>
  770. <a name="index-fold_005fleft_005fplus_005fm-instruction-pattern"></a>
  771. </dd>
  772. <dt><code>fold_left_plus_<var>m</var></code></dt>
  773. <dd><p>Take scalar operand 1 and successively add each element from vector
  774. operand 2. Store the result in scalar operand 0. The vector has
  775. mode <var>m</var> and the scalars have the mode appropriate for one
  776. element of <var>m</var>. The operation is strictly in-order: there is
  777. no reassociation.
  778. </p>
  779. <a name="index-mask_005ffold_005fleft_005fplus_005fm-instruction-pattern"></a>
  780. </dd>
  781. <dt><code>mask_fold_left_plus_<var>m</var></code></dt>
  782. <dd><p>Like &lsquo;<samp>fold_left_plus_<var>m</var></samp>&rsquo;, but takes an additional mask operand
  783. (operand 3) that specifies which elements of the source vector should be added.
  784. </p>
  785. <a name="index-sdot_005fprodm-instruction-pattern"></a>
  786. </dd>
  787. <dt>&lsquo;<samp>sdot_prod<var>m</var></samp>&rsquo;</dt>
  788. <dd><a name="index-udot_005fprodm-instruction-pattern"></a>
  789. </dd>
  790. <dt>&lsquo;<samp>udot_prod<var>m</var></samp>&rsquo;</dt>
  791. <dd><p>Compute the sum of the products of two signed/unsigned elements.
  792. Operand 1 and operand 2 are of the same mode. Their product, which is of a
  793. wider mode, is computed and added to operand 3. Operand 3 is of a mode equal or
  794. wider than the mode of the product. The result is placed in operand 0, which
  795. is of the same mode as operand 3.
  796. </p>
  797. <a name="index-ssadm-instruction-pattern"></a>
  798. </dd>
  799. <dt>&lsquo;<samp>ssad<var>m</var></samp>&rsquo;</dt>
  800. <dd><a name="index-usadm-instruction-pattern"></a>
  801. </dd>
  802. <dt>&lsquo;<samp>usad<var>m</var></samp>&rsquo;</dt>
  803. <dd><p>Compute the sum of absolute differences of two signed/unsigned elements.
  804. Operand 1 and operand 2 are of the same mode. Their absolute difference, which
  805. is of a wider mode, is computed and added to operand 3. Operand 3 is of a mode
  806. equal or wider than the mode of the absolute difference. The result is placed
  807. in operand 0, which is of the same mode as operand 3.
  808. </p>
  809. <a name="index-widen_005fssumm3-instruction-pattern"></a>
  810. </dd>
  811. <dt>&lsquo;<samp>widen_ssum<var>m3</var></samp>&rsquo;</dt>
  812. <dd><a name="index-widen_005fusumm3-instruction-pattern"></a>
  813. </dd>
  814. <dt>&lsquo;<samp>widen_usum<var>m3</var></samp>&rsquo;</dt>
  815. <dd><p>Operands 0 and 2 are of the same mode, which is wider than the mode of
  816. operand 1. Add operand 1 to operand 2 and place the widened result in
  817. operand 0. (This is used express accumulation of elements into an accumulator
  818. of a wider mode.)
  819. </p>
  820. <a name="index-smulhsm3-instruction-pattern"></a>
  821. </dd>
  822. <dt>&lsquo;<samp>smulhs<var>m3</var></samp>&rsquo;</dt>
  823. <dd><a name="index-umulhsm3-instruction-pattern"></a>
  824. </dd>
  825. <dt>&lsquo;<samp>umulhs<var>m3</var></samp>&rsquo;</dt>
  826. <dd><p>Signed/unsigned multiply high with scale. This is equivalent to the C code:
  827. </p><div class="smallexample">
  828. <pre class="smallexample">narrow op0, op1, op2;
  829. &hellip;
  830. op0 = (narrow) (((wide) op1 * (wide) op2) &gt;&gt; (N / 2 - 1));
  831. </pre></div>
  832. <p>where the sign of &lsquo;<samp>narrow</samp>&rsquo; determines whether this is a signed
  833. or unsigned operation, and <var>N</var> is the size of &lsquo;<samp>wide</samp>&rsquo; in bits.
  834. </p>
  835. <a name="index-smulhrsm3-instruction-pattern"></a>
  836. </dd>
  837. <dt>&lsquo;<samp>smulhrs<var>m3</var></samp>&rsquo;</dt>
  838. <dd><a name="index-umulhrsm3-instruction-pattern"></a>
  839. </dd>
  840. <dt>&lsquo;<samp>umulhrs<var>m3</var></samp>&rsquo;</dt>
  841. <dd><p>Signed/unsigned multiply high with round and scale. This is
  842. equivalent to the C code:
  843. </p><div class="smallexample">
  844. <pre class="smallexample">narrow op0, op1, op2;
  845. &hellip;
  846. op0 = (narrow) (((((wide) op1 * (wide) op2) &gt;&gt; (N / 2 - 2)) + 1) &gt;&gt; 1);
  847. </pre></div>
  848. <p>where the sign of &lsquo;<samp>narrow</samp>&rsquo; determines whether this is a signed
  849. or unsigned operation, and <var>N</var> is the size of &lsquo;<samp>wide</samp>&rsquo; in bits.
  850. </p>
  851. <a name="index-sdiv_005fpow2m3-instruction-pattern"></a>
  852. </dd>
  853. <dt>&lsquo;<samp>sdiv_pow2<var>m3</var></samp>&rsquo;</dt>
  854. <dd><a name="index-sdiv_005fpow2m3-instruction-pattern-1"></a>
  855. </dd>
  856. <dt>&lsquo;<samp>sdiv_pow2<var>m3</var></samp>&rsquo;</dt>
  857. <dd><p>Signed division by power-of-2 immediate. Equivalent to:
  858. </p><div class="smallexample">
  859. <pre class="smallexample">signed op0, op1;
  860. &hellip;
  861. op0 = op1 / (1 &lt;&lt; imm);
  862. </pre></div>
  863. <a name="index-vec_005fshl_005finsert_005fm-instruction-pattern"></a>
  864. </dd>
  865. <dt>&lsquo;<samp>vec_shl_insert_<var>m</var></samp>&rsquo;</dt>
  866. <dd><p>Shift the elements in vector input operand 1 left one element (i.e.
  867. away from element 0) and fill the vacated element 0 with the scalar
  868. in operand 2. Store the result in vector output operand 0. Operands
  869. 0 and 1 have mode <var>m</var> and operand 2 has the mode appropriate for
  870. one element of <var>m</var>.
  871. </p>
  872. <a name="index-vec_005fshl_005fm-instruction-pattern"></a>
  873. </dd>
  874. <dt>&lsquo;<samp>vec_shl_<var>m</var></samp>&rsquo;</dt>
  875. <dd><p>Whole vector left shift in bits, i.e. away from element 0.
  876. Operand 1 is a vector to be shifted.
  877. Operand 2 is an integer shift amount in bits.
  878. Operand 0 is where the resulting shifted vector is stored.
  879. The output and input vectors should have the same modes.
  880. </p>
  881. <a name="index-vec_005fshr_005fm-instruction-pattern"></a>
  882. </dd>
  883. <dt>&lsquo;<samp>vec_shr_<var>m</var></samp>&rsquo;</dt>
  884. <dd><p>Whole vector right shift in bits, i.e. towards element 0.
  885. Operand 1 is a vector to be shifted.
  886. Operand 2 is an integer shift amount in bits.
  887. Operand 0 is where the resulting shifted vector is stored.
  888. The output and input vectors should have the same modes.
  889. </p>
  890. <a name="index-vec_005fpack_005ftrunc_005fm-instruction-pattern"></a>
  891. </dd>
  892. <dt>&lsquo;<samp>vec_pack_trunc_<var>m</var></samp>&rsquo;</dt>
  893. <dd><p>Narrow (demote) and merge the elements of two vectors. Operands 1 and 2
  894. are vectors of the same mode having N integral or floating point elements
  895. of size S. Operand 0 is the resulting vector in which 2*N elements of
  896. size S/2 are concatenated after narrowing them down using truncation.
  897. </p>
  898. <a name="index-vec_005fpack_005fsbool_005ftrunc_005fm-instruction-pattern"></a>
  899. </dd>
  900. <dt>&lsquo;<samp>vec_pack_sbool_trunc_<var>m</var></samp>&rsquo;</dt>
  901. <dd><p>Narrow and merge the elements of two vectors. Operands 1 and 2 are vectors
  902. of the same type having N boolean elements. Operand 0 is the resulting
  903. vector in which 2*N elements are concatenated. The last operand (operand 3)
  904. is the number of elements in the output vector 2*N as a <code>CONST_INT</code>.
  905. This instruction pattern is used when all the vector input and output
  906. operands have the same scalar mode <var>m</var> and thus using
  907. <code>vec_pack_trunc_<var>m</var></code> would be ambiguous.
  908. </p>
  909. <a name="index-vec_005fpack_005fssat_005fm-instruction-pattern"></a>
  910. <a name="index-vec_005fpack_005fusat_005fm-instruction-pattern"></a>
  911. </dd>
  912. <dt>&lsquo;<samp>vec_pack_ssat_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_pack_usat_<var>m</var></samp>&rsquo;</dt>
  913. <dd><p>Narrow (demote) and merge the elements of two vectors. Operands 1 and 2
  914. are vectors of the same mode having N integral elements of size S.
  915. Operand 0 is the resulting vector in which the elements of the two input
  916. vectors are concatenated after narrowing them down using signed/unsigned
  917. saturating arithmetic.
  918. </p>
  919. <a name="index-vec_005fpack_005fsfix_005ftrunc_005fm-instruction-pattern"></a>
  920. <a name="index-vec_005fpack_005fufix_005ftrunc_005fm-instruction-pattern"></a>
  921. </dd>
  922. <dt>&lsquo;<samp>vec_pack_sfix_trunc_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_pack_ufix_trunc_<var>m</var></samp>&rsquo;</dt>
  923. <dd><p>Narrow, convert to signed/unsigned integral type and merge the elements
  924. of two vectors. Operands 1 and 2 are vectors of the same mode having N
  925. floating point elements of size S. Operand 0 is the resulting vector
  926. in which 2*N elements of size S/2 are concatenated.
  927. </p>
  928. <a name="index-vec_005fpacks_005ffloat_005fm-instruction-pattern"></a>
  929. <a name="index-vec_005fpacku_005ffloat_005fm-instruction-pattern"></a>
  930. </dd>
  931. <dt>&lsquo;<samp>vec_packs_float_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_packu_float_<var>m</var></samp>&rsquo;</dt>
  932. <dd><p>Narrow, convert to floating point type and merge the elements
  933. of two vectors. Operands 1 and 2 are vectors of the same mode having N
  934. signed/unsigned integral elements of size S. Operand 0 is the resulting vector
  935. in which 2*N elements of size S/2 are concatenated.
  936. </p>
  937. <a name="index-vec_005funpacks_005fhi_005fm-instruction-pattern"></a>
  938. <a name="index-vec_005funpacks_005flo_005fm-instruction-pattern"></a>
  939. </dd>
  940. <dt>&lsquo;<samp>vec_unpacks_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_unpacks_lo_<var>m</var></samp>&rsquo;</dt>
  941. <dd><p>Extract and widen (promote) the high/low part of a vector of signed
  942. integral or floating point elements. The input vector (operand 1) has N
  943. elements of size S. Widen (promote) the high/low elements of the vector
  944. using signed or floating point extension and place the resulting N/2
  945. values of size 2*S in the output vector (operand 0).
  946. </p>
  947. <a name="index-vec_005funpacku_005fhi_005fm-instruction-pattern"></a>
  948. <a name="index-vec_005funpacku_005flo_005fm-instruction-pattern"></a>
  949. </dd>
  950. <dt>&lsquo;<samp>vec_unpacku_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_unpacku_lo_<var>m</var></samp>&rsquo;</dt>
  951. <dd><p>Extract and widen (promote) the high/low part of a vector of unsigned
  952. integral elements. The input vector (operand 1) has N elements of size S.
  953. Widen (promote) the high/low elements of the vector using zero extension and
  954. place the resulting N/2 values of size 2*S in the output vector (operand 0).
  955. </p>
  956. <a name="index-vec_005funpacks_005fsbool_005fhi_005fm-instruction-pattern"></a>
  957. <a name="index-vec_005funpacks_005fsbool_005flo_005fm-instruction-pattern"></a>
  958. </dd>
  959. <dt>&lsquo;<samp>vec_unpacks_sbool_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_unpacks_sbool_lo_<var>m</var></samp>&rsquo;</dt>
  960. <dd><p>Extract the high/low part of a vector of boolean elements that have scalar
  961. mode <var>m</var>. The input vector (operand 1) has N elements, the output
  962. vector (operand 0) has N/2 elements. The last operand (operand 2) is the
  963. number of elements of the input vector N as a <code>CONST_INT</code>. These
  964. patterns are used if both the input and output vectors have the same scalar
  965. mode <var>m</var> and thus using <code>vec_unpacks_hi_<var>m</var></code> or
  966. <code>vec_unpacks_lo_<var>m</var></code> would be ambiguous.
  967. </p>
  968. <a name="index-vec_005funpacks_005ffloat_005fhi_005fm-instruction-pattern"></a>
  969. <a name="index-vec_005funpacks_005ffloat_005flo_005fm-instruction-pattern"></a>
  970. <a name="index-vec_005funpacku_005ffloat_005fhi_005fm-instruction-pattern"></a>
  971. <a name="index-vec_005funpacku_005ffloat_005flo_005fm-instruction-pattern"></a>
  972. </dd>
  973. <dt>&lsquo;<samp>vec_unpacks_float_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_unpacks_float_lo_<var>m</var></samp>&rsquo;</dt>
  974. <dt>&lsquo;<samp>vec_unpacku_float_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_unpacku_float_lo_<var>m</var></samp>&rsquo;</dt>
  975. <dd><p>Extract, convert to floating point type and widen the high/low part of a
  976. vector of signed/unsigned integral elements. The input vector (operand 1)
  977. has N elements of size S. Convert the high/low elements of the vector using
  978. floating point conversion and place the resulting N/2 values of size 2*S in
  979. the output vector (operand 0).
  980. </p>
  981. <a name="index-vec_005funpack_005fsfix_005ftrunc_005fhi_005fm-instruction-pattern"></a>
  982. <a name="index-vec_005funpack_005fsfix_005ftrunc_005flo_005fm-instruction-pattern"></a>
  983. <a name="index-vec_005funpack_005fufix_005ftrunc_005fhi_005fm-instruction-pattern"></a>
  984. <a name="index-vec_005funpack_005fufix_005ftrunc_005flo_005fm-instruction-pattern"></a>
  985. </dd>
  986. <dt>&lsquo;<samp>vec_unpack_sfix_trunc_hi_<var>m</var></samp>&rsquo;,</dt>
  987. <dt>&lsquo;<samp>vec_unpack_sfix_trunc_lo_<var>m</var></samp>&rsquo;</dt>
  988. <dt>&lsquo;<samp>vec_unpack_ufix_trunc_hi_<var>m</var></samp>&rsquo;</dt>
  989. <dt>&lsquo;<samp>vec_unpack_ufix_trunc_lo_<var>m</var></samp>&rsquo;</dt>
  990. <dd><p>Extract, convert to signed/unsigned integer type and widen the high/low part of a
  991. vector of floating point elements. The input vector (operand 1)
  992. has N elements of size S. Convert the high/low elements of the vector
  993. to integers and place the resulting N/2 values of size 2*S in
  994. the output vector (operand 0).
  995. </p>
  996. <a name="index-vec_005fwiden_005fumult_005fhi_005fm-instruction-pattern"></a>
  997. <a name="index-vec_005fwiden_005fumult_005flo_005fm-instruction-pattern"></a>
  998. <a name="index-vec_005fwiden_005fsmult_005fhi_005fm-instruction-pattern"></a>
  999. <a name="index-vec_005fwiden_005fsmult_005flo_005fm-instruction-pattern"></a>
  1000. <a name="index-vec_005fwiden_005fumult_005feven_005fm-instruction-pattern"></a>
  1001. <a name="index-vec_005fwiden_005fumult_005fodd_005fm-instruction-pattern"></a>
  1002. <a name="index-vec_005fwiden_005fsmult_005feven_005fm-instruction-pattern"></a>
  1003. <a name="index-vec_005fwiden_005fsmult_005fodd_005fm-instruction-pattern"></a>
  1004. </dd>
  1005. <dt>&lsquo;<samp>vec_widen_umult_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_widen_umult_lo_<var>m</var></samp>&rsquo;</dt>
  1006. <dt>&lsquo;<samp>vec_widen_smult_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_widen_smult_lo_<var>m</var></samp>&rsquo;</dt>
  1007. <dt>&lsquo;<samp>vec_widen_umult_even_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_widen_umult_odd_<var>m</var></samp>&rsquo;</dt>
  1008. <dt>&lsquo;<samp>vec_widen_smult_even_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_widen_smult_odd_<var>m</var></samp>&rsquo;</dt>
  1009. <dd><p>Signed/Unsigned widening multiplication. The two inputs (operands 1 and 2)
  1010. are vectors with N signed/unsigned elements of size S. Multiply the high/low
  1011. or even/odd elements of the two vectors, and put the N/2 products of size 2*S
  1012. in the output vector (operand 0). A target shouldn&rsquo;t implement even/odd pattern
  1013. pair if it is less efficient than lo/hi one.
  1014. </p>
  1015. <a name="index-vec_005fwiden_005fushiftl_005fhi_005fm-instruction-pattern"></a>
  1016. <a name="index-vec_005fwiden_005fushiftl_005flo_005fm-instruction-pattern"></a>
  1017. <a name="index-vec_005fwiden_005fsshiftl_005fhi_005fm-instruction-pattern"></a>
  1018. <a name="index-vec_005fwiden_005fsshiftl_005flo_005fm-instruction-pattern"></a>
  1019. </dd>
  1020. <dt>&lsquo;<samp>vec_widen_ushiftl_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_widen_ushiftl_lo_<var>m</var></samp>&rsquo;</dt>
  1021. <dt>&lsquo;<samp>vec_widen_sshiftl_hi_<var>m</var></samp>&rsquo;, &lsquo;<samp>vec_widen_sshiftl_lo_<var>m</var></samp>&rsquo;</dt>
  1022. <dd><p>Signed/Unsigned widening shift left. The first input (operand 1) is a vector
  1023. with N signed/unsigned elements of size S. Operand 2 is a constant. Shift
  1024. the high/low elements of operand 1, and put the N/2 results of size 2*S in the
  1025. output vector (operand 0).
  1026. </p>
  1027. <a name="index-mulhisi3-instruction-pattern"></a>
  1028. </dd>
  1029. <dt>&lsquo;<samp>mulhisi3</samp>&rsquo;</dt>
  1030. <dd><p>Multiply operands 1 and 2, which have mode <code>HImode</code>, and store
  1031. a <code>SImode</code> product in operand 0.
  1032. </p>
  1033. <a name="index-mulqihi3-instruction-pattern"></a>
  1034. <a name="index-mulsidi3-instruction-pattern"></a>
  1035. </dd>
  1036. <dt>&lsquo;<samp>mulqihi3</samp>&rsquo;, &lsquo;<samp>mulsidi3</samp>&rsquo;</dt>
  1037. <dd><p>Similar widening-multiplication instructions of other widths.
  1038. </p>
  1039. <a name="index-umulqihi3-instruction-pattern"></a>
  1040. <a name="index-umulhisi3-instruction-pattern"></a>
  1041. <a name="index-umulsidi3-instruction-pattern"></a>
  1042. </dd>
  1043. <dt>&lsquo;<samp>umulqihi3</samp>&rsquo;, &lsquo;<samp>umulhisi3</samp>&rsquo;, &lsquo;<samp>umulsidi3</samp>&rsquo;</dt>
  1044. <dd><p>Similar widening-multiplication instructions that do unsigned
  1045. multiplication.
  1046. </p>
  1047. <a name="index-usmulqihi3-instruction-pattern"></a>
  1048. <a name="index-usmulhisi3-instruction-pattern"></a>
  1049. <a name="index-usmulsidi3-instruction-pattern"></a>
  1050. </dd>
  1051. <dt>&lsquo;<samp>usmulqihi3</samp>&rsquo;, &lsquo;<samp>usmulhisi3</samp>&rsquo;, &lsquo;<samp>usmulsidi3</samp>&rsquo;</dt>
  1052. <dd><p>Similar widening-multiplication instructions that interpret the first
  1053. operand as unsigned and the second operand as signed, then do a signed
  1054. multiplication.
  1055. </p>
  1056. <a name="index-smulm3_005fhighpart-instruction-pattern"></a>
  1057. </dd>
  1058. <dt>&lsquo;<samp>smul<var>m</var>3_highpart</samp>&rsquo;</dt>
  1059. <dd><p>Perform a signed multiplication of operands 1 and 2, which have mode
  1060. <var>m</var>, and store the most significant half of the product in operand 0.
  1061. The least significant half of the product is discarded.
  1062. </p>
  1063. <a name="index-umulm3_005fhighpart-instruction-pattern"></a>
  1064. </dd>
  1065. <dt>&lsquo;<samp>umul<var>m</var>3_highpart</samp>&rsquo;</dt>
  1066. <dd><p>Similar, but the multiplication is unsigned.
  1067. </p>
  1068. <a name="index-maddmn4-instruction-pattern"></a>
  1069. </dd>
  1070. <dt>&lsquo;<samp>madd<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1071. <dd><p>Multiply operands 1 and 2, sign-extend them to mode <var>n</var>, add
  1072. operand 3, and store the result in operand 0. Operands 1 and 2
  1073. have mode <var>m</var> and operands 0 and 3 have mode <var>n</var>.
  1074. Both modes must be integer or fixed-point modes and <var>n</var> must be twice
  1075. the size of <var>m</var>.
  1076. </p>
  1077. <p>In other words, <code>madd<var>m</var><var>n</var>4</code> is like
  1078. <code>mul<var>m</var><var>n</var>3</code> except that it also adds operand 3.
  1079. </p>
  1080. <p>These instructions are not allowed to <code>FAIL</code>.
  1081. </p>
  1082. <a name="index-umaddmn4-instruction-pattern"></a>
  1083. </dd>
  1084. <dt>&lsquo;<samp>umadd<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1085. <dd><p>Like <code>madd<var>m</var><var>n</var>4</code>, but zero-extend the multiplication
  1086. operands instead of sign-extending them.
  1087. </p>
  1088. <a name="index-ssmaddmn4-instruction-pattern"></a>
  1089. </dd>
  1090. <dt>&lsquo;<samp>ssmadd<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1091. <dd><p>Like <code>madd<var>m</var><var>n</var>4</code>, but all involved operations must be
  1092. signed-saturating.
  1093. </p>
  1094. <a name="index-usmaddmn4-instruction-pattern"></a>
  1095. </dd>
  1096. <dt>&lsquo;<samp>usmadd<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1097. <dd><p>Like <code>umadd<var>m</var><var>n</var>4</code>, but all involved operations must be
  1098. unsigned-saturating.
  1099. </p>
  1100. <a name="index-msubmn4-instruction-pattern"></a>
  1101. </dd>
  1102. <dt>&lsquo;<samp>msub<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1103. <dd><p>Multiply operands 1 and 2, sign-extend them to mode <var>n</var>, subtract the
  1104. result from operand 3, and store the result in operand 0. Operands 1 and 2
  1105. have mode <var>m</var> and operands 0 and 3 have mode <var>n</var>.
  1106. Both modes must be integer or fixed-point modes and <var>n</var> must be twice
  1107. the size of <var>m</var>.
  1108. </p>
  1109. <p>In other words, <code>msub<var>m</var><var>n</var>4</code> is like
  1110. <code>mul<var>m</var><var>n</var>3</code> except that it also subtracts the result
  1111. from operand 3.
  1112. </p>
  1113. <p>These instructions are not allowed to <code>FAIL</code>.
  1114. </p>
  1115. <a name="index-umsubmn4-instruction-pattern"></a>
  1116. </dd>
  1117. <dt>&lsquo;<samp>umsub<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1118. <dd><p>Like <code>msub<var>m</var><var>n</var>4</code>, but zero-extend the multiplication
  1119. operands instead of sign-extending them.
  1120. </p>
  1121. <a name="index-ssmsubmn4-instruction-pattern"></a>
  1122. </dd>
  1123. <dt>&lsquo;<samp>ssmsub<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1124. <dd><p>Like <code>msub<var>m</var><var>n</var>4</code>, but all involved operations must be
  1125. signed-saturating.
  1126. </p>
  1127. <a name="index-usmsubmn4-instruction-pattern"></a>
  1128. </dd>
  1129. <dt>&lsquo;<samp>usmsub<var>m</var><var>n</var>4</samp>&rsquo;</dt>
  1130. <dd><p>Like <code>umsub<var>m</var><var>n</var>4</code>, but all involved operations must be
  1131. unsigned-saturating.
  1132. </p>
  1133. <a name="index-divmodm4-instruction-pattern"></a>
  1134. </dd>
  1135. <dt>&lsquo;<samp>divmod<var>m</var>4</samp>&rsquo;</dt>
  1136. <dd><p>Signed division that produces both a quotient and a remainder.
  1137. Operand 1 is divided by operand 2 to produce a quotient stored
  1138. in operand 0 and a remainder stored in operand 3.
  1139. </p>
  1140. <p>For machines with an instruction that produces both a quotient and a
  1141. remainder, provide a pattern for &lsquo;<samp>divmod<var>m</var>4</samp>&rsquo; but do not
  1142. provide patterns for &lsquo;<samp>div<var>m</var>3</samp>&rsquo; and &lsquo;<samp>mod<var>m</var>3</samp>&rsquo;. This
  1143. allows optimization in the relatively common case when both the quotient
  1144. and remainder are computed.
  1145. </p>
  1146. <p>If an instruction that just produces a quotient or just a remainder
  1147. exists and is more efficient than the instruction that produces both,
  1148. write the output routine of &lsquo;<samp>divmod<var>m</var>4</samp>&rsquo; to call
  1149. <code>find_reg_note</code> and look for a <code>REG_UNUSED</code> note on the
  1150. quotient or remainder and generate the appropriate instruction.
  1151. </p>
  1152. <a name="index-udivmodm4-instruction-pattern"></a>
  1153. </dd>
  1154. <dt>&lsquo;<samp>udivmod<var>m</var>4</samp>&rsquo;</dt>
  1155. <dd><p>Similar, but does unsigned division.
  1156. </p>
  1157. <a name="shift-patterns"></a><a name="index-ashlm3-instruction-pattern"></a>
  1158. <a name="index-ssashlm3-instruction-pattern"></a>
  1159. <a name="index-usashlm3-instruction-pattern"></a>
  1160. </dd>
  1161. <dt>&lsquo;<samp>ashl<var>m</var>3</samp>&rsquo;, &lsquo;<samp>ssashl<var>m</var>3</samp>&rsquo;, &lsquo;<samp>usashl<var>m</var>3</samp>&rsquo;</dt>
  1162. <dd><p>Arithmetic-shift operand 1 left by a number of bits specified by operand
  1163. 2, and store the result in operand 0. Here <var>m</var> is the mode of
  1164. operand 0 and operand 1; operand 2&rsquo;s mode is specified by the
  1165. instruction pattern, and the compiler will convert the operand to that
  1166. mode before generating the instruction. The shift or rotate expander
  1167. or instruction pattern should explicitly specify the mode of the operand 2,
  1168. it should never be <code>VOIDmode</code>. The meaning of out-of-range shift
  1169. counts can optionally be specified by <code>TARGET_SHIFT_TRUNCATION_MASK</code>.
  1170. See <a href="Misc.html#TARGET_005fSHIFT_005fTRUNCATION_005fMASK">TARGET_SHIFT_TRUNCATION_MASK</a>. Operand 2 is always a scalar type.
  1171. </p>
  1172. <a name="index-ashrm3-instruction-pattern"></a>
  1173. <a name="index-lshrm3-instruction-pattern"></a>
  1174. <a name="index-rotlm3-instruction-pattern"></a>
  1175. <a name="index-rotrm3-instruction-pattern"></a>
  1176. </dd>
  1177. <dt>&lsquo;<samp>ashr<var>m</var>3</samp>&rsquo;, &lsquo;<samp>lshr<var>m</var>3</samp>&rsquo;, &lsquo;<samp>rotl<var>m</var>3</samp>&rsquo;, &lsquo;<samp>rotr<var>m</var>3</samp>&rsquo;</dt>
  1178. <dd><p>Other shift and rotate instructions, analogous to the
  1179. <code>ashl<var>m</var>3</code> instructions. Operand 2 is always a scalar type.
  1180. </p>
  1181. <a name="index-vashlm3-instruction-pattern"></a>
  1182. <a name="index-vashrm3-instruction-pattern"></a>
  1183. <a name="index-vlshrm3-instruction-pattern"></a>
  1184. <a name="index-vrotlm3-instruction-pattern"></a>
  1185. <a name="index-vrotrm3-instruction-pattern"></a>
  1186. </dd>
  1187. <dt>&lsquo;<samp>vashl<var>m</var>3</samp>&rsquo;, &lsquo;<samp>vashr<var>m</var>3</samp>&rsquo;, &lsquo;<samp>vlshr<var>m</var>3</samp>&rsquo;, &lsquo;<samp>vrotl<var>m</var>3</samp>&rsquo;, &lsquo;<samp>vrotr<var>m</var>3</samp>&rsquo;</dt>
  1188. <dd><p>Vector shift and rotate instructions that take vectors as operand 2
  1189. instead of a scalar type.
  1190. </p>
  1191. <a name="index-avgm3_005ffloor-instruction-pattern"></a>
  1192. <a name="index-uavgm3_005ffloor-instruction-pattern"></a>
  1193. </dd>
  1194. <dt>&lsquo;<samp>avg<var>m</var>3_floor</samp>&rsquo;</dt>
  1195. <dt>&lsquo;<samp>uavg<var>m</var>3_floor</samp>&rsquo;</dt>
  1196. <dd><p>Signed and unsigned average instructions. These instructions add
  1197. operands 1 and 2 without truncation, divide the result by 2,
  1198. round towards -Inf, and store the result in operand 0. This is
  1199. equivalent to the C code:
  1200. </p><div class="smallexample">
  1201. <pre class="smallexample">narrow op0, op1, op2;
  1202. &hellip;
  1203. op0 = (narrow) (((wide) op1 + (wide) op2) &gt;&gt; 1);
  1204. </pre></div>
  1205. <p>where the sign of &lsquo;<samp>narrow</samp>&rsquo; determines whether this is a signed
  1206. or unsigned operation.
  1207. </p>
  1208. <a name="index-avgm3_005fceil-instruction-pattern"></a>
  1209. <a name="index-uavgm3_005fceil-instruction-pattern"></a>
  1210. </dd>
  1211. <dt>&lsquo;<samp>avg<var>m</var>3_ceil</samp>&rsquo;</dt>
  1212. <dt>&lsquo;<samp>uavg<var>m</var>3_ceil</samp>&rsquo;</dt>
  1213. <dd><p>Like &lsquo;<samp>avg<var>m</var>3_floor</samp>&rsquo; and &lsquo;<samp>uavg<var>m</var>3_floor</samp>&rsquo;, but round
  1214. towards +Inf. This is equivalent to the C code:
  1215. </p><div class="smallexample">
  1216. <pre class="smallexample">narrow op0, op1, op2;
  1217. &hellip;
  1218. op0 = (narrow) (((wide) op1 + (wide) op2 + 1) &gt;&gt; 1);
  1219. </pre></div>
  1220. <a name="index-bswapm2-instruction-pattern"></a>
  1221. </dd>
  1222. <dt>&lsquo;<samp>bswap<var>m</var>2</samp>&rsquo;</dt>
  1223. <dd><p>Reverse the order of bytes of operand 1 and store the result in operand 0.
  1224. </p>
  1225. <a name="index-negm2-instruction-pattern"></a>
  1226. <a name="index-ssnegm2-instruction-pattern"></a>
  1227. <a name="index-usnegm2-instruction-pattern"></a>
  1228. </dd>
  1229. <dt>&lsquo;<samp>neg<var>m</var>2</samp>&rsquo;, &lsquo;<samp>ssneg<var>m</var>2</samp>&rsquo;, &lsquo;<samp>usneg<var>m</var>2</samp>&rsquo;</dt>
  1230. <dd><p>Negate operand 1 and store the result in operand 0.
  1231. </p>
  1232. <a name="index-negvm3-instruction-pattern"></a>
  1233. </dd>
  1234. <dt>&lsquo;<samp>negv<var>m</var>3</samp>&rsquo;</dt>
  1235. <dd><p>Like <code>neg<var>m</var>2</code> but takes a <code>code_label</code> as operand 2 and
  1236. emits code to jump to it if signed overflow occurs during the negation.
  1237. </p>
  1238. <a name="index-absm2-instruction-pattern"></a>
  1239. </dd>
  1240. <dt>&lsquo;<samp>abs<var>m</var>2</samp>&rsquo;</dt>
  1241. <dd><p>Store the absolute value of operand 1 into operand 0.
  1242. </p>
  1243. <a name="index-sqrtm2-instruction-pattern"></a>
  1244. </dd>
  1245. <dt>&lsquo;<samp>sqrt<var>m</var>2</samp>&rsquo;</dt>
  1246. <dd><p>Store the square root of operand 1 into operand 0. Both operands have
  1247. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1248. </p>
  1249. <p>This pattern is not allowed to <code>FAIL</code>.
  1250. </p>
  1251. <a name="index-rsqrtm2-instruction-pattern"></a>
  1252. </dd>
  1253. <dt>&lsquo;<samp>rsqrt<var>m</var>2</samp>&rsquo;</dt>
  1254. <dd><p>Store the reciprocal of the square root of operand 1 into operand 0.
  1255. Both operands have mode <var>m</var>, which is a scalar or vector
  1256. floating-point mode.
  1257. </p>
  1258. <p>On most architectures this pattern is only approximate, so either
  1259. its C condition or the <code>TARGET_OPTAB_SUPPORTED_P</code> hook should
  1260. check for the appropriate math flags. (Using the C condition is
  1261. more direct, but using <code>TARGET_OPTAB_SUPPORTED_P</code> can be useful
  1262. if a target-specific built-in also uses the &lsquo;<samp>rsqrt<var>m</var>2</samp>&rsquo;
  1263. pattern.)
  1264. </p>
  1265. <p>This pattern is not allowed to <code>FAIL</code>.
  1266. </p>
  1267. <a name="index-fmodm3-instruction-pattern"></a>
  1268. </dd>
  1269. <dt>&lsquo;<samp>fmod<var>m</var>3</samp>&rsquo;</dt>
  1270. <dd><p>Store the remainder of dividing operand 1 by operand 2 into
  1271. operand 0, rounded towards zero to an integer. All operands have
  1272. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1273. </p>
  1274. <p>This pattern is not allowed to <code>FAIL</code>.
  1275. </p>
  1276. <a name="index-remainderm3-instruction-pattern"></a>
  1277. </dd>
  1278. <dt>&lsquo;<samp>remainder<var>m</var>3</samp>&rsquo;</dt>
  1279. <dd><p>Store the remainder of dividing operand 1 by operand 2 into
  1280. operand 0, rounded to the nearest integer. All operands have
  1281. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1282. </p>
  1283. <p>This pattern is not allowed to <code>FAIL</code>.
  1284. </p>
  1285. <a name="index-scalbm3-instruction-pattern"></a>
  1286. </dd>
  1287. <dt>&lsquo;<samp>scalb<var>m</var>3</samp>&rsquo;</dt>
  1288. <dd><p>Raise <code>FLT_RADIX</code> to the power of operand 2, multiply it by
  1289. operand 1, and store the result in operand 0. All operands have
  1290. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1291. </p>
  1292. <p>This pattern is not allowed to <code>FAIL</code>.
  1293. </p>
  1294. <a name="index-ldexpm3-instruction-pattern"></a>
  1295. </dd>
  1296. <dt>&lsquo;<samp>ldexp<var>m</var>3</samp>&rsquo;</dt>
  1297. <dd><p>Raise 2 to the power of operand 2, multiply it by operand 1, and store
  1298. the result in operand 0. Operands 0 and 1 have mode <var>m</var>, which is
  1299. a scalar or vector floating-point mode. Operand 2&rsquo;s mode has
  1300. the same number of elements as <var>m</var> and each element is wide
  1301. enough to store an <code>int</code>. The integers are signed.
  1302. </p>
  1303. <p>This pattern is not allowed to <code>FAIL</code>.
  1304. </p>
  1305. <a name="index-cosm2-instruction-pattern"></a>
  1306. </dd>
  1307. <dt>&lsquo;<samp>cos<var>m</var>2</samp>&rsquo;</dt>
  1308. <dd><p>Store the cosine of operand 1 into operand 0. Both operands have
  1309. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1310. </p>
  1311. <p>This pattern is not allowed to <code>FAIL</code>.
  1312. </p>
  1313. <a name="index-sinm2-instruction-pattern"></a>
  1314. </dd>
  1315. <dt>&lsquo;<samp>sin<var>m</var>2</samp>&rsquo;</dt>
  1316. <dd><p>Store the sine of operand 1 into operand 0. Both operands have
  1317. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1318. </p>
  1319. <p>This pattern is not allowed to <code>FAIL</code>.
  1320. </p>
  1321. <a name="index-sincosm3-instruction-pattern"></a>
  1322. </dd>
  1323. <dt>&lsquo;<samp>sincos<var>m</var>3</samp>&rsquo;</dt>
  1324. <dd><p>Store the cosine of operand 2 into operand 0 and the sine of
  1325. operand 2 into operand 1. All operands have mode <var>m</var>,
  1326. which is a scalar or vector floating-point mode.
  1327. </p>
  1328. <p>Targets that can calculate the sine and cosine simultaneously can
  1329. implement this pattern as opposed to implementing individual
  1330. <code>sin<var>m</var>2</code> and <code>cos<var>m</var>2</code> patterns. The <code>sin</code>
  1331. and <code>cos</code> built-in functions will then be expanded to the
  1332. <code>sincos<var>m</var>3</code> pattern, with one of the output values
  1333. left unused.
  1334. </p>
  1335. <a name="index-tanm2-instruction-pattern"></a>
  1336. </dd>
  1337. <dt>&lsquo;<samp>tan<var>m</var>2</samp>&rsquo;</dt>
  1338. <dd><p>Store the tangent of operand 1 into operand 0. Both operands have
  1339. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1340. </p>
  1341. <p>This pattern is not allowed to <code>FAIL</code>.
  1342. </p>
  1343. <a name="index-asinm2-instruction-pattern"></a>
  1344. </dd>
  1345. <dt>&lsquo;<samp>asin<var>m</var>2</samp>&rsquo;</dt>
  1346. <dd><p>Store the arc sine of operand 1 into operand 0. Both operands have
  1347. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1348. </p>
  1349. <p>This pattern is not allowed to <code>FAIL</code>.
  1350. </p>
  1351. <a name="index-acosm2-instruction-pattern"></a>
  1352. </dd>
  1353. <dt>&lsquo;<samp>acos<var>m</var>2</samp>&rsquo;</dt>
  1354. <dd><p>Store the arc cosine of operand 1 into operand 0. Both operands have
  1355. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1356. </p>
  1357. <p>This pattern is not allowed to <code>FAIL</code>.
  1358. </p>
  1359. <a name="index-atanm2-instruction-pattern"></a>
  1360. </dd>
  1361. <dt>&lsquo;<samp>atan<var>m</var>2</samp>&rsquo;</dt>
  1362. <dd><p>Store the arc tangent of operand 1 into operand 0. Both operands have
  1363. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1364. </p>
  1365. <p>This pattern is not allowed to <code>FAIL</code>.
  1366. </p>
  1367. <a name="index-expm2-instruction-pattern"></a>
  1368. </dd>
  1369. <dt>&lsquo;<samp>exp<var>m</var>2</samp>&rsquo;</dt>
  1370. <dd><p>Raise e (the base of natural logarithms) to the power of operand 1
  1371. and store the result in operand 0. Both operands have mode <var>m</var>,
  1372. which is a scalar or vector floating-point mode.
  1373. </p>
  1374. <p>This pattern is not allowed to <code>FAIL</code>.
  1375. </p>
  1376. <a name="index-expm1m2-instruction-pattern"></a>
  1377. </dd>
  1378. <dt>&lsquo;<samp>expm1<var>m</var>2</samp>&rsquo;</dt>
  1379. <dd><p>Raise e (the base of natural logarithms) to the power of operand 1,
  1380. subtract 1, and store the result in operand 0. Both operands have
  1381. mode <var>m</var>, which is a scalar or vector floating-point mode.
  1382. </p>
  1383. <p>For inputs close to zero, the pattern is expected to be more
  1384. accurate than a separate <code>exp<var>m</var>2</code> and <code>sub<var>m</var>3</code>
  1385. would be.
  1386. </p>
  1387. <p>This pattern is not allowed to <code>FAIL</code>.
  1388. </p>
  1389. <a name="index-exp10m2-instruction-pattern"></a>
  1390. </dd>
  1391. <dt>&lsquo;<samp>exp10<var>m</var>2</samp>&rsquo;</dt>
  1392. <dd><p>Raise 10 to the power of operand 1 and store the result in operand 0.
  1393. Both operands have mode <var>m</var>, which is a scalar or vector
  1394. floating-point mode.
  1395. </p>
  1396. <p>This pattern is not allowed to <code>FAIL</code>.
  1397. </p>
  1398. <a name="index-exp2m2-instruction-pattern"></a>
  1399. </dd>
  1400. <dt>&lsquo;<samp>exp2<var>m</var>2</samp>&rsquo;</dt>
  1401. <dd><p>Raise 2 to the power of operand 1 and store the result in operand 0.
  1402. Both operands have mode <var>m</var>, which is a scalar or vector
  1403. floating-point mode.
  1404. </p>
  1405. <p>This pattern is not allowed to <code>FAIL</code>.
  1406. </p>
  1407. <a name="index-logm2-instruction-pattern"></a>
  1408. </dd>
  1409. <dt>&lsquo;<samp>log<var>m</var>2</samp>&rsquo;</dt>
  1410. <dd><p>Store the natural logarithm of operand 1 into operand 0. Both operands
  1411. have mode <var>m</var>, which is a scalar or vector floating-point mode.
  1412. </p>
  1413. <p>This pattern is not allowed to <code>FAIL</code>.
  1414. </p>
  1415. <a name="index-log1pm2-instruction-pattern"></a>
  1416. </dd>
  1417. <dt>&lsquo;<samp>log1p<var>m</var>2</samp>&rsquo;</dt>
  1418. <dd><p>Add 1 to operand 1, compute the natural logarithm, and store
  1419. the result in operand 0. Both operands have mode <var>m</var>, which is
  1420. a scalar or vector floating-point mode.
  1421. </p>
  1422. <p>For inputs close to zero, the pattern is expected to be more
  1423. accurate than a separate <code>add<var>m</var>3</code> and <code>log<var>m</var>2</code>
  1424. would be.
  1425. </p>
  1426. <p>This pattern is not allowed to <code>FAIL</code>.
  1427. </p>
  1428. <a name="index-log10m2-instruction-pattern"></a>
  1429. </dd>
  1430. <dt>&lsquo;<samp>log10<var>m</var>2</samp>&rsquo;</dt>
  1431. <dd><p>Store the base-10 logarithm of operand 1 into operand 0. Both operands
  1432. have mode <var>m</var>, which is a scalar or vector floating-point mode.
  1433. </p>
  1434. <p>This pattern is not allowed to <code>FAIL</code>.
  1435. </p>
  1436. <a name="index-log2m2-instruction-pattern"></a>
  1437. </dd>
  1438. <dt>&lsquo;<samp>log2<var>m</var>2</samp>&rsquo;</dt>
  1439. <dd><p>Store the base-2 logarithm of operand 1 into operand 0. Both operands
  1440. have mode <var>m</var>, which is a scalar or vector floating-point mode.
  1441. </p>
  1442. <p>This pattern is not allowed to <code>FAIL</code>.
  1443. </p>
  1444. <a name="index-logbm2-instruction-pattern"></a>
  1445. </dd>
  1446. <dt>&lsquo;<samp>logb<var>m</var>2</samp>&rsquo;</dt>
  1447. <dd><p>Store the base-<code>FLT_RADIX</code> logarithm of operand 1 into operand 0.
  1448. Both operands have mode <var>m</var>, which is a scalar or vector
  1449. floating-point mode.
  1450. </p>
  1451. <p>This pattern is not allowed to <code>FAIL</code>.
  1452. </p>
  1453. <a name="index-significandm2-instruction-pattern"></a>
  1454. </dd>
  1455. <dt>&lsquo;<samp>significand<var>m</var>2</samp>&rsquo;</dt>
  1456. <dd><p>Store the significand of floating-point operand 1 in operand 0.
  1457. Both operands have mode <var>m</var>, which is a scalar or vector
  1458. floating-point mode.
  1459. </p>
  1460. <p>This pattern is not allowed to <code>FAIL</code>.
  1461. </p>
  1462. <a name="index-powm3-instruction-pattern"></a>
  1463. </dd>
  1464. <dt>&lsquo;<samp>pow<var>m</var>3</samp>&rsquo;</dt>
  1465. <dd><p>Store the value of operand 1 raised to the exponent operand 2
  1466. into operand 0. All operands have mode <var>m</var>, which is a scalar
  1467. or vector floating-point mode.
  1468. </p>
  1469. <p>This pattern is not allowed to <code>FAIL</code>.
  1470. </p>
  1471. <a name="index-atan2m3-instruction-pattern"></a>
  1472. </dd>
  1473. <dt>&lsquo;<samp>atan2<var>m</var>3</samp>&rsquo;</dt>
  1474. <dd><p>Store the arc tangent (inverse tangent) of operand 1 divided by
  1475. operand 2 into operand 0, using the signs of both arguments to
  1476. determine the quadrant of the result. All operands have mode
  1477. <var>m</var>, which is a scalar or vector floating-point mode.
  1478. </p>
  1479. <p>This pattern is not allowed to <code>FAIL</code>.
  1480. </p>
  1481. <a name="index-floorm2-instruction-pattern"></a>
  1482. </dd>
  1483. <dt>&lsquo;<samp>floor<var>m</var>2</samp>&rsquo;</dt>
  1484. <dd><p>Store the largest integral value not greater than operand 1 in operand 0.
  1485. Both operands have mode <var>m</var>, which is a scalar or vector
  1486. floating-point mode. If <samp>-ffp-int-builtin-inexact</samp> is in
  1487. effect, the &ldquo;inexact&rdquo; exception may be raised for noninteger
  1488. operands; otherwise, it may not.
  1489. </p>
  1490. <p>This pattern is not allowed to <code>FAIL</code>.
  1491. </p>
  1492. <a name="index-btruncm2-instruction-pattern"></a>
  1493. </dd>
  1494. <dt>&lsquo;<samp>btrunc<var>m</var>2</samp>&rsquo;</dt>
  1495. <dd><p>Round operand 1 to an integer, towards zero, and store the result in
  1496. operand 0. Both operands have mode <var>m</var>, which is a scalar or
  1497. vector floating-point mode. If <samp>-ffp-int-builtin-inexact</samp> is
  1498. in effect, the &ldquo;inexact&rdquo; exception may be raised for noninteger
  1499. operands; otherwise, it may not.
  1500. </p>
  1501. <p>This pattern is not allowed to <code>FAIL</code>.
  1502. </p>
  1503. <a name="index-roundm2-instruction-pattern"></a>
  1504. </dd>
  1505. <dt>&lsquo;<samp>round<var>m</var>2</samp>&rsquo;</dt>
  1506. <dd><p>Round operand 1 to the nearest integer, rounding away from zero in the
  1507. event of a tie, and store the result in operand 0. Both operands have
  1508. mode <var>m</var>, which is a scalar or vector floating-point mode. If
  1509. <samp>-ffp-int-builtin-inexact</samp> is in effect, the &ldquo;inexact&rdquo;
  1510. exception may be raised for noninteger operands; otherwise, it may
  1511. not.
  1512. </p>
  1513. <p>This pattern is not allowed to <code>FAIL</code>.
  1514. </p>
  1515. <a name="index-ceilm2-instruction-pattern"></a>
  1516. </dd>
  1517. <dt>&lsquo;<samp>ceil<var>m</var>2</samp>&rsquo;</dt>
  1518. <dd><p>Store the smallest integral value not less than operand 1 in operand 0.
  1519. Both operands have mode <var>m</var>, which is a scalar or vector
  1520. floating-point mode. If <samp>-ffp-int-builtin-inexact</samp> is in
  1521. effect, the &ldquo;inexact&rdquo; exception may be raised for noninteger
  1522. operands; otherwise, it may not.
  1523. </p>
  1524. <p>This pattern is not allowed to <code>FAIL</code>.
  1525. </p>
  1526. <a name="index-nearbyintm2-instruction-pattern"></a>
  1527. </dd>
  1528. <dt>&lsquo;<samp>nearbyint<var>m</var>2</samp>&rsquo;</dt>
  1529. <dd><p>Round operand 1 to an integer, using the current rounding mode, and
  1530. store the result in operand 0. Do not raise an inexact condition when
  1531. the result is different from the argument. Both operands have mode
  1532. <var>m</var>, which is a scalar or vector floating-point mode.
  1533. </p>
  1534. <p>This pattern is not allowed to <code>FAIL</code>.
  1535. </p>
  1536. <a name="index-rintm2-instruction-pattern"></a>
  1537. </dd>
  1538. <dt>&lsquo;<samp>rint<var>m</var>2</samp>&rsquo;</dt>
  1539. <dd><p>Round operand 1 to an integer, using the current rounding mode, and
  1540. store the result in operand 0. Raise an inexact condition when
  1541. the result is different from the argument. Both operands have mode
  1542. <var>m</var>, which is a scalar or vector floating-point mode.
  1543. </p>
  1544. <p>This pattern is not allowed to <code>FAIL</code>.
  1545. </p>
  1546. <a name="index-lrintmn2"></a>
  1547. </dd>
  1548. <dt>&lsquo;<samp>lrint<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1549. <dd><p>Convert operand 1 (valid for floating point mode <var>m</var>) to fixed
  1550. point mode <var>n</var> as a signed number according to the current
  1551. rounding mode and store in operand 0 (which has mode <var>n</var>).
  1552. </p>
  1553. <a name="index-lroundmn2"></a>
  1554. </dd>
  1555. <dt>&lsquo;<samp>lround<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1556. <dd><p>Convert operand 1 (valid for floating point mode <var>m</var>) to fixed
  1557. point mode <var>n</var> as a signed number rounding to nearest and away
  1558. from zero and store in operand 0 (which has mode <var>n</var>).
  1559. </p>
  1560. <a name="index-lfloormn2"></a>
  1561. </dd>
  1562. <dt>&lsquo;<samp>lfloor<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1563. <dd><p>Convert operand 1 (valid for floating point mode <var>m</var>) to fixed
  1564. point mode <var>n</var> as a signed number rounding down and store in
  1565. operand 0 (which has mode <var>n</var>).
  1566. </p>
  1567. <a name="index-lceilmn2"></a>
  1568. </dd>
  1569. <dt>&lsquo;<samp>lceil<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1570. <dd><p>Convert operand 1 (valid for floating point mode <var>m</var>) to fixed
  1571. point mode <var>n</var> as a signed number rounding up and store in
  1572. operand 0 (which has mode <var>n</var>).
  1573. </p>
  1574. <a name="index-copysignm3-instruction-pattern"></a>
  1575. </dd>
  1576. <dt>&lsquo;<samp>copysign<var>m</var>3</samp>&rsquo;</dt>
  1577. <dd><p>Store a value with the magnitude of operand 1 and the sign of operand
  1578. 2 into operand 0. All operands have mode <var>m</var>, which is a scalar or
  1579. vector floating-point mode.
  1580. </p>
  1581. <p>This pattern is not allowed to <code>FAIL</code>.
  1582. </p>
  1583. <a name="index-xorsignm3-instruction-pattern"></a>
  1584. </dd>
  1585. <dt>&lsquo;<samp>xorsign<var>m</var>3</samp>&rsquo;</dt>
  1586. <dd><p>Equivalent to &lsquo;<samp>op0 = op1 * copysign (1.0, op2)</samp>&rsquo;: store a value with
  1587. the magnitude of operand 1 and the sign of operand 2 into operand 0.
  1588. All operands have mode <var>m</var>, which is a scalar or vector
  1589. floating-point mode.
  1590. </p>
  1591. <p>This pattern is not allowed to <code>FAIL</code>.
  1592. </p>
  1593. <a name="index-ffsm2-instruction-pattern"></a>
  1594. </dd>
  1595. <dt>&lsquo;<samp>ffs<var>m</var>2</samp>&rsquo;</dt>
  1596. <dd><p>Store into operand 0 one plus the index of the least significant 1-bit
  1597. of operand 1. If operand 1 is zero, store zero.
  1598. </p>
  1599. <p><var>m</var> is either a scalar or vector integer mode. When it is a scalar,
  1600. operand 1 has mode <var>m</var> but operand 0 can have whatever scalar
  1601. integer mode is suitable for the target. The compiler will insert
  1602. conversion instructions as necessary (typically to convert the result
  1603. to the same width as <code>int</code>). When <var>m</var> is a vector, both
  1604. operands must have mode <var>m</var>.
  1605. </p>
  1606. <p>This pattern is not allowed to <code>FAIL</code>.
  1607. </p>
  1608. <a name="index-clrsbm2-instruction-pattern"></a>
  1609. </dd>
  1610. <dt>&lsquo;<samp>clrsb<var>m</var>2</samp>&rsquo;</dt>
  1611. <dd><p>Count leading redundant sign bits.
  1612. Store into operand 0 the number of redundant sign bits in operand 1, starting
  1613. at the most significant bit position.
  1614. A redundant sign bit is defined as any sign bit after the first. As such,
  1615. this count will be one less than the count of leading sign bits.
  1616. </p>
  1617. <p><var>m</var> is either a scalar or vector integer mode. When it is a scalar,
  1618. operand 1 has mode <var>m</var> but operand 0 can have whatever scalar
  1619. integer mode is suitable for the target. The compiler will insert
  1620. conversion instructions as necessary (typically to convert the result
  1621. to the same width as <code>int</code>). When <var>m</var> is a vector, both
  1622. operands must have mode <var>m</var>.
  1623. </p>
  1624. <p>This pattern is not allowed to <code>FAIL</code>.
  1625. </p>
  1626. <a name="index-clzm2-instruction-pattern"></a>
  1627. </dd>
  1628. <dt>&lsquo;<samp>clz<var>m</var>2</samp>&rsquo;</dt>
  1629. <dd><p>Store into operand 0 the number of leading 0-bits in operand 1, starting
  1630. at the most significant bit position. If operand 1 is 0, the
  1631. <code>CLZ_DEFINED_VALUE_AT_ZERO</code> (see <a href="Misc.html#Misc">Misc</a>) macro defines if
  1632. the result is undefined or has a useful value.
  1633. </p>
  1634. <p><var>m</var> is either a scalar or vector integer mode. When it is a scalar,
  1635. operand 1 has mode <var>m</var> but operand 0 can have whatever scalar
  1636. integer mode is suitable for the target. The compiler will insert
  1637. conversion instructions as necessary (typically to convert the result
  1638. to the same width as <code>int</code>). When <var>m</var> is a vector, both
  1639. operands must have mode <var>m</var>.
  1640. </p>
  1641. <p>This pattern is not allowed to <code>FAIL</code>.
  1642. </p>
  1643. <a name="index-ctzm2-instruction-pattern"></a>
  1644. </dd>
  1645. <dt>&lsquo;<samp>ctz<var>m</var>2</samp>&rsquo;</dt>
  1646. <dd><p>Store into operand 0 the number of trailing 0-bits in operand 1, starting
  1647. at the least significant bit position. If operand 1 is 0, the
  1648. <code>CTZ_DEFINED_VALUE_AT_ZERO</code> (see <a href="Misc.html#Misc">Misc</a>) macro defines if
  1649. the result is undefined or has a useful value.
  1650. </p>
  1651. <p><var>m</var> is either a scalar or vector integer mode. When it is a scalar,
  1652. operand 1 has mode <var>m</var> but operand 0 can have whatever scalar
  1653. integer mode is suitable for the target. The compiler will insert
  1654. conversion instructions as necessary (typically to convert the result
  1655. to the same width as <code>int</code>). When <var>m</var> is a vector, both
  1656. operands must have mode <var>m</var>.
  1657. </p>
  1658. <p>This pattern is not allowed to <code>FAIL</code>.
  1659. </p>
  1660. <a name="index-popcountm2-instruction-pattern"></a>
  1661. </dd>
  1662. <dt>&lsquo;<samp>popcount<var>m</var>2</samp>&rsquo;</dt>
  1663. <dd><p>Store into operand 0 the number of 1-bits in operand 1.
  1664. </p>
  1665. <p><var>m</var> is either a scalar or vector integer mode. When it is a scalar,
  1666. operand 1 has mode <var>m</var> but operand 0 can have whatever scalar
  1667. integer mode is suitable for the target. The compiler will insert
  1668. conversion instructions as necessary (typically to convert the result
  1669. to the same width as <code>int</code>). When <var>m</var> is a vector, both
  1670. operands must have mode <var>m</var>.
  1671. </p>
  1672. <p>This pattern is not allowed to <code>FAIL</code>.
  1673. </p>
  1674. <a name="index-paritym2-instruction-pattern"></a>
  1675. </dd>
  1676. <dt>&lsquo;<samp>parity<var>m</var>2</samp>&rsquo;</dt>
  1677. <dd><p>Store into operand 0 the parity of operand 1, i.e. the number of 1-bits
  1678. in operand 1 modulo 2.
  1679. </p>
  1680. <p><var>m</var> is either a scalar or vector integer mode. When it is a scalar,
  1681. operand 1 has mode <var>m</var> but operand 0 can have whatever scalar
  1682. integer mode is suitable for the target. The compiler will insert
  1683. conversion instructions as necessary (typically to convert the result
  1684. to the same width as <code>int</code>). When <var>m</var> is a vector, both
  1685. operands must have mode <var>m</var>.
  1686. </p>
  1687. <p>This pattern is not allowed to <code>FAIL</code>.
  1688. </p>
  1689. <a name="index-one_005fcmplm2-instruction-pattern"></a>
  1690. </dd>
  1691. <dt>&lsquo;<samp>one_cmpl<var>m</var>2</samp>&rsquo;</dt>
  1692. <dd><p>Store the bitwise-complement of operand 1 into operand 0.
  1693. </p>
  1694. <a name="index-cpymemm-instruction-pattern"></a>
  1695. </dd>
  1696. <dt>&lsquo;<samp>cpymem<var>m</var></samp>&rsquo;</dt>
  1697. <dd><p>Block copy instruction. The destination and source blocks of memory
  1698. are the first two operands, and both are <code>mem:BLK</code>s with an
  1699. address in mode <code>Pmode</code>.
  1700. </p>
  1701. <p>The number of bytes to copy is the third operand, in mode <var>m</var>.
  1702. Usually, you specify <code>Pmode</code> for <var>m</var>. However, if you can
  1703. generate better code knowing the range of valid lengths is smaller than
  1704. those representable in a full Pmode pointer, you should provide
  1705. a pattern with a
  1706. mode corresponding to the range of values you can handle efficiently
  1707. (e.g., <code>QImode</code> for values in the range 0&ndash;127; note we avoid numbers
  1708. that appear negative) and also a pattern with <code>Pmode</code>.
  1709. </p>
  1710. <p>The fourth operand is the known shared alignment of the source and
  1711. destination, in the form of a <code>const_int</code> rtx. Thus, if the
  1712. compiler knows that both source and destination are word-aligned,
  1713. it may provide the value 4 for this operand.
  1714. </p>
  1715. <p>Optional operands 5 and 6 specify expected alignment and size of block
  1716. respectively. The expected alignment differs from alignment in operand 4
  1717. in a way that the blocks are not required to be aligned according to it in
  1718. all cases. This expected alignment is also in bytes, just like operand 4.
  1719. Expected size, when unknown, is set to <code>(const_int -1)</code>.
  1720. </p>
  1721. <p>Descriptions of multiple <code>cpymem<var>m</var></code> patterns can only be
  1722. beneficial if the patterns for smaller modes have fewer restrictions
  1723. on their first, second and fourth operands. Note that the mode <var>m</var>
  1724. in <code>cpymem<var>m</var></code> does not impose any restriction on the mode of
  1725. individually copied data units in the block.
  1726. </p>
  1727. <p>The <code>cpymem<var>m</var></code> patterns need not give special consideration
  1728. to the possibility that the source and destination strings might
  1729. overlap. These patterns are used to do inline expansion of
  1730. <code>__builtin_memcpy</code>.
  1731. </p>
  1732. <a name="index-movmemm-instruction-pattern"></a>
  1733. </dd>
  1734. <dt>&lsquo;<samp>movmem<var>m</var></samp>&rsquo;</dt>
  1735. <dd><p>Block move instruction. The destination and source blocks of memory
  1736. are the first two operands, and both are <code>mem:BLK</code>s with an
  1737. address in mode <code>Pmode</code>.
  1738. </p>
  1739. <p>The number of bytes to copy is the third operand, in mode <var>m</var>.
  1740. Usually, you specify <code>Pmode</code> for <var>m</var>. However, if you can
  1741. generate better code knowing the range of valid lengths is smaller than
  1742. those representable in a full Pmode pointer, you should provide
  1743. a pattern with a
  1744. mode corresponding to the range of values you can handle efficiently
  1745. (e.g., <code>QImode</code> for values in the range 0&ndash;127; note we avoid numbers
  1746. that appear negative) and also a pattern with <code>Pmode</code>.
  1747. </p>
  1748. <p>The fourth operand is the known shared alignment of the source and
  1749. destination, in the form of a <code>const_int</code> rtx. Thus, if the
  1750. compiler knows that both source and destination are word-aligned,
  1751. it may provide the value 4 for this operand.
  1752. </p>
  1753. <p>Optional operands 5 and 6 specify expected alignment and size of block
  1754. respectively. The expected alignment differs from alignment in operand 4
  1755. in a way that the blocks are not required to be aligned according to it in
  1756. all cases. This expected alignment is also in bytes, just like operand 4.
  1757. Expected size, when unknown, is set to <code>(const_int -1)</code>.
  1758. </p>
  1759. <p>Descriptions of multiple <code>movmem<var>m</var></code> patterns can only be
  1760. beneficial if the patterns for smaller modes have fewer restrictions
  1761. on their first, second and fourth operands. Note that the mode <var>m</var>
  1762. in <code>movmem<var>m</var></code> does not impose any restriction on the mode of
  1763. individually copied data units in the block.
  1764. </p>
  1765. <p>The <code>movmem<var>m</var></code> patterns must correctly handle the case where
  1766. the source and destination strings overlap. These patterns are used to
  1767. do inline expansion of <code>__builtin_memmove</code>.
  1768. </p>
  1769. <a name="index-movstr-instruction-pattern"></a>
  1770. </dd>
  1771. <dt>&lsquo;<samp>movstr</samp>&rsquo;</dt>
  1772. <dd><p>String copy instruction, with <code>stpcpy</code> semantics. Operand 0 is
  1773. an output operand in mode <code>Pmode</code>. The addresses of the
  1774. destination and source strings are operands 1 and 2, and both are
  1775. <code>mem:BLK</code>s with addresses in mode <code>Pmode</code>. The execution of
  1776. the expansion of this pattern should store in operand 0 the address in
  1777. which the <code>NUL</code> terminator was stored in the destination string.
  1778. </p>
  1779. <p>This pattern has also several optional operands that are same as in
  1780. <code>setmem</code>.
  1781. </p>
  1782. <a name="index-setmemm-instruction-pattern"></a>
  1783. </dd>
  1784. <dt>&lsquo;<samp>setmem<var>m</var></samp>&rsquo;</dt>
  1785. <dd><p>Block set instruction. The destination string is the first operand,
  1786. given as a <code>mem:BLK</code> whose address is in mode <code>Pmode</code>. The
  1787. number of bytes to set is the second operand, in mode <var>m</var>. The value to
  1788. initialize the memory with is the third operand. Targets that only support the
  1789. clearing of memory should reject any value that is not the constant 0. See
  1790. &lsquo;<samp>cpymem<var>m</var></samp>&rsquo; for a discussion of the choice of mode.
  1791. </p>
  1792. <p>The fourth operand is the known alignment of the destination, in the form
  1793. of a <code>const_int</code> rtx. Thus, if the compiler knows that the
  1794. destination is word-aligned, it may provide the value 4 for this
  1795. operand.
  1796. </p>
  1797. <p>Optional operands 5 and 6 specify expected alignment and size of block
  1798. respectively. The expected alignment differs from alignment in operand 4
  1799. in a way that the blocks are not required to be aligned according to it in
  1800. all cases. This expected alignment is also in bytes, just like operand 4.
  1801. Expected size, when unknown, is set to <code>(const_int -1)</code>.
  1802. Operand 7 is the minimal size of the block and operand 8 is the
  1803. maximal size of the block (NULL if it cannot be represented as CONST_INT).
  1804. Operand 9 is the probable maximal size (i.e. we cannot rely on it for
  1805. correctness, but it can be used for choosing proper code sequence for a
  1806. given size).
  1807. </p>
  1808. <p>The use for multiple <code>setmem<var>m</var></code> is as for <code>cpymem<var>m</var></code>.
  1809. </p>
  1810. <a name="index-cmpstrnm-instruction-pattern"></a>
  1811. </dd>
  1812. <dt>&lsquo;<samp>cmpstrn<var>m</var></samp>&rsquo;</dt>
  1813. <dd><p>String compare instruction, with five operands. Operand 0 is the output;
  1814. it has mode <var>m</var>. The remaining four operands are like the operands
  1815. of &lsquo;<samp>cpymem<var>m</var></samp>&rsquo;. The two memory blocks specified are compared
  1816. byte by byte in lexicographic order starting at the beginning of each
  1817. string. The instruction is not allowed to prefetch more than one byte
  1818. at a time since either string may end in the first byte and reading past
  1819. that may access an invalid page or segment and cause a fault. The
  1820. comparison terminates early if the fetched bytes are different or if
  1821. they are equal to zero. The effect of the instruction is to store a
  1822. value in operand 0 whose sign indicates the result of the comparison.
  1823. </p>
  1824. <a name="index-cmpstrm-instruction-pattern"></a>
  1825. </dd>
  1826. <dt>&lsquo;<samp>cmpstr<var>m</var></samp>&rsquo;</dt>
  1827. <dd><p>String compare instruction, without known maximum length. Operand 0 is the
  1828. output; it has mode <var>m</var>. The second and third operand are the blocks of
  1829. memory to be compared; both are <code>mem:BLK</code> with an address in mode
  1830. <code>Pmode</code>.
  1831. </p>
  1832. <p>The fourth operand is the known shared alignment of the source and
  1833. destination, in the form of a <code>const_int</code> rtx. Thus, if the
  1834. compiler knows that both source and destination are word-aligned,
  1835. it may provide the value 4 for this operand.
  1836. </p>
  1837. <p>The two memory blocks specified are compared byte by byte in lexicographic
  1838. order starting at the beginning of each string. The instruction is not allowed
  1839. to prefetch more than one byte at a time since either string may end in the
  1840. first byte and reading past that may access an invalid page or segment and
  1841. cause a fault. The comparison will terminate when the fetched bytes
  1842. are different or if they are equal to zero. The effect of the
  1843. instruction is to store a value in operand 0 whose sign indicates the
  1844. result of the comparison.
  1845. </p>
  1846. <a name="index-cmpmemm-instruction-pattern"></a>
  1847. </dd>
  1848. <dt>&lsquo;<samp>cmpmem<var>m</var></samp>&rsquo;</dt>
  1849. <dd><p>Block compare instruction, with five operands like the operands
  1850. of &lsquo;<samp>cmpstr<var>m</var></samp>&rsquo;. The two memory blocks specified are compared
  1851. byte by byte in lexicographic order starting at the beginning of each
  1852. block. Unlike &lsquo;<samp>cmpstr<var>m</var></samp>&rsquo; the instruction can prefetch
  1853. any bytes in the two memory blocks. Also unlike &lsquo;<samp>cmpstr<var>m</var></samp>&rsquo;
  1854. the comparison will not stop if both bytes are zero. The effect of
  1855. the instruction is to store a value in operand 0 whose sign indicates
  1856. the result of the comparison.
  1857. </p>
  1858. <a name="index-strlenm-instruction-pattern"></a>
  1859. </dd>
  1860. <dt>&lsquo;<samp>strlen<var>m</var></samp>&rsquo;</dt>
  1861. <dd><p>Compute the length of a string, with three operands.
  1862. Operand 0 is the result (of mode <var>m</var>), operand 1 is
  1863. a <code>mem</code> referring to the first character of the string,
  1864. operand 2 is the character to search for (normally zero),
  1865. and operand 3 is a constant describing the known alignment
  1866. of the beginning of the string.
  1867. </p>
  1868. <a name="index-floatmn2-instruction-pattern"></a>
  1869. </dd>
  1870. <dt>&lsquo;<samp>float<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1871. <dd><p>Convert signed integer operand 1 (valid for fixed point mode <var>m</var>) to
  1872. floating point mode <var>n</var> and store in operand 0 (which has mode
  1873. <var>n</var>).
  1874. </p>
  1875. <a name="index-floatunsmn2-instruction-pattern"></a>
  1876. </dd>
  1877. <dt>&lsquo;<samp>floatuns<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1878. <dd><p>Convert unsigned integer operand 1 (valid for fixed point mode <var>m</var>)
  1879. to floating point mode <var>n</var> and store in operand 0 (which has mode
  1880. <var>n</var>).
  1881. </p>
  1882. <a name="index-fixmn2-instruction-pattern"></a>
  1883. </dd>
  1884. <dt>&lsquo;<samp>fix<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1885. <dd><p>Convert operand 1 (valid for floating point mode <var>m</var>) to fixed
  1886. point mode <var>n</var> as a signed number and store in operand 0 (which
  1887. has mode <var>n</var>). This instruction&rsquo;s result is defined only when
  1888. the value of operand 1 is an integer.
  1889. </p>
  1890. <p>If the machine description defines this pattern, it also needs to
  1891. define the <code>ftrunc</code> pattern.
  1892. </p>
  1893. <a name="index-fixunsmn2-instruction-pattern"></a>
  1894. </dd>
  1895. <dt>&lsquo;<samp>fixuns<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1896. <dd><p>Convert operand 1 (valid for floating point mode <var>m</var>) to fixed
  1897. point mode <var>n</var> as an unsigned number and store in operand 0 (which
  1898. has mode <var>n</var>). This instruction&rsquo;s result is defined only when the
  1899. value of operand 1 is an integer.
  1900. </p>
  1901. <a name="index-ftruncm2-instruction-pattern"></a>
  1902. </dd>
  1903. <dt>&lsquo;<samp>ftrunc<var>m</var>2</samp>&rsquo;</dt>
  1904. <dd><p>Convert operand 1 (valid for floating point mode <var>m</var>) to an
  1905. integer value, still represented in floating point mode <var>m</var>, and
  1906. store it in operand 0 (valid for floating point mode <var>m</var>).
  1907. </p>
  1908. <a name="index-fix_005ftruncmn2-instruction-pattern"></a>
  1909. </dd>
  1910. <dt>&lsquo;<samp>fix_trunc<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1911. <dd><p>Like &lsquo;<samp>fix<var>m</var><var>n</var>2</samp>&rsquo; but works for any floating point value
  1912. of mode <var>m</var> by converting the value to an integer.
  1913. </p>
  1914. <a name="index-fixuns_005ftruncmn2-instruction-pattern"></a>
  1915. </dd>
  1916. <dt>&lsquo;<samp>fixuns_trunc<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1917. <dd><p>Like &lsquo;<samp>fixuns<var>m</var><var>n</var>2</samp>&rsquo; but works for any floating point
  1918. value of mode <var>m</var> by converting the value to an integer.
  1919. </p>
  1920. <a name="index-truncmn2-instruction-pattern"></a>
  1921. </dd>
  1922. <dt>&lsquo;<samp>trunc<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1923. <dd><p>Truncate operand 1 (valid for mode <var>m</var>) to mode <var>n</var> and
  1924. store in operand 0 (which has mode <var>n</var>). Both modes must be fixed
  1925. point or both floating point.
  1926. </p>
  1927. <a name="index-extendmn2-instruction-pattern"></a>
  1928. </dd>
  1929. <dt>&lsquo;<samp>extend<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1930. <dd><p>Sign-extend operand 1 (valid for mode <var>m</var>) to mode <var>n</var> and
  1931. store in operand 0 (which has mode <var>n</var>). Both modes must be fixed
  1932. point or both floating point.
  1933. </p>
  1934. <a name="index-zero_005fextendmn2-instruction-pattern"></a>
  1935. </dd>
  1936. <dt>&lsquo;<samp>zero_extend<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1937. <dd><p>Zero-extend operand 1 (valid for mode <var>m</var>) to mode <var>n</var> and
  1938. store in operand 0 (which has mode <var>n</var>). Both modes must be fixed
  1939. point.
  1940. </p>
  1941. <a name="index-fractmn2-instruction-pattern"></a>
  1942. </dd>
  1943. <dt>&lsquo;<samp>fract<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1944. <dd><p>Convert operand 1 of mode <var>m</var> to mode <var>n</var> and store in
  1945. operand 0 (which has mode <var>n</var>). Mode <var>m</var> and mode <var>n</var>
  1946. could be fixed-point to fixed-point, signed integer to fixed-point,
  1947. fixed-point to signed integer, floating-point to fixed-point,
  1948. or fixed-point to floating-point.
  1949. When overflows or underflows happen, the results are undefined.
  1950. </p>
  1951. <a name="index-satfractmn2-instruction-pattern"></a>
  1952. </dd>
  1953. <dt>&lsquo;<samp>satfract<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1954. <dd><p>Convert operand 1 of mode <var>m</var> to mode <var>n</var> and store in
  1955. operand 0 (which has mode <var>n</var>). Mode <var>m</var> and mode <var>n</var>
  1956. could be fixed-point to fixed-point, signed integer to fixed-point,
  1957. or floating-point to fixed-point.
  1958. When overflows or underflows happen, the instruction saturates the
  1959. results to the maximum or the minimum.
  1960. </p>
  1961. <a name="index-fractunsmn2-instruction-pattern"></a>
  1962. </dd>
  1963. <dt>&lsquo;<samp>fractuns<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1964. <dd><p>Convert operand 1 of mode <var>m</var> to mode <var>n</var> and store in
  1965. operand 0 (which has mode <var>n</var>). Mode <var>m</var> and mode <var>n</var>
  1966. could be unsigned integer to fixed-point, or
  1967. fixed-point to unsigned integer.
  1968. When overflows or underflows happen, the results are undefined.
  1969. </p>
  1970. <a name="index-satfractunsmn2-instruction-pattern"></a>
  1971. </dd>
  1972. <dt>&lsquo;<samp>satfractuns<var>m</var><var>n</var>2</samp>&rsquo;</dt>
  1973. <dd><p>Convert unsigned integer operand 1 of mode <var>m</var> to fixed-point mode
  1974. <var>n</var> and store in operand 0 (which has mode <var>n</var>).
  1975. When overflows or underflows happen, the instruction saturates the
  1976. results to the maximum or the minimum.
  1977. </p>
  1978. <a name="index-extvm-instruction-pattern"></a>
  1979. </dd>
  1980. <dt>&lsquo;<samp>extv<var>m</var></samp>&rsquo;</dt>
  1981. <dd><p>Extract a bit-field from register operand 1, sign-extend it, and store
  1982. it in operand 0. Operand 2 specifies the width of the field in bits
  1983. and operand 3 the starting bit, which counts from the most significant
  1984. bit if &lsquo;<samp>BITS_BIG_ENDIAN</samp>&rsquo; is true and from the least significant bit
  1985. otherwise.
  1986. </p>
  1987. <p>Operands 0 and 1 both have mode <var>m</var>. Operands 2 and 3 have a
  1988. target-specific mode.
  1989. </p>
  1990. <a name="index-extvmisalignm-instruction-pattern"></a>
  1991. </dd>
  1992. <dt>&lsquo;<samp>extvmisalign<var>m</var></samp>&rsquo;</dt>
  1993. <dd><p>Extract a bit-field from memory operand 1, sign extend it, and store
  1994. it in operand 0. Operand 2 specifies the width in bits and operand 3
  1995. the starting bit. The starting bit is always somewhere in the first byte of
  1996. operand 1; it counts from the most significant bit if &lsquo;<samp>BITS_BIG_ENDIAN</samp>&rsquo;
  1997. is true and from the least significant bit otherwise.
  1998. </p>
  1999. <p>Operand 0 has mode <var>m</var> while operand 1 has <code>BLK</code> mode.
  2000. Operands 2 and 3 have a target-specific mode.
  2001. </p>
  2002. <p>The instruction must not read beyond the last byte of the bit-field.
  2003. </p>
  2004. <a name="index-extzvm-instruction-pattern"></a>
  2005. </dd>
  2006. <dt>&lsquo;<samp>extzv<var>m</var></samp>&rsquo;</dt>
  2007. <dd><p>Like &lsquo;<samp>extv<var>m</var></samp>&rsquo; except that the bit-field value is zero-extended.
  2008. </p>
  2009. <a name="index-extzvmisalignm-instruction-pattern"></a>
  2010. </dd>
  2011. <dt>&lsquo;<samp>extzvmisalign<var>m</var></samp>&rsquo;</dt>
  2012. <dd><p>Like &lsquo;<samp>extvmisalign<var>m</var></samp>&rsquo; except that the bit-field value is
  2013. zero-extended.
  2014. </p>
  2015. <a name="index-insvm-instruction-pattern"></a>
  2016. </dd>
  2017. <dt>&lsquo;<samp>insv<var>m</var></samp>&rsquo;</dt>
  2018. <dd><p>Insert operand 3 into a bit-field of register operand 0. Operand 1
  2019. specifies the width of the field in bits and operand 2 the starting bit,
  2020. which counts from the most significant bit if &lsquo;<samp>BITS_BIG_ENDIAN</samp>&rsquo;
  2021. is true and from the least significant bit otherwise.
  2022. </p>
  2023. <p>Operands 0 and 3 both have mode <var>m</var>. Operands 1 and 2 have a
  2024. target-specific mode.
  2025. </p>
  2026. <a name="index-insvmisalignm-instruction-pattern"></a>
  2027. </dd>
  2028. <dt>&lsquo;<samp>insvmisalign<var>m</var></samp>&rsquo;</dt>
  2029. <dd><p>Insert operand 3 into a bit-field of memory operand 0. Operand 1
  2030. specifies the width of the field in bits and operand 2 the starting bit.
  2031. The starting bit is always somewhere in the first byte of operand 0;
  2032. it counts from the most significant bit if &lsquo;<samp>BITS_BIG_ENDIAN</samp>&rsquo;
  2033. is true and from the least significant bit otherwise.
  2034. </p>
  2035. <p>Operand 3 has mode <var>m</var> while operand 0 has <code>BLK</code> mode.
  2036. Operands 1 and 2 have a target-specific mode.
  2037. </p>
  2038. <p>The instruction must not read or write beyond the last byte of the bit-field.
  2039. </p>
  2040. <a name="index-extv-instruction-pattern"></a>
  2041. </dd>
  2042. <dt>&lsquo;<samp>extv</samp>&rsquo;</dt>
  2043. <dd><p>Extract a bit-field from operand 1 (a register or memory operand), where
  2044. operand 2 specifies the width in bits and operand 3 the starting bit,
  2045. and store it in operand 0. Operand 0 must have mode <code>word_mode</code>.
  2046. Operand 1 may have mode <code>byte_mode</code> or <code>word_mode</code>; often
  2047. <code>word_mode</code> is allowed only for registers. Operands 2 and 3 must
  2048. be valid for <code>word_mode</code>.
  2049. </p>
  2050. <p>The RTL generation pass generates this instruction only with constants
  2051. for operands 2 and 3 and the constant is never zero for operand 2.
  2052. </p>
  2053. <p>The bit-field value is sign-extended to a full word integer
  2054. before it is stored in operand 0.
  2055. </p>
  2056. <p>This pattern is deprecated; please use &lsquo;<samp>extv<var>m</var></samp>&rsquo; and
  2057. <code>extvmisalign<var>m</var></code> instead.
  2058. </p>
  2059. <a name="index-extzv-instruction-pattern"></a>
  2060. </dd>
  2061. <dt>&lsquo;<samp>extzv</samp>&rsquo;</dt>
  2062. <dd><p>Like &lsquo;<samp>extv</samp>&rsquo; except that the bit-field value is zero-extended.
  2063. </p>
  2064. <p>This pattern is deprecated; please use &lsquo;<samp>extzv<var>m</var></samp>&rsquo; and
  2065. <code>extzvmisalign<var>m</var></code> instead.
  2066. </p>
  2067. <a name="index-insv-instruction-pattern"></a>
  2068. </dd>
  2069. <dt>&lsquo;<samp>insv</samp>&rsquo;</dt>
  2070. <dd><p>Store operand 3 (which must be valid for <code>word_mode</code>) into a
  2071. bit-field in operand 0, where operand 1 specifies the width in bits and
  2072. operand 2 the starting bit. Operand 0 may have mode <code>byte_mode</code> or
  2073. <code>word_mode</code>; often <code>word_mode</code> is allowed only for registers.
  2074. Operands 1 and 2 must be valid for <code>word_mode</code>.
  2075. </p>
  2076. <p>The RTL generation pass generates this instruction only with constants
  2077. for operands 1 and 2 and the constant is never zero for operand 1.
  2078. </p>
  2079. <p>This pattern is deprecated; please use &lsquo;<samp>insv<var>m</var></samp>&rsquo; and
  2080. <code>insvmisalign<var>m</var></code> instead.
  2081. </p>
  2082. <a name="index-movmodecc-instruction-pattern"></a>
  2083. </dd>
  2084. <dt>&lsquo;<samp>mov<var>mode</var>cc</samp>&rsquo;</dt>
  2085. <dd><p>Conditionally move operand 2 or operand 3 into operand 0 according to the
  2086. comparison in operand 1. If the comparison is true, operand 2 is moved
  2087. into operand 0, otherwise operand 3 is moved.
  2088. </p>
  2089. <p>The mode of the operands being compared need not be the same as the operands
  2090. being moved. Some machines, sparc64 for example, have instructions that
  2091. conditionally move an integer value based on the floating point condition
  2092. codes and vice versa.
  2093. </p>
  2094. <p>If the machine does not have conditional move instructions, do not
  2095. define these patterns.
  2096. </p>
  2097. <a name="index-addmodecc-instruction-pattern"></a>
  2098. </dd>
  2099. <dt>&lsquo;<samp>add<var>mode</var>cc</samp>&rsquo;</dt>
  2100. <dd><p>Similar to &lsquo;<samp>mov<var>mode</var>cc</samp>&rsquo; but for conditional addition. Conditionally
  2101. move operand 2 or (operands 2 + operand 3) into operand 0 according to the
  2102. comparison in operand 1. If the comparison is false, operand 2 is moved into
  2103. operand 0, otherwise (operand 2 + operand 3) is moved.
  2104. </p>
  2105. <a name="index-cond_005faddmode-instruction-pattern"></a>
  2106. <a name="index-cond_005fsubmode-instruction-pattern"></a>
  2107. <a name="index-cond_005fmulmode-instruction-pattern"></a>
  2108. <a name="index-cond_005fdivmode-instruction-pattern"></a>
  2109. <a name="index-cond_005fudivmode-instruction-pattern"></a>
  2110. <a name="index-cond_005fmodmode-instruction-pattern"></a>
  2111. <a name="index-cond_005fumodmode-instruction-pattern"></a>
  2112. <a name="index-cond_005fandmode-instruction-pattern"></a>
  2113. <a name="index-cond_005fiormode-instruction-pattern"></a>
  2114. <a name="index-cond_005fxormode-instruction-pattern"></a>
  2115. <a name="index-cond_005fsminmode-instruction-pattern"></a>
  2116. <a name="index-cond_005fsmaxmode-instruction-pattern"></a>
  2117. <a name="index-cond_005fuminmode-instruction-pattern"></a>
  2118. <a name="index-cond_005fumaxmode-instruction-pattern"></a>
  2119. </dd>
  2120. <dt>&lsquo;<samp>cond_add<var>mode</var></samp>&rsquo;</dt>
  2121. <dt>&lsquo;<samp>cond_sub<var>mode</var></samp>&rsquo;</dt>
  2122. <dt>&lsquo;<samp>cond_mul<var>mode</var></samp>&rsquo;</dt>
  2123. <dt>&lsquo;<samp>cond_div<var>mode</var></samp>&rsquo;</dt>
  2124. <dt>&lsquo;<samp>cond_udiv<var>mode</var></samp>&rsquo;</dt>
  2125. <dt>&lsquo;<samp>cond_mod<var>mode</var></samp>&rsquo;</dt>
  2126. <dt>&lsquo;<samp>cond_umod<var>mode</var></samp>&rsquo;</dt>
  2127. <dt>&lsquo;<samp>cond_and<var>mode</var></samp>&rsquo;</dt>
  2128. <dt>&lsquo;<samp>cond_ior<var>mode</var></samp>&rsquo;</dt>
  2129. <dt>&lsquo;<samp>cond_xor<var>mode</var></samp>&rsquo;</dt>
  2130. <dt>&lsquo;<samp>cond_smin<var>mode</var></samp>&rsquo;</dt>
  2131. <dt>&lsquo;<samp>cond_smax<var>mode</var></samp>&rsquo;</dt>
  2132. <dt>&lsquo;<samp>cond_umin<var>mode</var></samp>&rsquo;</dt>
  2133. <dt>&lsquo;<samp>cond_umax<var>mode</var></samp>&rsquo;</dt>
  2134. <dd><p>When operand 1 is true, perform an operation on operands 2 and 3 and
  2135. store the result in operand 0, otherwise store operand 4 in operand 0.
  2136. The operation works elementwise if the operands are vectors.
  2137. </p>
  2138. <p>The scalar case is equivalent to:
  2139. </p>
  2140. <div class="smallexample">
  2141. <pre class="smallexample">op0 = op1 ? op2 <var>op</var> op3 : op4;
  2142. </pre></div>
  2143. <p>while the vector case is equivalent to:
  2144. </p>
  2145. <div class="smallexample">
  2146. <pre class="smallexample">for (i = 0; i &lt; GET_MODE_NUNITS (<var>m</var>); i++)
  2147. op0[i] = op1[i] ? op2[i] <var>op</var> op3[i] : op4[i];
  2148. </pre></div>
  2149. <p>where, for example, <var>op</var> is <code>+</code> for &lsquo;<samp>cond_add<var>mode</var></samp>&rsquo;.
  2150. </p>
  2151. <p>When defined for floating-point modes, the contents of &lsquo;<samp>op3[i]</samp>&rsquo;
  2152. are not interpreted if &lsquo;<samp>op1[i]</samp>&rsquo; is false, just like they would not
  2153. be in a normal C &lsquo;<samp>?:</samp>&rsquo; condition.
  2154. </p>
  2155. <p>Operands 0, 2, 3 and 4 all have mode <var>m</var>. Operand 1 is a scalar
  2156. integer if <var>m</var> is scalar, otherwise it has the mode returned by
  2157. <code>TARGET_VECTORIZE_GET_MASK_MODE</code>.
  2158. </p>
  2159. <a name="index-cond_005ffmamode-instruction-pattern"></a>
  2160. <a name="index-cond_005ffmsmode-instruction-pattern"></a>
  2161. <a name="index-cond_005ffnmamode-instruction-pattern"></a>
  2162. <a name="index-cond_005ffnmsmode-instruction-pattern"></a>
  2163. </dd>
  2164. <dt>&lsquo;<samp>cond_fma<var>mode</var></samp>&rsquo;</dt>
  2165. <dt>&lsquo;<samp>cond_fms<var>mode</var></samp>&rsquo;</dt>
  2166. <dt>&lsquo;<samp>cond_fnma<var>mode</var></samp>&rsquo;</dt>
  2167. <dt>&lsquo;<samp>cond_fnms<var>mode</var></samp>&rsquo;</dt>
  2168. <dd><p>Like &lsquo;<samp>cond_add<var>m</var></samp>&rsquo;, except that the conditional operation
  2169. takes 3 operands rather than two. For example, the vector form of
  2170. &lsquo;<samp>cond_fma<var>mode</var></samp>&rsquo; is equivalent to:
  2171. </p>
  2172. <div class="smallexample">
  2173. <pre class="smallexample">for (i = 0; i &lt; GET_MODE_NUNITS (<var>m</var>); i++)
  2174. op0[i] = op1[i] ? fma (op2[i], op3[i], op4[i]) : op5[i];
  2175. </pre></div>
  2176. <a name="index-negmodecc-instruction-pattern"></a>
  2177. </dd>
  2178. <dt>&lsquo;<samp>neg<var>mode</var>cc</samp>&rsquo;</dt>
  2179. <dd><p>Similar to &lsquo;<samp>mov<var>mode</var>cc</samp>&rsquo; but for conditional negation. Conditionally
  2180. move the negation of operand 2 or the unchanged operand 3 into operand 0
  2181. according to the comparison in operand 1. If the comparison is true, the negation
  2182. of operand 2 is moved into operand 0, otherwise operand 3 is moved.
  2183. </p>
  2184. <a name="index-notmodecc-instruction-pattern"></a>
  2185. </dd>
  2186. <dt>&lsquo;<samp>not<var>mode</var>cc</samp>&rsquo;</dt>
  2187. <dd><p>Similar to &lsquo;<samp>neg<var>mode</var>cc</samp>&rsquo; but for conditional complement.
  2188. Conditionally move the bitwise complement of operand 2 or the unchanged
  2189. operand 3 into operand 0 according to the comparison in operand 1.
  2190. If the comparison is true, the complement of operand 2 is moved into
  2191. operand 0, otherwise operand 3 is moved.
  2192. </p>
  2193. <a name="index-cstoremode4-instruction-pattern"></a>
  2194. </dd>
  2195. <dt>&lsquo;<samp>cstore<var>mode</var>4</samp>&rsquo;</dt>
  2196. <dd><p>Store zero or nonzero in operand 0 according to whether a comparison
  2197. is true. Operand 1 is a comparison operator. Operand 2 and operand 3
  2198. are the first and second operand of the comparison, respectively.
  2199. You specify the mode that operand 0 must have when you write the
  2200. <code>match_operand</code> expression. The compiler automatically sees which
  2201. mode you have used and supplies an operand of that mode.
  2202. </p>
  2203. <p>The value stored for a true condition must have 1 as its low bit, or
  2204. else must be negative. Otherwise the instruction is not suitable and
  2205. you should omit it from the machine description. You describe to the
  2206. compiler exactly which value is stored by defining the macro
  2207. <code>STORE_FLAG_VALUE</code> (see <a href="Misc.html#Misc">Misc</a>). If a description cannot be
  2208. found that can be used for all the possible comparison operators, you
  2209. should pick one and use a <code>define_expand</code> to map all results
  2210. onto the one you chose.
  2211. </p>
  2212. <p>These operations may <code>FAIL</code>, but should do so only in relatively
  2213. uncommon cases; if they would <code>FAIL</code> for common cases involving
  2214. integer comparisons, it is best to restrict the predicates to not
  2215. allow these operands. Likewise if a given comparison operator will
  2216. always fail, independent of the operands (for floating-point modes, the
  2217. <code>ordered_comparison_operator</code> predicate is often useful in this case).
  2218. </p>
  2219. <p>If this pattern is omitted, the compiler will generate a conditional
  2220. branch&mdash;for example, it may copy a constant one to the target and branching
  2221. around an assignment of zero to the target&mdash;or a libcall. If the predicate
  2222. for operand 1 only rejects some operators, it will also try reordering the
  2223. operands and/or inverting the result value (e.g. by an exclusive OR).
  2224. These possibilities could be cheaper or equivalent to the instructions
  2225. used for the &lsquo;<samp>cstore<var>mode</var>4</samp>&rsquo; pattern followed by those required
  2226. to convert a positive result from <code>STORE_FLAG_VALUE</code> to 1; in this
  2227. case, you can and should make operand 1&rsquo;s predicate reject some operators
  2228. in the &lsquo;<samp>cstore<var>mode</var>4</samp>&rsquo; pattern, or remove the pattern altogether
  2229. from the machine description.
  2230. </p>
  2231. <a name="index-cbranchmode4-instruction-pattern"></a>
  2232. </dd>
  2233. <dt>&lsquo;<samp>cbranch<var>mode</var>4</samp>&rsquo;</dt>
  2234. <dd><p>Conditional branch instruction combined with a compare instruction.
  2235. Operand 0 is a comparison operator. Operand 1 and operand 2 are the
  2236. first and second operands of the comparison, respectively. Operand 3
  2237. is the <code>code_label</code> to jump to.
  2238. </p>
  2239. <a name="index-jump-instruction-pattern"></a>
  2240. </dd>
  2241. <dt>&lsquo;<samp>jump</samp>&rsquo;</dt>
  2242. <dd><p>A jump inside a function; an unconditional branch. Operand 0 is the
  2243. <code>code_label</code> to jump to. This pattern name is mandatory on all
  2244. machines.
  2245. </p>
  2246. <a name="index-call-instruction-pattern"></a>
  2247. </dd>
  2248. <dt>&lsquo;<samp>call</samp>&rsquo;</dt>
  2249. <dd><p>Subroutine call instruction returning no value. Operand 0 is the
  2250. function to call; operand 1 is the number of bytes of arguments pushed
  2251. as a <code>const_int</code>; operand 2 is the number of registers used as
  2252. operands.
  2253. </p>
  2254. <p>On most machines, operand 2 is not actually stored into the RTL
  2255. pattern. It is supplied for the sake of some RISC machines which need
  2256. to put this information into the assembler code; they can put it in
  2257. the RTL instead of operand 1.
  2258. </p>
  2259. <p>Operand 0 should be a <code>mem</code> RTX whose address is the address of the
  2260. function. Note, however, that this address can be a <code>symbol_ref</code>
  2261. expression even if it would not be a legitimate memory address on the
  2262. target machine. If it is also not a valid argument for a call
  2263. instruction, the pattern for this operation should be a
  2264. <code>define_expand</code> (see <a href="Expander-Definitions.html#Expander-Definitions">Expander Definitions</a>) that places the
  2265. address into a register and uses that register in the call instruction.
  2266. </p>
  2267. <a name="index-call_005fvalue-instruction-pattern"></a>
  2268. </dd>
  2269. <dt>&lsquo;<samp>call_value</samp>&rsquo;</dt>
  2270. <dd><p>Subroutine call instruction returning a value. Operand 0 is the hard
  2271. register in which the value is returned. There are three more
  2272. operands, the same as the three operands of the &lsquo;<samp>call</samp>&rsquo;
  2273. instruction (but with numbers increased by one).
  2274. </p>
  2275. <p>Subroutines that return <code>BLKmode</code> objects use the &lsquo;<samp>call</samp>&rsquo;
  2276. insn.
  2277. </p>
  2278. <a name="index-call_005fpop-instruction-pattern"></a>
  2279. <a name="index-call_005fvalue_005fpop-instruction-pattern"></a>
  2280. </dd>
  2281. <dt>&lsquo;<samp>call_pop</samp>&rsquo;, &lsquo;<samp>call_value_pop</samp>&rsquo;</dt>
  2282. <dd><p>Similar to &lsquo;<samp>call</samp>&rsquo; and &lsquo;<samp>call_value</samp>&rsquo;, except used if defined and
  2283. if <code>RETURN_POPS_ARGS</code> is nonzero. They should emit a <code>parallel</code>
  2284. that contains both the function call and a <code>set</code> to indicate the
  2285. adjustment made to the frame pointer.
  2286. </p>
  2287. <p>For machines where <code>RETURN_POPS_ARGS</code> can be nonzero, the use of these
  2288. patterns increases the number of functions for which the frame pointer
  2289. can be eliminated, if desired.
  2290. </p>
  2291. <a name="index-untyped_005fcall-instruction-pattern"></a>
  2292. </dd>
  2293. <dt>&lsquo;<samp>untyped_call</samp>&rsquo;</dt>
  2294. <dd><p>Subroutine call instruction returning a value of any type. Operand 0 is
  2295. the function to call; operand 1 is a memory location where the result of
  2296. calling the function is to be stored; operand 2 is a <code>parallel</code>
  2297. expression where each element is a <code>set</code> expression that indicates
  2298. the saving of a function return value into the result block.
  2299. </p>
  2300. <p>This instruction pattern should be defined to support
  2301. <code>__builtin_apply</code> on machines where special instructions are needed
  2302. to call a subroutine with arbitrary arguments or to save the value
  2303. returned. This instruction pattern is required on machines that have
  2304. multiple registers that can hold a return value
  2305. (i.e. <code>FUNCTION_VALUE_REGNO_P</code> is true for more than one register).
  2306. </p>
  2307. <a name="index-return-instruction-pattern"></a>
  2308. </dd>
  2309. <dt>&lsquo;<samp>return</samp>&rsquo;</dt>
  2310. <dd><p>Subroutine return instruction. This instruction pattern name should be
  2311. defined only if a single instruction can do all the work of returning
  2312. from a function.
  2313. </p>
  2314. <p>Like the &lsquo;<samp>mov<var>m</var></samp>&rsquo; patterns, this pattern is also used after the
  2315. RTL generation phase. In this case it is to support machines where
  2316. multiple instructions are usually needed to return from a function, but
  2317. some class of functions only requires one instruction to implement a
  2318. return. Normally, the applicable functions are those which do not need
  2319. to save any registers or allocate stack space.
  2320. </p>
  2321. <p>It is valid for this pattern to expand to an instruction using
  2322. <code>simple_return</code> if no epilogue is required.
  2323. </p>
  2324. <a name="index-simple_005freturn-instruction-pattern"></a>
  2325. </dd>
  2326. <dt>&lsquo;<samp>simple_return</samp>&rsquo;</dt>
  2327. <dd><p>Subroutine return instruction. This instruction pattern name should be
  2328. defined only if a single instruction can do all the work of returning
  2329. from a function on a path where no epilogue is required. This pattern
  2330. is very similar to the <code>return</code> instruction pattern, but it is emitted
  2331. only by the shrink-wrapping optimization on paths where the function
  2332. prologue has not been executed, and a function return should occur without
  2333. any of the effects of the epilogue. Additional uses may be introduced on
  2334. paths where both the prologue and the epilogue have executed.
  2335. </p>
  2336. <a name="index-reload_005fcompleted"></a>
  2337. <a name="index-leaf_005ffunction_005fp"></a>
  2338. <p>For such machines, the condition specified in this pattern should only
  2339. be true when <code>reload_completed</code> is nonzero and the function&rsquo;s
  2340. epilogue would only be a single instruction. For machines with register
  2341. windows, the routine <code>leaf_function_p</code> may be used to determine if
  2342. a register window push is required.
  2343. </p>
  2344. <p>Machines that have conditional return instructions should define patterns
  2345. such as
  2346. </p>
  2347. <div class="smallexample">
  2348. <pre class="smallexample">(define_insn &quot;&quot;
  2349. [(set (pc)
  2350. (if_then_else (match_operator
  2351. 0 &quot;comparison_operator&quot;
  2352. [(cc0) (const_int 0)])
  2353. (return)
  2354. (pc)))]
  2355. &quot;<var>condition</var>&quot;
  2356. &quot;&hellip;&quot;)
  2357. </pre></div>
  2358. <p>where <var>condition</var> would normally be the same condition specified on the
  2359. named &lsquo;<samp>return</samp>&rsquo; pattern.
  2360. </p>
  2361. <a name="index-untyped_005freturn-instruction-pattern"></a>
  2362. </dd>
  2363. <dt>&lsquo;<samp>untyped_return</samp>&rsquo;</dt>
  2364. <dd><p>Untyped subroutine return instruction. This instruction pattern should
  2365. be defined to support <code>__builtin_return</code> on machines where special
  2366. instructions are needed to return a value of any type.
  2367. </p>
  2368. <p>Operand 0 is a memory location where the result of calling a function
  2369. with <code>__builtin_apply</code> is stored; operand 1 is a <code>parallel</code>
  2370. expression where each element is a <code>set</code> expression that indicates
  2371. the restoring of a function return value from the result block.
  2372. </p>
  2373. <a name="index-nop-instruction-pattern"></a>
  2374. </dd>
  2375. <dt>&lsquo;<samp>nop</samp>&rsquo;</dt>
  2376. <dd><p>No-op instruction. This instruction pattern name should always be defined
  2377. to output a no-op in assembler code. <code>(const_int 0)</code> will do as an
  2378. RTL pattern.
  2379. </p>
  2380. <a name="index-indirect_005fjump-instruction-pattern"></a>
  2381. </dd>
  2382. <dt>&lsquo;<samp>indirect_jump</samp>&rsquo;</dt>
  2383. <dd><p>An instruction to jump to an address which is operand zero.
  2384. This pattern name is mandatory on all machines.
  2385. </p>
  2386. <a name="index-casesi-instruction-pattern"></a>
  2387. </dd>
  2388. <dt>&lsquo;<samp>casesi</samp>&rsquo;</dt>
  2389. <dd><p>Instruction to jump through a dispatch table, including bounds checking.
  2390. This instruction takes five operands:
  2391. </p>
  2392. <ol>
  2393. <li> The index to dispatch on, which has mode <code>SImode</code>.
  2394. </li><li> The lower bound for indices in the table, an integer constant.
  2395. </li><li> The total range of indices in the table&mdash;the largest index
  2396. minus the smallest one (both inclusive).
  2397. </li><li> A label that precedes the table itself.
  2398. </li><li> A label to jump to if the index has a value outside the bounds.
  2399. </li></ol>
  2400. <p>The table is an <code>addr_vec</code> or <code>addr_diff_vec</code> inside of a
  2401. <code>jump_table_data</code>. The number of elements in the table is one plus the
  2402. difference between the upper bound and the lower bound.
  2403. </p>
  2404. <a name="index-tablejump-instruction-pattern"></a>
  2405. </dd>
  2406. <dt>&lsquo;<samp>tablejump</samp>&rsquo;</dt>
  2407. <dd><p>Instruction to jump to a variable address. This is a low-level
  2408. capability which can be used to implement a dispatch table when there
  2409. is no &lsquo;<samp>casesi</samp>&rsquo; pattern.
  2410. </p>
  2411. <p>This pattern requires two operands: the address or offset, and a label
  2412. which should immediately precede the jump table. If the macro
  2413. <code>CASE_VECTOR_PC_RELATIVE</code> evaluates to a nonzero value then the first
  2414. operand is an offset which counts from the address of the table; otherwise,
  2415. it is an absolute address to jump to. In either case, the first operand has
  2416. mode <code>Pmode</code>.
  2417. </p>
  2418. <p>The &lsquo;<samp>tablejump</samp>&rsquo; insn is always the last insn before the jump
  2419. table it uses. Its assembler code normally has no need to use the
  2420. second operand, but you should incorporate it in the RTL pattern so
  2421. that the jump optimizer will not delete the table as unreachable code.
  2422. </p>
  2423. <a name="index-doloop_005fend-instruction-pattern"></a>
  2424. </dd>
  2425. <dt>&lsquo;<samp>doloop_end</samp>&rsquo;</dt>
  2426. <dd><p>Conditional branch instruction that decrements a register and
  2427. jumps if the register is nonzero. Operand 0 is the register to
  2428. decrement and test; operand 1 is the label to jump to if the
  2429. register is nonzero.
  2430. See <a href="Looping-Patterns.html#Looping-Patterns">Looping Patterns</a>.
  2431. </p>
  2432. <p>This optional instruction pattern should be defined for machines with
  2433. low-overhead looping instructions as the loop optimizer will try to
  2434. modify suitable loops to utilize it. The target hook
  2435. <code>TARGET_CAN_USE_DOLOOP_P</code> controls the conditions under which
  2436. low-overhead loops can be used.
  2437. </p>
  2438. <a name="index-doloop_005fbegin-instruction-pattern"></a>
  2439. </dd>
  2440. <dt>&lsquo;<samp>doloop_begin</samp>&rsquo;</dt>
  2441. <dd><p>Companion instruction to <code>doloop_end</code> required for machines that
  2442. need to perform some initialization, such as loading a special counter
  2443. register. Operand 1 is the associated <code>doloop_end</code> pattern and
  2444. operand 0 is the register that it decrements.
  2445. </p>
  2446. <p>If initialization insns do not always need to be emitted, use a
  2447. <code>define_expand</code> (see <a href="Expander-Definitions.html#Expander-Definitions">Expander Definitions</a>) and make it fail.
  2448. </p>
  2449. <a name="index-canonicalize_005ffuncptr_005ffor_005fcompare-instruction-pattern"></a>
  2450. </dd>
  2451. <dt>&lsquo;<samp>canonicalize_funcptr_for_compare</samp>&rsquo;</dt>
  2452. <dd><p>Canonicalize the function pointer in operand 1 and store the result
  2453. into operand 0.
  2454. </p>
  2455. <p>Operand 0 is always a <code>reg</code> and has mode <code>Pmode</code>; operand 1
  2456. may be a <code>reg</code>, <code>mem</code>, <code>symbol_ref</code>, <code>const_int</code>, etc
  2457. and also has mode <code>Pmode</code>.
  2458. </p>
  2459. <p>Canonicalization of a function pointer usually involves computing
  2460. the address of the function which would be called if the function
  2461. pointer were used in an indirect call.
  2462. </p>
  2463. <p>Only define this pattern if function pointers on the target machine
  2464. can have different values but still call the same function when
  2465. used in an indirect call.
  2466. </p>
  2467. <a name="index-save_005fstack_005fblock-instruction-pattern"></a>
  2468. <a name="index-save_005fstack_005ffunction-instruction-pattern"></a>
  2469. <a name="index-save_005fstack_005fnonlocal-instruction-pattern"></a>
  2470. <a name="index-restore_005fstack_005fblock-instruction-pattern"></a>
  2471. <a name="index-restore_005fstack_005ffunction-instruction-pattern"></a>
  2472. <a name="index-restore_005fstack_005fnonlocal-instruction-pattern"></a>
  2473. </dd>
  2474. <dt>&lsquo;<samp>save_stack_block</samp>&rsquo;</dt>
  2475. <dt>&lsquo;<samp>save_stack_function</samp>&rsquo;</dt>
  2476. <dt>&lsquo;<samp>save_stack_nonlocal</samp>&rsquo;</dt>
  2477. <dt>&lsquo;<samp>restore_stack_block</samp>&rsquo;</dt>
  2478. <dt>&lsquo;<samp>restore_stack_function</samp>&rsquo;</dt>
  2479. <dt>&lsquo;<samp>restore_stack_nonlocal</samp>&rsquo;</dt>
  2480. <dd><p>Most machines save and restore the stack pointer by copying it to or
  2481. from an object of mode <code>Pmode</code>. Do not define these patterns on
  2482. such machines.
  2483. </p>
  2484. <p>Some machines require special handling for stack pointer saves and
  2485. restores. On those machines, define the patterns corresponding to the
  2486. non-standard cases by using a <code>define_expand</code> (see <a href="Expander-Definitions.html#Expander-Definitions">Expander Definitions</a>) that produces the required insns. The three types of
  2487. saves and restores are:
  2488. </p>
  2489. <ol>
  2490. <li> &lsquo;<samp>save_stack_block</samp>&rsquo; saves the stack pointer at the start of a block
  2491. that allocates a variable-sized object, and &lsquo;<samp>restore_stack_block</samp>&rsquo;
  2492. restores the stack pointer when the block is exited.
  2493. </li><li> &lsquo;<samp>save_stack_function</samp>&rsquo; and &lsquo;<samp>restore_stack_function</samp>&rsquo; do a
  2494. similar job for the outermost block of a function and are used when the
  2495. function allocates variable-sized objects or calls <code>alloca</code>. Only
  2496. the epilogue uses the restored stack pointer, allowing a simpler save or
  2497. restore sequence on some machines.
  2498. </li><li> &lsquo;<samp>save_stack_nonlocal</samp>&rsquo; is used in functions that contain labels
  2499. branched to by nested functions. It saves the stack pointer in such a
  2500. way that the inner function can use &lsquo;<samp>restore_stack_nonlocal</samp>&rsquo; to
  2501. restore the stack pointer. The compiler generates code to restore the
  2502. frame and argument pointer registers, but some machines require saving
  2503. and restoring additional data such as register window information or
  2504. stack backchains. Place insns in these patterns to save and restore any
  2505. such required data.
  2506. </li></ol>
  2507. <p>When saving the stack pointer, operand 0 is the save area and operand 1
  2508. is the stack pointer. The mode used to allocate the save area defaults
  2509. to <code>Pmode</code> but you can override that choice by defining the
  2510. <code>STACK_SAVEAREA_MODE</code> macro (see <a href="Storage-Layout.html#Storage-Layout">Storage Layout</a>). You must
  2511. specify an integral mode, or <code>VOIDmode</code> if no save area is needed
  2512. for a particular type of save (either because no save is needed or
  2513. because a machine-specific save area can be used). Operand 0 is the
  2514. stack pointer and operand 1 is the save area for restore operations. If
  2515. &lsquo;<samp>save_stack_block</samp>&rsquo; is defined, operand 0 must not be
  2516. <code>VOIDmode</code> since these saves can be arbitrarily nested.
  2517. </p>
  2518. <p>A save area is a <code>mem</code> that is at a constant offset from
  2519. <code>virtual_stack_vars_rtx</code> when the stack pointer is saved for use by
  2520. nonlocal gotos and a <code>reg</code> in the other two cases.
  2521. </p>
  2522. <a name="index-allocate_005fstack-instruction-pattern"></a>
  2523. </dd>
  2524. <dt>&lsquo;<samp>allocate_stack</samp>&rsquo;</dt>
  2525. <dd><p>Subtract (or add if <code>STACK_GROWS_DOWNWARD</code> is undefined) operand 1 from
  2526. the stack pointer to create space for dynamically allocated data.
  2527. </p>
  2528. <p>Store the resultant pointer to this space into operand 0. If you
  2529. are allocating space from the main stack, do this by emitting a
  2530. move insn to copy <code>virtual_stack_dynamic_rtx</code> to operand 0.
  2531. If you are allocating the space elsewhere, generate code to copy the
  2532. location of the space to operand 0. In the latter case, you must
  2533. ensure this space gets freed when the corresponding space on the main
  2534. stack is free.
  2535. </p>
  2536. <p>Do not define this pattern if all that must be done is the subtraction.
  2537. Some machines require other operations such as stack probes or
  2538. maintaining the back chain. Define this pattern to emit those
  2539. operations in addition to updating the stack pointer.
  2540. </p>
  2541. <a name="index-check_005fstack-instruction-pattern"></a>
  2542. </dd>
  2543. <dt>&lsquo;<samp>check_stack</samp>&rsquo;</dt>
  2544. <dd><p>If stack checking (see <a href="Stack-Checking.html#Stack-Checking">Stack Checking</a>) cannot be done on your system by
  2545. probing the stack, define this pattern to perform the needed check and signal
  2546. an error if the stack has overflowed. The single operand is the address in
  2547. the stack farthest from the current stack pointer that you need to validate.
  2548. Normally, on platforms where this pattern is needed, you would obtain the
  2549. stack limit from a global or thread-specific variable or register.
  2550. </p>
  2551. <a name="index-probe_005fstack_005faddress-instruction-pattern"></a>
  2552. </dd>
  2553. <dt>&lsquo;<samp>probe_stack_address</samp>&rsquo;</dt>
  2554. <dd><p>If stack checking (see <a href="Stack-Checking.html#Stack-Checking">Stack Checking</a>) can be done on your system by
  2555. probing the stack but without the need to actually access it, define this
  2556. pattern and signal an error if the stack has overflowed. The single operand
  2557. is the memory address in the stack that needs to be probed.
  2558. </p>
  2559. <a name="index-probe_005fstack-instruction-pattern"></a>
  2560. </dd>
  2561. <dt>&lsquo;<samp>probe_stack</samp>&rsquo;</dt>
  2562. <dd><p>If stack checking (see <a href="Stack-Checking.html#Stack-Checking">Stack Checking</a>) can be done on your system by
  2563. probing the stack but doing it with a &ldquo;store zero&rdquo; instruction is not valid
  2564. or optimal, define this pattern to do the probing differently and signal an
  2565. error if the stack has overflowed. The single operand is the memory reference
  2566. in the stack that needs to be probed.
  2567. </p>
  2568. <a name="index-nonlocal_005fgoto-instruction-pattern"></a>
  2569. </dd>
  2570. <dt>&lsquo;<samp>nonlocal_goto</samp>&rsquo;</dt>
  2571. <dd><p>Emit code to generate a non-local goto, e.g., a jump from one function
  2572. to a label in an outer function. This pattern has four arguments,
  2573. each representing a value to be used in the jump. The first
  2574. argument is to be loaded into the frame pointer, the second is
  2575. the address to branch to (code to dispatch to the actual label),
  2576. the third is the address of a location where the stack is saved,
  2577. and the last is the address of the label, to be placed in the
  2578. location for the incoming static chain.
  2579. </p>
  2580. <p>On most machines you need not define this pattern, since GCC will
  2581. already generate the correct code, which is to load the frame pointer
  2582. and static chain, restore the stack (using the
  2583. &lsquo;<samp>restore_stack_nonlocal</samp>&rsquo; pattern, if defined), and jump indirectly
  2584. to the dispatcher. You need only define this pattern if this code will
  2585. not work on your machine.
  2586. </p>
  2587. <a name="index-nonlocal_005fgoto_005freceiver-instruction-pattern"></a>
  2588. </dd>
  2589. <dt>&lsquo;<samp>nonlocal_goto_receiver</samp>&rsquo;</dt>
  2590. <dd><p>This pattern, if defined, contains code needed at the target of a
  2591. nonlocal goto after the code already generated by GCC. You will not
  2592. normally need to define this pattern. A typical reason why you might
  2593. need this pattern is if some value, such as a pointer to a global table,
  2594. must be restored when the frame pointer is restored. Note that a nonlocal
  2595. goto only occurs within a unit-of-translation, so a global table pointer
  2596. that is shared by all functions of a given module need not be restored.
  2597. There are no arguments.
  2598. </p>
  2599. <a name="index-exception_005freceiver-instruction-pattern"></a>
  2600. </dd>
  2601. <dt>&lsquo;<samp>exception_receiver</samp>&rsquo;</dt>
  2602. <dd><p>This pattern, if defined, contains code needed at the site of an
  2603. exception handler that isn&rsquo;t needed at the site of a nonlocal goto. You
  2604. will not normally need to define this pattern. A typical reason why you
  2605. might need this pattern is if some value, such as a pointer to a global
  2606. table, must be restored after control flow is branched to the handler of
  2607. an exception. There are no arguments.
  2608. </p>
  2609. <a name="index-builtin_005fsetjmp_005fsetup-instruction-pattern"></a>
  2610. </dd>
  2611. <dt>&lsquo;<samp>builtin_setjmp_setup</samp>&rsquo;</dt>
  2612. <dd><p>This pattern, if defined, contains additional code needed to initialize
  2613. the <code>jmp_buf</code>. You will not normally need to define this pattern.
  2614. A typical reason why you might need this pattern is if some value, such
  2615. as a pointer to a global table, must be restored. Though it is
  2616. preferred that the pointer value be recalculated if possible (given the
  2617. address of a label for instance). The single argument is a pointer to
  2618. the <code>jmp_buf</code>. Note that the buffer is five words long and that
  2619. the first three are normally used by the generic mechanism.
  2620. </p>
  2621. <a name="index-builtin_005fsetjmp_005freceiver-instruction-pattern"></a>
  2622. </dd>
  2623. <dt>&lsquo;<samp>builtin_setjmp_receiver</samp>&rsquo;</dt>
  2624. <dd><p>This pattern, if defined, contains code needed at the site of a
  2625. built-in setjmp that isn&rsquo;t needed at the site of a nonlocal goto. You
  2626. will not normally need to define this pattern. A typical reason why you
  2627. might need this pattern is if some value, such as a pointer to a global
  2628. table, must be restored. It takes one argument, which is the label
  2629. to which builtin_longjmp transferred control; this pattern may be emitted
  2630. at a small offset from that label.
  2631. </p>
  2632. <a name="index-builtin_005flongjmp-instruction-pattern"></a>
  2633. </dd>
  2634. <dt>&lsquo;<samp>builtin_longjmp</samp>&rsquo;</dt>
  2635. <dd><p>This pattern, if defined, performs the entire action of the longjmp.
  2636. You will not normally need to define this pattern unless you also define
  2637. <code>builtin_setjmp_setup</code>. The single argument is a pointer to the
  2638. <code>jmp_buf</code>.
  2639. </p>
  2640. <a name="index-eh_005freturn-instruction-pattern"></a>
  2641. </dd>
  2642. <dt>&lsquo;<samp>eh_return</samp>&rsquo;</dt>
  2643. <dd><p>This pattern, if defined, affects the way <code>__builtin_eh_return</code>,
  2644. and thence the call frame exception handling library routines, are
  2645. built. It is intended to handle non-trivial actions needed along
  2646. the abnormal return path.
  2647. </p>
  2648. <p>The address of the exception handler to which the function should return
  2649. is passed as operand to this pattern. It will normally need to copied by
  2650. the pattern to some special register or memory location.
  2651. If the pattern needs to determine the location of the target call
  2652. frame in order to do so, it may use <code>EH_RETURN_STACKADJ_RTX</code>,
  2653. if defined; it will have already been assigned.
  2654. </p>
  2655. <p>If this pattern is not defined, the default action will be to simply
  2656. copy the return address to <code>EH_RETURN_HANDLER_RTX</code>. Either
  2657. that macro or this pattern needs to be defined if call frame exception
  2658. handling is to be used.
  2659. </p>
  2660. <a name="index-prologue-instruction-pattern"></a>
  2661. <a name="prologue-instruction-pattern"></a></dd>
  2662. <dt>&lsquo;<samp>prologue</samp>&rsquo;</dt>
  2663. <dd><p>This pattern, if defined, emits RTL for entry to a function. The function
  2664. entry is responsible for setting up the stack frame, initializing the frame
  2665. pointer register, saving callee saved registers, etc.
  2666. </p>
  2667. <p>Using a prologue pattern is generally preferred over defining
  2668. <code>TARGET_ASM_FUNCTION_PROLOGUE</code> to emit assembly code for the prologue.
  2669. </p>
  2670. <p>The <code>prologue</code> pattern is particularly useful for targets which perform
  2671. instruction scheduling.
  2672. </p>
  2673. <a name="index-window_005fsave-instruction-pattern"></a>
  2674. <a name="window_005fsave-instruction-pattern"></a></dd>
  2675. <dt>&lsquo;<samp>window_save</samp>&rsquo;</dt>
  2676. <dd><p>This pattern, if defined, emits RTL for a register window save. It should
  2677. be defined if the target machine has register windows but the window events
  2678. are decoupled from calls to subroutines. The canonical example is the SPARC
  2679. architecture.
  2680. </p>
  2681. <a name="index-epilogue-instruction-pattern"></a>
  2682. <a name="epilogue-instruction-pattern"></a></dd>
  2683. <dt>&lsquo;<samp>epilogue</samp>&rsquo;</dt>
  2684. <dd><p>This pattern emits RTL for exit from a function. The function
  2685. exit is responsible for deallocating the stack frame, restoring callee saved
  2686. registers and emitting the return instruction.
  2687. </p>
  2688. <p>Using an epilogue pattern is generally preferred over defining
  2689. <code>TARGET_ASM_FUNCTION_EPILOGUE</code> to emit assembly code for the epilogue.
  2690. </p>
  2691. <p>The <code>epilogue</code> pattern is particularly useful for targets which perform
  2692. instruction scheduling or which have delay slots for their return instruction.
  2693. </p>
  2694. <a name="index-sibcall_005fepilogue-instruction-pattern"></a>
  2695. </dd>
  2696. <dt>&lsquo;<samp>sibcall_epilogue</samp>&rsquo;</dt>
  2697. <dd><p>This pattern, if defined, emits RTL for exit from a function without the final
  2698. branch back to the calling function. This pattern will be emitted before any
  2699. sibling call (aka tail call) sites.
  2700. </p>
  2701. <p>The <code>sibcall_epilogue</code> pattern must not clobber any arguments used for
  2702. parameter passing or any stack slots for arguments passed to the current
  2703. function.
  2704. </p>
  2705. <a name="index-trap-instruction-pattern"></a>
  2706. </dd>
  2707. <dt>&lsquo;<samp>trap</samp>&rsquo;</dt>
  2708. <dd><p>This pattern, if defined, signals an error, typically by causing some
  2709. kind of signal to be raised.
  2710. </p>
  2711. <a name="index-ctrapMM4-instruction-pattern"></a>
  2712. </dd>
  2713. <dt>&lsquo;<samp>ctrap<var>MM</var>4</samp>&rsquo;</dt>
  2714. <dd><p>Conditional trap instruction. Operand 0 is a piece of RTL which
  2715. performs a comparison, and operands 1 and 2 are the arms of the
  2716. comparison. Operand 3 is the trap code, an integer.
  2717. </p>
  2718. <p>A typical <code>ctrap</code> pattern looks like
  2719. </p>
  2720. <div class="smallexample">
  2721. <pre class="smallexample">(define_insn &quot;ctrapsi4&quot;
  2722. [(trap_if (match_operator 0 &quot;trap_operator&quot;
  2723. [(match_operand 1 &quot;register_operand&quot;)
  2724. (match_operand 2 &quot;immediate_operand&quot;)])
  2725. (match_operand 3 &quot;const_int_operand&quot; &quot;i&quot;))]
  2726. &quot;&quot;
  2727. &quot;&hellip;&quot;)
  2728. </pre></div>
  2729. <a name="index-prefetch-instruction-pattern"></a>
  2730. </dd>
  2731. <dt>&lsquo;<samp>prefetch</samp>&rsquo;</dt>
  2732. <dd><p>This pattern, if defined, emits code for a non-faulting data prefetch
  2733. instruction. Operand 0 is the address of the memory to prefetch. Operand 1
  2734. is a constant 1 if the prefetch is preparing for a write to the memory
  2735. address, or a constant 0 otherwise. Operand 2 is the expected degree of
  2736. temporal locality of the data and is a value between 0 and 3, inclusive; 0
  2737. means that the data has no temporal locality, so it need not be left in the
  2738. cache after the access; 3 means that the data has a high degree of temporal
  2739. locality and should be left in all levels of cache possible; 1 and 2 mean,
  2740. respectively, a low or moderate degree of temporal locality.
  2741. </p>
  2742. <p>Targets that do not support write prefetches or locality hints can ignore
  2743. the values of operands 1 and 2.
  2744. </p>
  2745. <a name="index-blockage-instruction-pattern"></a>
  2746. </dd>
  2747. <dt>&lsquo;<samp>blockage</samp>&rsquo;</dt>
  2748. <dd><p>This pattern defines a pseudo insn that prevents the instruction
  2749. scheduler and other passes from moving instructions and using register
  2750. equivalences across the boundary defined by the blockage insn.
  2751. This needs to be an UNSPEC_VOLATILE pattern or a volatile ASM.
  2752. </p>
  2753. <a name="index-memory_005fblockage-instruction-pattern"></a>
  2754. </dd>
  2755. <dt>&lsquo;<samp>memory_blockage</samp>&rsquo;</dt>
  2756. <dd><p>This pattern, if defined, represents a compiler memory barrier, and will be
  2757. placed at points across which RTL passes may not propagate memory accesses.
  2758. This instruction needs to read and write volatile BLKmode memory. It does
  2759. not need to generate any machine instruction. If this pattern is not defined,
  2760. the compiler falls back to emitting an instruction corresponding
  2761. to <code>asm volatile (&quot;&quot; ::: &quot;memory&quot;)</code>.
  2762. </p>
  2763. <a name="index-memory_005fbarrier-instruction-pattern"></a>
  2764. </dd>
  2765. <dt>&lsquo;<samp>memory_barrier</samp>&rsquo;</dt>
  2766. <dd><p>If the target memory model is not fully synchronous, then this pattern
  2767. should be defined to an instruction that orders both loads and stores
  2768. before the instruction with respect to loads and stores after the instruction.
  2769. This pattern has no operands.
  2770. </p>
  2771. <a name="index-speculation_005fbarrier-instruction-pattern"></a>
  2772. </dd>
  2773. <dt>&lsquo;<samp>speculation_barrier</samp>&rsquo;</dt>
  2774. <dd><p>If the target can support speculative execution, then this pattern should
  2775. be defined to an instruction that will block subsequent execution until
  2776. any prior speculation conditions has been resolved. The pattern must also
  2777. ensure that the compiler cannot move memory operations past the barrier,
  2778. so it needs to be an UNSPEC_VOLATILE pattern. The pattern has no
  2779. operands.
  2780. </p>
  2781. <p>If this pattern is not defined then the default expansion of
  2782. <code>__builtin_speculation_safe_value</code> will emit a warning. You can
  2783. suppress this warning by defining this pattern with a final condition
  2784. of <code>0</code> (zero), which tells the compiler that a speculation
  2785. barrier is not needed for this target.
  2786. </p>
  2787. <a name="index-sync_005fcompare_005fand_005fswapmode-instruction-pattern"></a>
  2788. </dd>
  2789. <dt>&lsquo;<samp>sync_compare_and_swap<var>mode</var></samp>&rsquo;</dt>
  2790. <dd><p>This pattern, if defined, emits code for an atomic compare-and-swap
  2791. operation. Operand 1 is the memory on which the atomic operation is
  2792. performed. Operand 2 is the &ldquo;old&rdquo; value to be compared against the
  2793. current contents of the memory location. Operand 3 is the &ldquo;new&rdquo; value
  2794. to store in the memory if the compare succeeds. Operand 0 is the result
  2795. of the operation; it should contain the contents of the memory
  2796. before the operation. If the compare succeeds, this should obviously be
  2797. a copy of operand 2.
  2798. </p>
  2799. <p>This pattern must show that both operand 0 and operand 1 are modified.
  2800. </p>
  2801. <p>This pattern must issue any memory barrier instructions such that all
  2802. memory operations before the atomic operation occur before the atomic
  2803. operation and all memory operations after the atomic operation occur
  2804. after the atomic operation.
  2805. </p>
  2806. <p>For targets where the success or failure of the compare-and-swap
  2807. operation is available via the status flags, it is possible to
  2808. avoid a separate compare operation and issue the subsequent
  2809. branch or store-flag operation immediately after the compare-and-swap.
  2810. To this end, GCC will look for a <code>MODE_CC</code> set in the
  2811. output of <code>sync_compare_and_swap<var>mode</var></code>; if the machine
  2812. description includes such a set, the target should also define special
  2813. <code>cbranchcc4</code> and/or <code>cstorecc4</code> instructions. GCC will then
  2814. be able to take the destination of the <code>MODE_CC</code> set and pass it
  2815. to the <code>cbranchcc4</code> or <code>cstorecc4</code> pattern as the first
  2816. operand of the comparison (the second will be <code>(const_int 0)</code>).
  2817. </p>
  2818. <p>For targets where the operating system may provide support for this
  2819. operation via library calls, the <code>sync_compare_and_swap_optab</code>
  2820. may be initialized to a function with the same interface as the
  2821. <code>__sync_val_compare_and_swap_<var>n</var></code> built-in. If the entire
  2822. set of <var>__sync</var> builtins are supported via library calls, the
  2823. target can initialize all of the optabs at once with
  2824. <code>init_sync_libfuncs</code>.
  2825. For the purposes of C++11 <code>std::atomic::is_lock_free</code>, it is
  2826. assumed that these library calls do <em>not</em> use any kind of
  2827. interruptable locking.
  2828. </p>
  2829. <a name="index-sync_005faddmode-instruction-pattern"></a>
  2830. <a name="index-sync_005fsubmode-instruction-pattern"></a>
  2831. <a name="index-sync_005fiormode-instruction-pattern"></a>
  2832. <a name="index-sync_005fandmode-instruction-pattern"></a>
  2833. <a name="index-sync_005fxormode-instruction-pattern"></a>
  2834. <a name="index-sync_005fnandmode-instruction-pattern"></a>
  2835. </dd>
  2836. <dt>&lsquo;<samp>sync_add<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_sub<var>mode</var></samp>&rsquo;</dt>
  2837. <dt>&lsquo;<samp>sync_ior<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_and<var>mode</var></samp>&rsquo;</dt>
  2838. <dt>&lsquo;<samp>sync_xor<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_nand<var>mode</var></samp>&rsquo;</dt>
  2839. <dd><p>These patterns emit code for an atomic operation on memory.
  2840. Operand 0 is the memory on which the atomic operation is performed.
  2841. Operand 1 is the second operand to the binary operator.
  2842. </p>
  2843. <p>This pattern must issue any memory barrier instructions such that all
  2844. memory operations before the atomic operation occur before the atomic
  2845. operation and all memory operations after the atomic operation occur
  2846. after the atomic operation.
  2847. </p>
  2848. <p>If these patterns are not defined, the operation will be constructed
  2849. from a compare-and-swap operation, if defined.
  2850. </p>
  2851. <a name="index-sync_005fold_005faddmode-instruction-pattern"></a>
  2852. <a name="index-sync_005fold_005fsubmode-instruction-pattern"></a>
  2853. <a name="index-sync_005fold_005fiormode-instruction-pattern"></a>
  2854. <a name="index-sync_005fold_005fandmode-instruction-pattern"></a>
  2855. <a name="index-sync_005fold_005fxormode-instruction-pattern"></a>
  2856. <a name="index-sync_005fold_005fnandmode-instruction-pattern"></a>
  2857. </dd>
  2858. <dt>&lsquo;<samp>sync_old_add<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_old_sub<var>mode</var></samp>&rsquo;</dt>
  2859. <dt>&lsquo;<samp>sync_old_ior<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_old_and<var>mode</var></samp>&rsquo;</dt>
  2860. <dt>&lsquo;<samp>sync_old_xor<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_old_nand<var>mode</var></samp>&rsquo;</dt>
  2861. <dd><p>These patterns emit code for an atomic operation on memory,
  2862. and return the value that the memory contained before the operation.
  2863. Operand 0 is the result value, operand 1 is the memory on which the
  2864. atomic operation is performed, and operand 2 is the second operand
  2865. to the binary operator.
  2866. </p>
  2867. <p>This pattern must issue any memory barrier instructions such that all
  2868. memory operations before the atomic operation occur before the atomic
  2869. operation and all memory operations after the atomic operation occur
  2870. after the atomic operation.
  2871. </p>
  2872. <p>If these patterns are not defined, the operation will be constructed
  2873. from a compare-and-swap operation, if defined.
  2874. </p>
  2875. <a name="index-sync_005fnew_005faddmode-instruction-pattern"></a>
  2876. <a name="index-sync_005fnew_005fsubmode-instruction-pattern"></a>
  2877. <a name="index-sync_005fnew_005fiormode-instruction-pattern"></a>
  2878. <a name="index-sync_005fnew_005fandmode-instruction-pattern"></a>
  2879. <a name="index-sync_005fnew_005fxormode-instruction-pattern"></a>
  2880. <a name="index-sync_005fnew_005fnandmode-instruction-pattern"></a>
  2881. </dd>
  2882. <dt>&lsquo;<samp>sync_new_add<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_new_sub<var>mode</var></samp>&rsquo;</dt>
  2883. <dt>&lsquo;<samp>sync_new_ior<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_new_and<var>mode</var></samp>&rsquo;</dt>
  2884. <dt>&lsquo;<samp>sync_new_xor<var>mode</var></samp>&rsquo;, &lsquo;<samp>sync_new_nand<var>mode</var></samp>&rsquo;</dt>
  2885. <dd><p>These patterns are like their <code>sync_old_<var>op</var></code> counterparts,
  2886. except that they return the value that exists in the memory location
  2887. after the operation, rather than before the operation.
  2888. </p>
  2889. <a name="index-sync_005flock_005ftest_005fand_005fsetmode-instruction-pattern"></a>
  2890. </dd>
  2891. <dt>&lsquo;<samp>sync_lock_test_and_set<var>mode</var></samp>&rsquo;</dt>
  2892. <dd><p>This pattern takes two forms, based on the capabilities of the target.
  2893. In either case, operand 0 is the result of the operand, operand 1 is
  2894. the memory on which the atomic operation is performed, and operand 2
  2895. is the value to set in the lock.
  2896. </p>
  2897. <p>In the ideal case, this operation is an atomic exchange operation, in
  2898. which the previous value in memory operand is copied into the result
  2899. operand, and the value operand is stored in the memory operand.
  2900. </p>
  2901. <p>For less capable targets, any value operand that is not the constant 1
  2902. should be rejected with <code>FAIL</code>. In this case the target may use
  2903. an atomic test-and-set bit operation. The result operand should contain
  2904. 1 if the bit was previously set and 0 if the bit was previously clear.
  2905. The true contents of the memory operand are implementation defined.
  2906. </p>
  2907. <p>This pattern must issue any memory barrier instructions such that the
  2908. pattern as a whole acts as an acquire barrier, that is all memory
  2909. operations after the pattern do not occur until the lock is acquired.
  2910. </p>
  2911. <p>If this pattern is not defined, the operation will be constructed from
  2912. a compare-and-swap operation, if defined.
  2913. </p>
  2914. <a name="index-sync_005flock_005freleasemode-instruction-pattern"></a>
  2915. </dd>
  2916. <dt>&lsquo;<samp>sync_lock_release<var>mode</var></samp>&rsquo;</dt>
  2917. <dd><p>This pattern, if defined, releases a lock set by
  2918. <code>sync_lock_test_and_set<var>mode</var></code>. Operand 0 is the memory
  2919. that contains the lock; operand 1 is the value to store in the lock.
  2920. </p>
  2921. <p>If the target doesn&rsquo;t implement full semantics for
  2922. <code>sync_lock_test_and_set<var>mode</var></code>, any value operand which is not
  2923. the constant 0 should be rejected with <code>FAIL</code>, and the true contents
  2924. of the memory operand are implementation defined.
  2925. </p>
  2926. <p>This pattern must issue any memory barrier instructions such that the
  2927. pattern as a whole acts as a release barrier, that is the lock is
  2928. released only after all previous memory operations have completed.
  2929. </p>
  2930. <p>If this pattern is not defined, then a <code>memory_barrier</code> pattern
  2931. will be emitted, followed by a store of the value to the memory operand.
  2932. </p>
  2933. <a name="index-atomic_005fcompare_005fand_005fswapmode-instruction-pattern"></a>
  2934. </dd>
  2935. <dt>&lsquo;<samp>atomic_compare_and_swap<var>mode</var></samp>&rsquo;</dt>
  2936. <dd><p>This pattern, if defined, emits code for an atomic compare-and-swap
  2937. operation with memory model semantics. Operand 2 is the memory on which
  2938. the atomic operation is performed. Operand 0 is an output operand which
  2939. is set to true or false based on whether the operation succeeded. Operand
  2940. 1 is an output operand which is set to the contents of the memory before
  2941. the operation was attempted. Operand 3 is the value that is expected to
  2942. be in memory. Operand 4 is the value to put in memory if the expected
  2943. value is found there. Operand 5 is set to 1 if this compare and swap is to
  2944. be treated as a weak operation. Operand 6 is the memory model to be used
  2945. if the operation is a success. Operand 7 is the memory model to be used
  2946. if the operation fails.
  2947. </p>
  2948. <p>If memory referred to in operand 2 contains the value in operand 3, then
  2949. operand 4 is stored in memory pointed to by operand 2 and fencing based on
  2950. the memory model in operand 6 is issued.
  2951. </p>
  2952. <p>If memory referred to in operand 2 does not contain the value in operand 3,
  2953. then fencing based on the memory model in operand 7 is issued.
  2954. </p>
  2955. <p>If a target does not support weak compare-and-swap operations, or the port
  2956. elects not to implement weak operations, the argument in operand 5 can be
  2957. ignored. Note a strong implementation must be provided.
  2958. </p>
  2959. <p>If this pattern is not provided, the <code>__atomic_compare_exchange</code>
  2960. built-in functions will utilize the legacy <code>sync_compare_and_swap</code>
  2961. pattern with an <code>__ATOMIC_SEQ_CST</code> memory model.
  2962. </p>
  2963. <a name="index-atomic_005floadmode-instruction-pattern"></a>
  2964. </dd>
  2965. <dt>&lsquo;<samp>atomic_load<var>mode</var></samp>&rsquo;</dt>
  2966. <dd><p>This pattern implements an atomic load operation with memory model
  2967. semantics. Operand 1 is the memory address being loaded from. Operand 0
  2968. is the result of the load. Operand 2 is the memory model to be used for
  2969. the load operation.
  2970. </p>
  2971. <p>If not present, the <code>__atomic_load</code> built-in function will either
  2972. resort to a normal load with memory barriers, or a compare-and-swap
  2973. operation if a normal load would not be atomic.
  2974. </p>
  2975. <a name="index-atomic_005fstoremode-instruction-pattern"></a>
  2976. </dd>
  2977. <dt>&lsquo;<samp>atomic_store<var>mode</var></samp>&rsquo;</dt>
  2978. <dd><p>This pattern implements an atomic store operation with memory model
  2979. semantics. Operand 0 is the memory address being stored to. Operand 1
  2980. is the value to be written. Operand 2 is the memory model to be used for
  2981. the operation.
  2982. </p>
  2983. <p>If not present, the <code>__atomic_store</code> built-in function will attempt to
  2984. perform a normal store and surround it with any required memory fences. If
  2985. the store would not be atomic, then an <code>__atomic_exchange</code> is
  2986. attempted with the result being ignored.
  2987. </p>
  2988. <a name="index-atomic_005fexchangemode-instruction-pattern"></a>
  2989. </dd>
  2990. <dt>&lsquo;<samp>atomic_exchange<var>mode</var></samp>&rsquo;</dt>
  2991. <dd><p>This pattern implements an atomic exchange operation with memory model
  2992. semantics. Operand 1 is the memory location the operation is performed on.
  2993. Operand 0 is an output operand which is set to the original value contained
  2994. in the memory pointed to by operand 1. Operand 2 is the value to be
  2995. stored. Operand 3 is the memory model to be used.
  2996. </p>
  2997. <p>If this pattern is not present, the built-in function
  2998. <code>__atomic_exchange</code> will attempt to preform the operation with a
  2999. compare and swap loop.
  3000. </p>
  3001. <a name="index-atomic_005faddmode-instruction-pattern"></a>
  3002. <a name="index-atomic_005fsubmode-instruction-pattern"></a>
  3003. <a name="index-atomic_005formode-instruction-pattern"></a>
  3004. <a name="index-atomic_005fandmode-instruction-pattern"></a>
  3005. <a name="index-atomic_005fxormode-instruction-pattern"></a>
  3006. <a name="index-atomic_005fnandmode-instruction-pattern"></a>
  3007. </dd>
  3008. <dt>&lsquo;<samp>atomic_add<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_sub<var>mode</var></samp>&rsquo;</dt>
  3009. <dt>&lsquo;<samp>atomic_or<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_and<var>mode</var></samp>&rsquo;</dt>
  3010. <dt>&lsquo;<samp>atomic_xor<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_nand<var>mode</var></samp>&rsquo;</dt>
  3011. <dd><p>These patterns emit code for an atomic operation on memory with memory
  3012. model semantics. Operand 0 is the memory on which the atomic operation is
  3013. performed. Operand 1 is the second operand to the binary operator.
  3014. Operand 2 is the memory model to be used by the operation.
  3015. </p>
  3016. <p>If these patterns are not defined, attempts will be made to use legacy
  3017. <code>sync</code> patterns, or equivalent patterns which return a result. If
  3018. none of these are available a compare-and-swap loop will be used.
  3019. </p>
  3020. <a name="index-atomic_005ffetch_005faddmode-instruction-pattern"></a>
  3021. <a name="index-atomic_005ffetch_005fsubmode-instruction-pattern"></a>
  3022. <a name="index-atomic_005ffetch_005formode-instruction-pattern"></a>
  3023. <a name="index-atomic_005ffetch_005fandmode-instruction-pattern"></a>
  3024. <a name="index-atomic_005ffetch_005fxormode-instruction-pattern"></a>
  3025. <a name="index-atomic_005ffetch_005fnandmode-instruction-pattern"></a>
  3026. </dd>
  3027. <dt>&lsquo;<samp>atomic_fetch_add<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_fetch_sub<var>mode</var></samp>&rsquo;</dt>
  3028. <dt>&lsquo;<samp>atomic_fetch_or<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_fetch_and<var>mode</var></samp>&rsquo;</dt>
  3029. <dt>&lsquo;<samp>atomic_fetch_xor<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_fetch_nand<var>mode</var></samp>&rsquo;</dt>
  3030. <dd><p>These patterns emit code for an atomic operation on memory with memory
  3031. model semantics, and return the original value. Operand 0 is an output
  3032. operand which contains the value of the memory location before the
  3033. operation was performed. Operand 1 is the memory on which the atomic
  3034. operation is performed. Operand 2 is the second operand to the binary
  3035. operator. Operand 3 is the memory model to be used by the operation.
  3036. </p>
  3037. <p>If these patterns are not defined, attempts will be made to use legacy
  3038. <code>sync</code> patterns. If none of these are available a compare-and-swap
  3039. loop will be used.
  3040. </p>
  3041. <a name="index-atomic_005fadd_005ffetchmode-instruction-pattern"></a>
  3042. <a name="index-atomic_005fsub_005ffetchmode-instruction-pattern"></a>
  3043. <a name="index-atomic_005for_005ffetchmode-instruction-pattern"></a>
  3044. <a name="index-atomic_005fand_005ffetchmode-instruction-pattern"></a>
  3045. <a name="index-atomic_005fxor_005ffetchmode-instruction-pattern"></a>
  3046. <a name="index-atomic_005fnand_005ffetchmode-instruction-pattern"></a>
  3047. </dd>
  3048. <dt>&lsquo;<samp>atomic_add_fetch<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_sub_fetch<var>mode</var></samp>&rsquo;</dt>
  3049. <dt>&lsquo;<samp>atomic_or_fetch<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_and_fetch<var>mode</var></samp>&rsquo;</dt>
  3050. <dt>&lsquo;<samp>atomic_xor_fetch<var>mode</var></samp>&rsquo;, &lsquo;<samp>atomic_nand_fetch<var>mode</var></samp>&rsquo;</dt>
  3051. <dd><p>These patterns emit code for an atomic operation on memory with memory
  3052. model semantics and return the result after the operation is performed.
  3053. Operand 0 is an output operand which contains the value after the
  3054. operation. Operand 1 is the memory on which the atomic operation is
  3055. performed. Operand 2 is the second operand to the binary operator.
  3056. Operand 3 is the memory model to be used by the operation.
  3057. </p>
  3058. <p>If these patterns are not defined, attempts will be made to use legacy
  3059. <code>sync</code> patterns, or equivalent patterns which return the result before
  3060. the operation followed by the arithmetic operation required to produce the
  3061. result. If none of these are available a compare-and-swap loop will be
  3062. used.
  3063. </p>
  3064. <a name="index-atomic_005ftest_005fand_005fset-instruction-pattern"></a>
  3065. </dd>
  3066. <dt>&lsquo;<samp>atomic_test_and_set</samp>&rsquo;</dt>
  3067. <dd><p>This pattern emits code for <code>__builtin_atomic_test_and_set</code>.
  3068. Operand 0 is an output operand which is set to true if the previous
  3069. previous contents of the byte was &quot;set&quot;, and false otherwise. Operand 1
  3070. is the <code>QImode</code> memory to be modified. Operand 2 is the memory
  3071. model to be used.
  3072. </p>
  3073. <p>The specific value that defines &quot;set&quot; is implementation defined, and
  3074. is normally based on what is performed by the native atomic test and set
  3075. instruction.
  3076. </p>
  3077. <a name="index-atomic_005fbit_005ftest_005fand_005fsetmode-instruction-pattern"></a>
  3078. <a name="index-atomic_005fbit_005ftest_005fand_005fcomplementmode-instruction-pattern"></a>
  3079. <a name="index-atomic_005fbit_005ftest_005fand_005fresetmode-instruction-pattern"></a>
  3080. </dd>
  3081. <dt>&lsquo;<samp>atomic_bit_test_and_set<var>mode</var></samp>&rsquo;</dt>
  3082. <dt>&lsquo;<samp>atomic_bit_test_and_complement<var>mode</var></samp>&rsquo;</dt>
  3083. <dt>&lsquo;<samp>atomic_bit_test_and_reset<var>mode</var></samp>&rsquo;</dt>
  3084. <dd><p>These patterns emit code for an atomic bitwise operation on memory with memory
  3085. model semantics, and return the original value of the specified bit.
  3086. Operand 0 is an output operand which contains the value of the specified bit
  3087. from the memory location before the operation was performed. Operand 1 is the
  3088. memory on which the atomic operation is performed. Operand 2 is the bit within
  3089. the operand, starting with least significant bit. Operand 3 is the memory model
  3090. to be used by the operation. Operand 4 is a flag - it is <code>const1_rtx</code>
  3091. if operand 0 should contain the original value of the specified bit in the
  3092. least significant bit of the operand, and <code>const0_rtx</code> if the bit should
  3093. be in its original position in the operand.
  3094. <code>atomic_bit_test_and_set<var>mode</var></code> atomically sets the specified bit after
  3095. remembering its original value, <code>atomic_bit_test_and_complement<var>mode</var></code>
  3096. inverts the specified bit and <code>atomic_bit_test_and_reset<var>mode</var></code> clears
  3097. the specified bit.
  3098. </p>
  3099. <p>If these patterns are not defined, attempts will be made to use
  3100. <code>atomic_fetch_or<var>mode</var></code>, <code>atomic_fetch_xor<var>mode</var></code> or
  3101. <code>atomic_fetch_and<var>mode</var></code> instruction patterns, or their <code>sync</code>
  3102. counterparts. If none of these are available a compare-and-swap
  3103. loop will be used.
  3104. </p>
  3105. <a name="index-mem_005fthread_005ffence-instruction-pattern"></a>
  3106. </dd>
  3107. <dt>&lsquo;<samp>mem_thread_fence</samp>&rsquo;</dt>
  3108. <dd><p>This pattern emits code required to implement a thread fence with
  3109. memory model semantics. Operand 0 is the memory model to be used.
  3110. </p>
  3111. <p>For the <code>__ATOMIC_RELAXED</code> model no instructions need to be issued
  3112. and this expansion is not invoked.
  3113. </p>
  3114. <p>The compiler always emits a compiler memory barrier regardless of what
  3115. expanding this pattern produced.
  3116. </p>
  3117. <p>If this pattern is not defined, the compiler falls back to expanding the
  3118. <code>memory_barrier</code> pattern, then to emitting <code>__sync_synchronize</code>
  3119. library call, and finally to just placing a compiler memory barrier.
  3120. </p>
  3121. <a name="index-get_005fthread_005fpointermode-instruction-pattern"></a>
  3122. <a name="index-set_005fthread_005fpointermode-instruction-pattern"></a>
  3123. </dd>
  3124. <dt>&lsquo;<samp>get_thread_pointer<var>mode</var></samp>&rsquo;</dt>
  3125. <dt>&lsquo;<samp>set_thread_pointer<var>mode</var></samp>&rsquo;</dt>
  3126. <dd><p>These patterns emit code that reads/sets the TLS thread pointer. Currently,
  3127. these are only needed if the target needs to support the
  3128. <code>__builtin_thread_pointer</code> and <code>__builtin_set_thread_pointer</code>
  3129. builtins.
  3130. </p>
  3131. <p>The get/set patterns have a single output/input operand respectively,
  3132. with <var>mode</var> intended to be <code>Pmode</code>.
  3133. </p>
  3134. <a name="index-stack_005fprotect_005fcombined_005fset-instruction-pattern"></a>
  3135. </dd>
  3136. <dt>&lsquo;<samp>stack_protect_combined_set</samp>&rsquo;</dt>
  3137. <dd><p>This pattern, if defined, moves a <code>ptr_mode</code> value from an address
  3138. whose declaration RTX is given in operand 1 to the memory in operand 0
  3139. without leaving the value in a register afterward. If several
  3140. instructions are needed by the target to perform the operation (eg. to
  3141. load the address from a GOT entry then load the <code>ptr_mode</code> value
  3142. and finally store it), it is the backend&rsquo;s responsibility to ensure no
  3143. intermediate result gets spilled. This is to avoid leaking the value
  3144. some place that an attacker might use to rewrite the stack guard slot
  3145. after having clobbered it.
  3146. </p>
  3147. <p>If this pattern is not defined, then the address declaration is
  3148. expanded first in the standard way and a <code>stack_protect_set</code>
  3149. pattern is then generated to move the value from that address to the
  3150. address in operand 0.
  3151. </p>
  3152. <a name="index-stack_005fprotect_005fset-instruction-pattern"></a>
  3153. </dd>
  3154. <dt>&lsquo;<samp>stack_protect_set</samp>&rsquo;</dt>
  3155. <dd><p>This pattern, if defined, moves a <code>ptr_mode</code> value from the valid
  3156. memory location in operand 1 to the memory in operand 0 without leaving
  3157. the value in a register afterward. This is to avoid leaking the value
  3158. some place that an attacker might use to rewrite the stack guard slot
  3159. after having clobbered it.
  3160. </p>
  3161. <p>Note: on targets where the addressing modes do not allow to load
  3162. directly from stack guard address, the address is expanded in a standard
  3163. way first which could cause some spills.
  3164. </p>
  3165. <p>If this pattern is not defined, then a plain move pattern is generated.
  3166. </p>
  3167. <a name="index-stack_005fprotect_005fcombined_005ftest-instruction-pattern"></a>
  3168. </dd>
  3169. <dt>&lsquo;<samp>stack_protect_combined_test</samp>&rsquo;</dt>
  3170. <dd><p>This pattern, if defined, compares a <code>ptr_mode</code> value from an
  3171. address whose declaration RTX is given in operand 1 with the memory in
  3172. operand 0 without leaving the value in a register afterward and
  3173. branches to operand 2 if the values were equal. If several
  3174. instructions are needed by the target to perform the operation (eg. to
  3175. load the address from a GOT entry then load the <code>ptr_mode</code> value
  3176. and finally store it), it is the backend&rsquo;s responsibility to ensure no
  3177. intermediate result gets spilled. This is to avoid leaking the value
  3178. some place that an attacker might use to rewrite the stack guard slot
  3179. after having clobbered it.
  3180. </p>
  3181. <p>If this pattern is not defined, then the address declaration is
  3182. expanded first in the standard way and a <code>stack_protect_test</code>
  3183. pattern is then generated to compare the value from that address to the
  3184. value at the memory in operand 0.
  3185. </p>
  3186. <a name="index-stack_005fprotect_005ftest-instruction-pattern"></a>
  3187. </dd>
  3188. <dt>&lsquo;<samp>stack_protect_test</samp>&rsquo;</dt>
  3189. <dd><p>This pattern, if defined, compares a <code>ptr_mode</code> value from the
  3190. valid memory location in operand 1 with the memory in operand 0 without
  3191. leaving the value in a register afterward and branches to operand 2 if
  3192. the values were equal.
  3193. </p>
  3194. <p>If this pattern is not defined, then a plain compare pattern and
  3195. conditional branch pattern is used.
  3196. </p>
  3197. <a name="index-clear_005fcache-instruction-pattern"></a>
  3198. </dd>
  3199. <dt>&lsquo;<samp>clear_cache</samp>&rsquo;</dt>
  3200. <dd><p>This pattern, if defined, flushes the instruction cache for a region of
  3201. memory. The region is bounded to by the Pmode pointers in operand 0
  3202. inclusive and operand 1 exclusive.
  3203. </p>
  3204. <p>If this pattern is not defined, a call to the library function
  3205. <code>__clear_cache</code> is used.
  3206. </p>
  3207. </dd>
  3208. </dl>
  3209. <hr>
  3210. <div class="header">
  3211. <p>
  3212. Next: <a href="Pattern-Ordering.html#Pattern-Ordering" accesskey="n" rel="next">Pattern Ordering</a>, Previous: <a href="Constraints.html#Constraints" accesskey="p" rel="prev">Constraints</a>, Up: <a href="Machine-Desc.html#Machine-Desc" accesskey="u" rel="up">Machine Desc</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  3213. </div>
  3214. </body>
  3215. </html>