You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Addressing-Modes.html 41KB

3 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  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>Addressing Modes (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Addressing Modes (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Addressing Modes (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="Target-Macros.html#Target-Macros" rel="up" title="Target Macros">
  30. <link href="Anchored-Addresses.html#Anchored-Addresses" rel="next" title="Anchored Addresses">
  31. <link href="Library-Calls.html#Library-Calls" rel="prev" title="Library Calls">
  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="Addressing-Modes"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Anchored-Addresses.html#Anchored-Addresses" accesskey="n" rel="next">Anchored Addresses</a>, Previous: <a href="Library-Calls.html#Library-Calls" accesskey="p" rel="prev">Library Calls</a>, Up: <a href="Target-Macros.html#Target-Macros" accesskey="u" rel="up">Target Macros</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="Addressing-Modes-1"></a>
  68. <h3 class="section">18.13 Addressing Modes</h3>
  69. <a name="index-addressing-modes"></a>
  70. <p>This is about addressing modes.
  71. </p>
  72. <dl>
  73. <dt><a name="index-HAVE_005fPRE_005fINCREMENT"></a>Macro: <strong>HAVE_PRE_INCREMENT</strong></dt>
  74. <dt><a name="index-HAVE_005fPRE_005fDECREMENT"></a>Macro: <strong>HAVE_PRE_DECREMENT</strong></dt>
  75. <dt><a name="index-HAVE_005fPOST_005fINCREMENT"></a>Macro: <strong>HAVE_POST_INCREMENT</strong></dt>
  76. <dt><a name="index-HAVE_005fPOST_005fDECREMENT"></a>Macro: <strong>HAVE_POST_DECREMENT</strong></dt>
  77. <dd><p>A C expression that is nonzero if the machine supports pre-increment,
  78. pre-decrement, post-increment, or post-decrement addressing respectively.
  79. </p></dd></dl>
  80. <dl>
  81. <dt><a name="index-HAVE_005fPRE_005fMODIFY_005fDISP"></a>Macro: <strong>HAVE_PRE_MODIFY_DISP</strong></dt>
  82. <dt><a name="index-HAVE_005fPOST_005fMODIFY_005fDISP"></a>Macro: <strong>HAVE_POST_MODIFY_DISP</strong></dt>
  83. <dd><p>A C expression that is nonzero if the machine supports pre- or
  84. post-address side-effect generation involving constants other than
  85. the size of the memory operand.
  86. </p></dd></dl>
  87. <dl>
  88. <dt><a name="index-HAVE_005fPRE_005fMODIFY_005fREG"></a>Macro: <strong>HAVE_PRE_MODIFY_REG</strong></dt>
  89. <dt><a name="index-HAVE_005fPOST_005fMODIFY_005fREG"></a>Macro: <strong>HAVE_POST_MODIFY_REG</strong></dt>
  90. <dd><p>A C expression that is nonzero if the machine supports pre- or
  91. post-address side-effect generation involving a register displacement.
  92. </p></dd></dl>
  93. <dl>
  94. <dt><a name="index-CONSTANT_005fADDRESS_005fP"></a>Macro: <strong>CONSTANT_ADDRESS_P</strong> <em>(<var>x</var>)</em></dt>
  95. <dd><p>A C expression that is 1 if the RTX <var>x</var> is a constant which
  96. is a valid address. On most machines the default definition of
  97. <code>(CONSTANT_P (<var>x</var>) &amp;&amp; GET_CODE (<var>x</var>) != CONST_DOUBLE)</code>
  98. is acceptable, but a few machines are more restrictive as to which
  99. constant addresses are supported.
  100. </p></dd></dl>
  101. <dl>
  102. <dt><a name="index-CONSTANT_005fP"></a>Macro: <strong>CONSTANT_P</strong> <em>(<var>x</var>)</em></dt>
  103. <dd><p><code>CONSTANT_P</code>, which is defined by target-independent code,
  104. accepts integer-values expressions whose values are not explicitly
  105. known, such as <code>symbol_ref</code>, <code>label_ref</code>, and <code>high</code>
  106. expressions and <code>const</code> arithmetic expressions, in addition to
  107. <code>const_int</code> and <code>const_double</code> expressions.
  108. </p></dd></dl>
  109. <dl>
  110. <dt><a name="index-MAX_005fREGS_005fPER_005fADDRESS"></a>Macro: <strong>MAX_REGS_PER_ADDRESS</strong></dt>
  111. <dd><p>A number, the maximum number of registers that can appear in a valid
  112. memory address. Note that it is up to you to specify a value equal to
  113. the maximum number that <code>TARGET_LEGITIMATE_ADDRESS_P</code> would ever
  114. accept.
  115. </p></dd></dl>
  116. <dl>
  117. <dt><a name="index-TARGET_005fLEGITIMATE_005fADDRESS_005fP"></a>Target Hook: <em>bool</em> <strong>TARGET_LEGITIMATE_ADDRESS_P</strong> <em>(machine_mode <var>mode</var>, rtx <var>x</var>, bool <var>strict</var>)</em></dt>
  118. <dd><p>A function that returns whether <var>x</var> (an RTX) is a legitimate memory
  119. address on the target machine for a memory operand of mode <var>mode</var>.
  120. </p>
  121. <p>Legitimate addresses are defined in two variants: a strict variant and a
  122. non-strict one. The <var>strict</var> parameter chooses which variant is
  123. desired by the caller.
  124. </p>
  125. <p>The strict variant is used in the reload pass. It must be defined so
  126. that any pseudo-register that has not been allocated a hard register is
  127. considered a memory reference. This is because in contexts where some
  128. kind of register is required, a pseudo-register with no hard register
  129. must be rejected. For non-hard registers, the strict variant should look
  130. up the <code>reg_renumber</code> array; it should then proceed using the hard
  131. register number in the array, or treat the pseudo as a memory reference
  132. if the array holds <code>-1</code>.
  133. </p>
  134. <p>The non-strict variant is used in other passes. It must be defined to
  135. accept all pseudo-registers in every context where some kind of
  136. register is required.
  137. </p>
  138. <p>Normally, constant addresses which are the sum of a <code>symbol_ref</code>
  139. and an integer are stored inside a <code>const</code> RTX to mark them as
  140. constant. Therefore, there is no need to recognize such sums
  141. specifically as legitimate addresses. Normally you would simply
  142. recognize any <code>const</code> as legitimate.
  143. </p>
  144. <p>Usually <code>PRINT_OPERAND_ADDRESS</code> is not prepared to handle constant
  145. sums that are not marked with <code>const</code>. It assumes that a naked
  146. <code>plus</code> indicates indexing. If so, then you <em>must</em> reject such
  147. naked constant sums as illegitimate addresses, so that none of them will
  148. be given to <code>PRINT_OPERAND_ADDRESS</code>.
  149. </p>
  150. <a name="index-TARGET_005fENCODE_005fSECTION_005fINFO-and-address-validation"></a>
  151. <p>On some machines, whether a symbolic address is legitimate depends on
  152. the section that the address refers to. On these machines, define the
  153. target hook <code>TARGET_ENCODE_SECTION_INFO</code> to store the information
  154. into the <code>symbol_ref</code>, and then check for it here. When you see a
  155. <code>const</code>, you will have to look inside it to find the
  156. <code>symbol_ref</code> in order to determine the section. See <a href="Assembler-Format.html#Assembler-Format">Assembler Format</a>.
  157. </p>
  158. <a name="index-GO_005fIF_005fLEGITIMATE_005fADDRESS"></a>
  159. <p>Some ports are still using a deprecated legacy substitute for
  160. this hook, the <code>GO_IF_LEGITIMATE_ADDRESS</code> macro. This macro
  161. has this syntax:
  162. </p>
  163. <div class="example">
  164. <pre class="example">#define GO_IF_LEGITIMATE_ADDRESS (<var>mode</var>, <var>x</var>, <var>label</var>)
  165. </pre></div>
  166. <p>and should <code>goto <var>label</var></code> if the address <var>x</var> is a valid
  167. address on the target machine for a memory operand of mode <var>mode</var>.
  168. </p>
  169. <a name="index-REG_005fOK_005fSTRICT"></a>
  170. <p>Compiler source files that want to use the strict variant of this
  171. macro define the macro <code>REG_OK_STRICT</code>. You should use an
  172. <code>#ifdef REG_OK_STRICT</code> conditional to define the strict variant in
  173. that case and the non-strict variant otherwise.
  174. </p>
  175. <p>Using the hook is usually simpler because it limits the number of
  176. files that are recompiled when changes are made.
  177. </p></dd></dl>
  178. <dl>
  179. <dt><a name="index-TARGET_005fMEM_005fCONSTRAINT"></a>Macro: <strong>TARGET_MEM_CONSTRAINT</strong></dt>
  180. <dd><p>A single character to be used instead of the default <code>'m'</code>
  181. character for general memory addresses. This defines the constraint
  182. letter which matches the memory addresses accepted by
  183. <code>TARGET_LEGITIMATE_ADDRESS_P</code>. Define this macro if you want to
  184. support new address formats in your back end without changing the
  185. semantics of the <code>'m'</code> constraint. This is necessary in order to
  186. preserve functionality of inline assembly constructs using the
  187. <code>'m'</code> constraint.
  188. </p></dd></dl>
  189. <dl>
  190. <dt><a name="index-FIND_005fBASE_005fTERM"></a>Macro: <strong>FIND_BASE_TERM</strong> <em>(<var>x</var>)</em></dt>
  191. <dd><p>A C expression to determine the base term of address <var>x</var>,
  192. or to provide a simplified version of <var>x</var> from which <samp>alias.c</samp>
  193. can easily find the base term. This macro is used in only two places:
  194. <code>find_base_value</code> and <code>find_base_term</code> in <samp>alias.c</samp>.
  195. </p>
  196. <p>It is always safe for this macro to not be defined. It exists so
  197. that alias analysis can understand machine-dependent addresses.
  198. </p>
  199. <p>The typical use of this macro is to handle addresses containing
  200. a label_ref or symbol_ref within an UNSPEC.
  201. </p></dd></dl>
  202. <dl>
  203. <dt><a name="index-TARGET_005fLEGITIMIZE_005fADDRESS"></a>Target Hook: <em>rtx</em> <strong>TARGET_LEGITIMIZE_ADDRESS</strong> <em>(rtx <var>x</var>, rtx <var>oldx</var>, machine_mode <var>mode</var>)</em></dt>
  204. <dd><p>This hook is given an invalid memory address <var>x</var> for an
  205. operand of mode <var>mode</var> and should try to return a valid memory
  206. address.
  207. </p>
  208. <a name="index-break_005fout_005fmemory_005frefs"></a>
  209. <p><var>x</var> will always be the result of a call to <code>break_out_memory_refs</code>,
  210. and <var>oldx</var> will be the operand that was given to that function to produce
  211. <var>x</var>.
  212. </p>
  213. <p>The code of the hook should not alter the substructure of
  214. <var>x</var>. If it transforms <var>x</var> into a more legitimate form, it
  215. should return the new <var>x</var>.
  216. </p>
  217. <p>It is not necessary for this hook to come up with a legitimate address,
  218. with the exception of native TLS addresses (see <a href="Emulated-TLS.html#Emulated-TLS">Emulated TLS</a>).
  219. The compiler has standard ways of doing so in all cases. In fact, if
  220. the target supports only emulated TLS, it
  221. is safe to omit this hook or make it return <var>x</var> if it cannot find
  222. a valid way to legitimize the address. But often a machine-dependent
  223. strategy can generate better code.
  224. </p></dd></dl>
  225. <dl>
  226. <dt><a name="index-LEGITIMIZE_005fRELOAD_005fADDRESS"></a>Macro: <strong>LEGITIMIZE_RELOAD_ADDRESS</strong> <em>(<var>x</var>, <var>mode</var>, <var>opnum</var>, <var>type</var>, <var>ind_levels</var>, <var>win</var>)</em></dt>
  227. <dd><p>A C compound statement that attempts to replace <var>x</var>, which is an address
  228. that needs reloading, with a valid memory address for an operand of mode
  229. <var>mode</var>. <var>win</var> will be a C statement label elsewhere in the code.
  230. It is not necessary to define this macro, but it might be useful for
  231. performance reasons.
  232. </p>
  233. <p>For example, on the i386, it is sometimes possible to use a single
  234. reload register instead of two by reloading a sum of two pseudo
  235. registers into a register. On the other hand, for number of RISC
  236. processors offsets are limited so that often an intermediate address
  237. needs to be generated in order to address a stack slot. By defining
  238. <code>LEGITIMIZE_RELOAD_ADDRESS</code> appropriately, the intermediate addresses
  239. generated for adjacent some stack slots can be made identical, and thus
  240. be shared.
  241. </p>
  242. <p><em>Note</em>: This macro should be used with caution. It is necessary
  243. to know something of how reload works in order to effectively use this,
  244. and it is quite easy to produce macros that build in too much knowledge
  245. of reload internals.
  246. </p>
  247. <p><em>Note</em>: This macro must be able to reload an address created by a
  248. previous invocation of this macro. If it fails to handle such addresses
  249. then the compiler may generate incorrect code or abort.
  250. </p>
  251. <a name="index-push_005freload"></a>
  252. <p>The macro definition should use <code>push_reload</code> to indicate parts that
  253. need reloading; <var>opnum</var>, <var>type</var> and <var>ind_levels</var> are usually
  254. suitable to be passed unaltered to <code>push_reload</code>.
  255. </p>
  256. <p>The code generated by this macro must not alter the substructure of
  257. <var>x</var>. If it transforms <var>x</var> into a more legitimate form, it
  258. should assign <var>x</var> (which will always be a C variable) a new value.
  259. This also applies to parts that you change indirectly by calling
  260. <code>push_reload</code>.
  261. </p>
  262. <a name="index-strict_005fmemory_005faddress_005fp"></a>
  263. <p>The macro definition may use <code>strict_memory_address_p</code> to test if
  264. the address has become legitimate.
  265. </p>
  266. <a name="index-copy_005frtx"></a>
  267. <p>If you want to change only a part of <var>x</var>, one standard way of doing
  268. this is to use <code>copy_rtx</code>. Note, however, that it unshares only a
  269. single level of rtl. Thus, if the part to be changed is not at the
  270. top level, you&rsquo;ll need to replace first the top level.
  271. It is not necessary for this macro to come up with a legitimate
  272. address; but often a machine-dependent strategy can generate better code.
  273. </p></dd></dl>
  274. <dl>
  275. <dt><a name="index-TARGET_005fMODE_005fDEPENDENT_005fADDRESS_005fP"></a>Target Hook: <em>bool</em> <strong>TARGET_MODE_DEPENDENT_ADDRESS_P</strong> <em>(const_rtx <var>addr</var>, addr_space_t <var>addrspace</var>)</em></dt>
  276. <dd><p>This hook returns <code>true</code> if memory address <var>addr</var> in address
  277. space <var>addrspace</var> can have
  278. different meanings depending on the machine mode of the memory
  279. reference it is used for or if the address is valid for some modes
  280. but not others.
  281. </p>
  282. <p>Autoincrement and autodecrement addresses typically have mode-dependent
  283. effects because the amount of the increment or decrement is the size
  284. of the operand being addressed. Some machines have other mode-dependent
  285. addresses. Many RISC machines have no mode-dependent addresses.
  286. </p>
  287. <p>You may assume that <var>addr</var> is a valid address for the machine.
  288. </p>
  289. <p>The default version of this hook returns <code>false</code>.
  290. </p></dd></dl>
  291. <dl>
  292. <dt><a name="index-TARGET_005fLEGITIMATE_005fCONSTANT_005fP"></a>Target Hook: <em>bool</em> <strong>TARGET_LEGITIMATE_CONSTANT_P</strong> <em>(machine_mode <var>mode</var>, rtx <var>x</var>)</em></dt>
  293. <dd><p>This hook returns true if <var>x</var> is a legitimate constant for a
  294. <var>mode</var>-mode immediate operand on the target machine. You can assume that
  295. <var>x</var> satisfies <code>CONSTANT_P</code>, so you need not check this.
  296. </p>
  297. <p>The default definition returns true.
  298. </p></dd></dl>
  299. <dl>
  300. <dt><a name="index-TARGET_005fDELEGITIMIZE_005fADDRESS"></a>Target Hook: <em>rtx</em> <strong>TARGET_DELEGITIMIZE_ADDRESS</strong> <em>(rtx <var>x</var>)</em></dt>
  301. <dd><p>This hook is used to undo the possibly obfuscating effects of the
  302. <code>LEGITIMIZE_ADDRESS</code> and <code>LEGITIMIZE_RELOAD_ADDRESS</code> target
  303. macros. Some backend implementations of these macros wrap symbol
  304. references inside an <code>UNSPEC</code> rtx to represent PIC or similar
  305. addressing modes. This target hook allows GCC&rsquo;s optimizers to understand
  306. the semantics of these opaque <code>UNSPEC</code>s by converting them back
  307. into their original form.
  308. </p></dd></dl>
  309. <dl>
  310. <dt><a name="index-TARGET_005fCONST_005fNOT_005fOK_005fFOR_005fDEBUG_005fP"></a>Target Hook: <em>bool</em> <strong>TARGET_CONST_NOT_OK_FOR_DEBUG_P</strong> <em>(rtx <var>x</var>)</em></dt>
  311. <dd><p>This hook should return true if <var>x</var> should not be emitted into
  312. debug sections.
  313. </p></dd></dl>
  314. <dl>
  315. <dt><a name="index-TARGET_005fCANNOT_005fFORCE_005fCONST_005fMEM"></a>Target Hook: <em>bool</em> <strong>TARGET_CANNOT_FORCE_CONST_MEM</strong> <em>(machine_mode <var>mode</var>, rtx <var>x</var>)</em></dt>
  316. <dd><p>This hook should return true if <var>x</var> is of a form that cannot (or
  317. should not) be spilled to the constant pool. <var>mode</var> is the mode
  318. of <var>x</var>.
  319. </p>
  320. <p>The default version of this hook returns false.
  321. </p>
  322. <p>The primary reason to define this hook is to prevent reload from
  323. deciding that a non-legitimate constant would be better reloaded
  324. from the constant pool instead of spilling and reloading a register
  325. holding the constant. This restriction is often true of addresses
  326. of TLS symbols for various targets.
  327. </p></dd></dl>
  328. <dl>
  329. <dt><a name="index-TARGET_005fUSE_005fBLOCKS_005fFOR_005fCONSTANT_005fP"></a>Target Hook: <em>bool</em> <strong>TARGET_USE_BLOCKS_FOR_CONSTANT_P</strong> <em>(machine_mode <var>mode</var>, const_rtx <var>x</var>)</em></dt>
  330. <dd><p>This hook should return true if pool entries for constant <var>x</var> can
  331. be placed in an <code>object_block</code> structure. <var>mode</var> is the mode
  332. of <var>x</var>.
  333. </p>
  334. <p>The default version returns false for all constants.
  335. </p></dd></dl>
  336. <dl>
  337. <dt><a name="index-TARGET_005fUSE_005fBLOCKS_005fFOR_005fDECL_005fP"></a>Target Hook: <em>bool</em> <strong>TARGET_USE_BLOCKS_FOR_DECL_P</strong> <em>(const_tree <var>decl</var>)</em></dt>
  338. <dd><p>This hook should return true if pool entries for <var>decl</var> should
  339. be placed in an <code>object_block</code> structure.
  340. </p>
  341. <p>The default version returns true for all decls.
  342. </p></dd></dl>
  343. <dl>
  344. <dt><a name="index-TARGET_005fBUILTIN_005fRECIPROCAL"></a>Target Hook: <em>tree</em> <strong>TARGET_BUILTIN_RECIPROCAL</strong> <em>(tree <var>fndecl</var>)</em></dt>
  345. <dd><p>This hook should return the DECL of a function that implements the
  346. reciprocal of the machine-specific builtin function <var>fndecl</var>, or
  347. <code>NULL_TREE</code> if such a function is not available.
  348. </p></dd></dl>
  349. <dl>
  350. <dt><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fMASK_005fFOR_005fLOAD"></a>Target Hook: <em>tree</em> <strong>TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD</strong> <em>(void)</em></dt>
  351. <dd><p>This hook should return the DECL of a function <var>f</var> that given an
  352. address <var>addr</var> as an argument returns a mask <var>m</var> that can be
  353. used to extract from two vectors the relevant data that resides in
  354. <var>addr</var> in case <var>addr</var> is not properly aligned.
  355. </p>
  356. <p>The autovectorizer, when vectorizing a load operation from an address
  357. <var>addr</var> that may be unaligned, will generate two vector loads from
  358. the two aligned addresses around <var>addr</var>. It then generates a
  359. <code>REALIGN_LOAD</code> operation to extract the relevant data from the
  360. two loaded vectors. The first two arguments to <code>REALIGN_LOAD</code>,
  361. <var>v1</var> and <var>v2</var>, are the two vectors, each of size <var>VS</var>, and
  362. the third argument, <var>OFF</var>, defines how the data will be extracted
  363. from these two vectors: if <var>OFF</var> is 0, then the returned vector is
  364. <var>v2</var>; otherwise, the returned vector is composed from the last
  365. <var>VS</var>-<var>OFF</var> elements of <var>v1</var> concatenated to the first
  366. <var>OFF</var> elements of <var>v2</var>.
  367. </p>
  368. <p>If this hook is defined, the autovectorizer will generate a call
  369. to <var>f</var> (using the DECL tree that this hook returns) and will
  370. use the return value of <var>f</var> as the argument <var>OFF</var> to
  371. <code>REALIGN_LOAD</code>. Therefore, the mask <var>m</var> returned by <var>f</var>
  372. should comply with the semantics expected by <code>REALIGN_LOAD</code>
  373. described above.
  374. If this hook is not defined, then <var>addr</var> will be used as
  375. the argument <var>OFF</var> to <code>REALIGN_LOAD</code>, in which case the low
  376. log2(<var>VS</var>) - 1 bits of <var>addr</var> will be considered.
  377. </p></dd></dl>
  378. <dl>
  379. <dt><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fVECTORIZATION_005fCOST"></a>Target Hook: <em>int</em> <strong>TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST</strong> <em>(enum vect_cost_for_stmt <var>type_of_cost</var>, tree <var>vectype</var>, int <var>misalign</var>)</em></dt>
  380. <dd><p>Returns cost of different scalar or vector statements for vectorization cost model.
  381. For vector memory operations the cost may depend on type (<var>vectype</var>) and
  382. misalignment value (<var>misalign</var>).
  383. </p></dd></dl>
  384. <dl>
  385. <dt><a name="index-TARGET_005fVECTORIZE_005fPREFERRED_005fVECTOR_005fALIGNMENT"></a>Target Hook: <em>poly_uint64</em> <strong>TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT</strong> <em>(const_tree <var>type</var>)</em></dt>
  386. <dd><p>This hook returns the preferred alignment in bits for accesses to
  387. vectors of type <var>type</var> in vectorized code. This might be less than
  388. or greater than the ABI-defined value returned by
  389. <code>TARGET_VECTOR_ALIGNMENT</code>. It can be equal to the alignment of
  390. a single element, in which case the vectorizer will not try to optimize
  391. for alignment.
  392. </p>
  393. <p>The default hook returns <code>TYPE_ALIGN (<var>type</var>)</code>, which is
  394. correct for most targets.
  395. </p></dd></dl>
  396. <dl>
  397. <dt><a name="index-TARGET_005fVECTORIZE_005fVECTOR_005fALIGNMENT_005fREACHABLE"></a>Target Hook: <em>bool</em> <strong>TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE</strong> <em>(const_tree <var>type</var>, bool <var>is_packed</var>)</em></dt>
  398. <dd><p>Return true if vector alignment is reachable (by peeling N iterations) for the given scalar type <var>type</var>. <var>is_packed</var> is false if the scalar access using <var>type</var> is known to be naturally aligned.
  399. </p></dd></dl>
  400. <dl>
  401. <dt><a name="index-TARGET_005fVECTORIZE_005fVEC_005fPERM_005fCONST"></a>Target Hook: <em>bool</em> <strong>TARGET_VECTORIZE_VEC_PERM_CONST</strong> <em>(machine_mode <var>mode</var>, rtx <var>output</var>, rtx <var>in0</var>, rtx <var>in1</var>, const vec_perm_indices <var>&amp;sel</var>)</em></dt>
  402. <dd><p>This hook is used to test whether the target can permute up to two
  403. vectors of mode <var>mode</var> using the permutation vector <code>sel</code>, and
  404. also to emit such a permutation. In the former case <var>in0</var>, <var>in1</var>
  405. and <var>out</var> are all null. In the latter case <var>in0</var> and <var>in1</var> are
  406. the source vectors and <var>out</var> is the destination vector; all three are
  407. registers of mode <var>mode</var>. <var>in1</var> is the same as <var>in0</var> if
  408. <var>sel</var> describes a permutation on one vector instead of two.
  409. </p>
  410. <p>Return true if the operation is possible, emitting instructions for it
  411. if rtxes are provided.
  412. </p>
  413. <a name="index-vec_005fpermm-instruction-pattern-1"></a>
  414. <p>If the hook returns false for a mode with multibyte elements, GCC will
  415. try the equivalent byte operation. If that also fails, it will try forcing
  416. the selector into a register and using the <var>vec_perm<var>mode</var></var>
  417. instruction pattern. There is no need for the hook to handle these two
  418. implementation approaches itself.
  419. </p></dd></dl>
  420. <dl>
  421. <dt><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fVECTORIZED_005fFUNCTION"></a>Target Hook: <em>tree</em> <strong>TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION</strong> <em>(unsigned <var>code</var>, tree <var>vec_type_out</var>, tree <var>vec_type_in</var>)</em></dt>
  422. <dd><p>This hook should return the decl of a function that implements the
  423. vectorized variant of the function with the <code>combined_fn</code> code
  424. <var>code</var> or <code>NULL_TREE</code> if such a function is not available.
  425. The return type of the vectorized function shall be of vector type
  426. <var>vec_type_out</var> and the argument types should be <var>vec_type_in</var>.
  427. </p></dd></dl>
  428. <dl>
  429. <dt><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fMD_005fVECTORIZED_005fFUNCTION"></a>Target Hook: <em>tree</em> <strong>TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION</strong> <em>(tree <var>fndecl</var>, tree <var>vec_type_out</var>, tree <var>vec_type_in</var>)</em></dt>
  430. <dd><p>This hook should return the decl of a function that implements the
  431. vectorized variant of target built-in function <code>fndecl</code>. The
  432. return type of the vectorized function shall be of vector type
  433. <var>vec_type_out</var> and the argument types should be <var>vec_type_in</var>.
  434. </p></dd></dl>
  435. <dl>
  436. <dt><a name="index-TARGET_005fVECTORIZE_005fSUPPORT_005fVECTOR_005fMISALIGNMENT"></a>Target Hook: <em>bool</em> <strong>TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT</strong> <em>(machine_mode <var>mode</var>, const_tree <var>type</var>, int <var>misalignment</var>, bool <var>is_packed</var>)</em></dt>
  437. <dd><p>This hook should return true if the target supports misaligned vector
  438. store/load of a specific factor denoted in the <var>misalignment</var>
  439. parameter. The vector store/load should be of machine mode <var>mode</var> and
  440. the elements in the vectors should be of type <var>type</var>. <var>is_packed</var>
  441. parameter is true if the memory access is defined in a packed struct.
  442. </p></dd></dl>
  443. <dl>
  444. <dt><a name="index-TARGET_005fVECTORIZE_005fPREFERRED_005fSIMD_005fMODE"></a>Target Hook: <em>machine_mode</em> <strong>TARGET_VECTORIZE_PREFERRED_SIMD_MODE</strong> <em>(scalar_mode <var>mode</var>)</em></dt>
  445. <dd><p>This hook should return the preferred mode for vectorizing scalar
  446. mode <var>mode</var>. The default is
  447. equal to <code>word_mode</code>, because the vectorizer can do some
  448. transformations even in absence of specialized <acronym>SIMD</acronym> hardware.
  449. </p></dd></dl>
  450. <dl>
  451. <dt><a name="index-TARGET_005fVECTORIZE_005fSPLIT_005fREDUCTION"></a>Target Hook: <em>machine_mode</em> <strong>TARGET_VECTORIZE_SPLIT_REDUCTION</strong> <em>(machine_mode)</em></dt>
  452. <dd><p>This hook should return the preferred mode to split the final reduction
  453. step on <var>mode</var> to. The reduction is then carried out reducing upper
  454. against lower halves of vectors recursively until the specified mode is
  455. reached. The default is <var>mode</var> which means no splitting.
  456. </p></dd></dl>
  457. <dl>
  458. <dt><a name="index-TARGET_005fVECTORIZE_005fAUTOVECTORIZE_005fVECTOR_005fMODES"></a>Target Hook: <em>unsigned int</em> <strong>TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES</strong> <em>(vector_modes *<var>modes</var>, bool <var>all</var>)</em></dt>
  459. <dd><p>If using the mode returned by <code>TARGET_VECTORIZE_PREFERRED_SIMD_MODE</code>
  460. is not the only approach worth considering, this hook should add one mode to
  461. <var>modes</var> for each useful alternative approach. These modes are then
  462. passed to <code>TARGET_VECTORIZE_RELATED_MODE</code> to obtain the vector mode
  463. for a given element mode.
  464. </p>
  465. <p>The modes returned in <var>modes</var> should use the smallest element mode
  466. possible for the vectorization approach that they represent, preferring
  467. integer modes over floating-poing modes in the event of a tie. The first
  468. mode should be the <code>TARGET_VECTORIZE_PREFERRED_SIMD_MODE</code> for its
  469. element mode.
  470. </p>
  471. <p>If <var>all</var> is true, add suitable vector modes even when they are generally
  472. not expected to be worthwhile.
  473. </p>
  474. <p>The hook returns a bitmask of flags that control how the modes in
  475. <var>modes</var> are used. The flags are:
  476. </p><dl compact="compact">
  477. <dt><code>VECT_COMPARE_COSTS</code></dt>
  478. <dd><p>Tells the loop vectorizer to try all the provided modes and pick the one
  479. with the lowest cost. By default the vectorizer will choose the first
  480. mode that works.
  481. </p></dd>
  482. </dl>
  483. <p>The hook does not need to do anything if the vector returned by
  484. <code>TARGET_VECTORIZE_PREFERRED_SIMD_MODE</code> is the only one relevant
  485. for autovectorization. The default implementation adds no modes and
  486. returns 0.
  487. </p></dd></dl>
  488. <dl>
  489. <dt><a name="index-TARGET_005fVECTORIZE_005fRELATED_005fMODE"></a>Target Hook: <em>opt_machine_mode</em> <strong>TARGET_VECTORIZE_RELATED_MODE</strong> <em>(machine_mode <var>vector_mode</var>, scalar_mode <var>element_mode</var>, poly_uint64 <var>nunits</var>)</em></dt>
  490. <dd><p>If a piece of code is using vector mode <var>vector_mode</var> and also wants
  491. to operate on elements of mode <var>element_mode</var>, return the vector mode
  492. it should use for those elements. If <var>nunits</var> is nonzero, ensure that
  493. the mode has exactly <var>nunits</var> elements, otherwise pick whichever vector
  494. size pairs the most naturally with <var>vector_mode</var>. Return an empty
  495. <code>opt_machine_mode</code> if there is no supported vector mode with the
  496. required properties.
  497. </p>
  498. <p>There is no prescribed way of handling the case in which <var>nunits</var>
  499. is zero. One common choice is to pick a vector mode with the same size
  500. as <var>vector_mode</var>; this is the natural choice if the target has a
  501. fixed vector size. Another option is to choose a vector mode with the
  502. same number of elements as <var>vector_mode</var>; this is the natural choice
  503. if the target has a fixed number of elements. Alternatively, the hook
  504. might choose a middle ground, such as trying to keep the number of
  505. elements as similar as possible while applying maximum and minimum
  506. vector sizes.
  507. </p>
  508. <p>The default implementation uses <code>mode_for_vector</code> to find the
  509. requested mode, returning a mode with the same size as <var>vector_mode</var>
  510. when <var>nunits</var> is zero. This is the correct behavior for most targets.
  511. </p></dd></dl>
  512. <dl>
  513. <dt><a name="index-TARGET_005fVECTORIZE_005fGET_005fMASK_005fMODE"></a>Target Hook: <em>opt_machine_mode</em> <strong>TARGET_VECTORIZE_GET_MASK_MODE</strong> <em>(machine_mode <var>mode</var>)</em></dt>
  514. <dd><p>Return the mode to use for a vector mask that holds one boolean
  515. result for each element of vector mode <var>mode</var>. The returned mask mode
  516. can be a vector of integers (class <code>MODE_VECTOR_INT</code>), a vector of
  517. booleans (class <code>MODE_VECTOR_BOOL</code>) or a scalar integer (class
  518. <code>MODE_INT</code>). Return an empty <code>opt_machine_mode</code> if no such
  519. mask mode exists.
  520. </p>
  521. <p>The default implementation returns a <code>MODE_VECTOR_INT</code> with the
  522. same size and number of elements as <var>mode</var>, if such a mode exists.
  523. </p></dd></dl>
  524. <dl>
  525. <dt><a name="index-TARGET_005fVECTORIZE_005fEMPTY_005fMASK_005fIS_005fEXPENSIVE"></a>Target Hook: <em>bool</em> <strong>TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE</strong> <em>(unsigned <var>ifn</var>)</em></dt>
  526. <dd><p>This hook returns true if masked internal function <var>ifn</var> (really of
  527. type <code>internal_fn</code>) should be considered expensive when the mask is
  528. all zeros. GCC can then try to branch around the instruction instead.
  529. </p></dd></dl>
  530. <dl>
  531. <dt><a name="index-TARGET_005fVECTORIZE_005fINIT_005fCOST"></a>Target Hook: <em>void *</em> <strong>TARGET_VECTORIZE_INIT_COST</strong> <em>(class loop *<var>loop_info</var>)</em></dt>
  532. <dd><p>This hook should initialize target-specific data structures in preparation for modeling the costs of vectorizing a loop or basic block. The default allocates three unsigned integers for accumulating costs for the prologue, body, and epilogue of the loop or basic block. If <var>loop_info</var> is non-NULL, it identifies the loop being vectorized; otherwise a single block is being vectorized.
  533. </p></dd></dl>
  534. <dl>
  535. <dt><a name="index-TARGET_005fVECTORIZE_005fADD_005fSTMT_005fCOST"></a>Target Hook: <em>unsigned</em> <strong>TARGET_VECTORIZE_ADD_STMT_COST</strong> <em>(void *<var>data</var>, int <var>count</var>, enum vect_cost_for_stmt <var>kind</var>, class _stmt_vec_info *<var>stmt_info</var>, int <var>misalign</var>, enum vect_cost_model_location <var>where</var>)</em></dt>
  536. <dd><p>This hook should update the target-specific <var>data</var> in response to adding <var>count</var> copies of the given <var>kind</var> of statement to a loop or basic block. The default adds the builtin vectorizer cost for the copies of the statement to the accumulator specified by <var>where</var>, (the prologue, body, or epilogue) and returns the amount added. The return value should be viewed as a tentative cost that may later be revised.
  537. </p></dd></dl>
  538. <dl>
  539. <dt><a name="index-TARGET_005fVECTORIZE_005fFINISH_005fCOST"></a>Target Hook: <em>void</em> <strong>TARGET_VECTORIZE_FINISH_COST</strong> <em>(void *<var>data</var>, unsigned *<var>prologue_cost</var>, unsigned *<var>body_cost</var>, unsigned *<var>epilogue_cost</var>)</em></dt>
  540. <dd><p>This hook should complete calculations of the cost of vectorizing a loop or basic block based on <var>data</var>, and return the prologue, body, and epilogue costs as unsigned integers. The default returns the value of the three accumulators.
  541. </p></dd></dl>
  542. <dl>
  543. <dt><a name="index-TARGET_005fVECTORIZE_005fDESTROY_005fCOST_005fDATA"></a>Target Hook: <em>void</em> <strong>TARGET_VECTORIZE_DESTROY_COST_DATA</strong> <em>(void *<var>data</var>)</em></dt>
  544. <dd><p>This hook should release <var>data</var> and any related data structures allocated by TARGET_VECTORIZE_INIT_COST. The default releases the accumulator.
  545. </p></dd></dl>
  546. <dl>
  547. <dt><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fGATHER"></a>Target Hook: <em>tree</em> <strong>TARGET_VECTORIZE_BUILTIN_GATHER</strong> <em>(const_tree <var>mem_vectype</var>, const_tree <var>index_type</var>, int <var>scale</var>)</em></dt>
  548. <dd><p>Target builtin that implements vector gather operation. <var>mem_vectype</var>
  549. is the vector type of the load and <var>index_type</var> is scalar type of
  550. the index, scaled by <var>scale</var>.
  551. The default is <code>NULL_TREE</code> which means to not vectorize gather
  552. loads.
  553. </p></dd></dl>
  554. <dl>
  555. <dt><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fSCATTER"></a>Target Hook: <em>tree</em> <strong>TARGET_VECTORIZE_BUILTIN_SCATTER</strong> <em>(const_tree <var>vectype</var>, const_tree <var>index_type</var>, int <var>scale</var>)</em></dt>
  556. <dd><p>Target builtin that implements vector scatter operation. <var>vectype</var>
  557. is the vector type of the store and <var>index_type</var> is scalar type of
  558. the index, scaled by <var>scale</var>.
  559. The default is <code>NULL_TREE</code> which means to not vectorize scatter
  560. stores.
  561. </p></dd></dl>
  562. <dl>
  563. <dt><a name="index-TARGET_005fSIMD_005fCLONE_005fCOMPUTE_005fVECSIZE_005fAND_005fSIMDLEN"></a>Target Hook: <em>int</em> <strong>TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN</strong> <em>(struct cgraph_node *<var></var>, struct cgraph_simd_clone *<var></var>, <var>tree</var>, <var>int</var>)</em></dt>
  564. <dd><p>This hook should set <var>vecsize_mangle</var>, <var>vecsize_int</var>, <var>vecsize_float</var>
  565. fields in <var>simd_clone</var> structure pointed by <var>clone_info</var> argument and also
  566. <var>simdlen</var> field if it was previously 0.
  567. The hook should return 0 if SIMD clones shouldn&rsquo;t be emitted,
  568. or number of <var>vecsize_mangle</var> variants that should be emitted.
  569. </p></dd></dl>
  570. <dl>
  571. <dt><a name="index-TARGET_005fSIMD_005fCLONE_005fADJUST"></a>Target Hook: <em>void</em> <strong>TARGET_SIMD_CLONE_ADJUST</strong> <em>(struct cgraph_node *<var></var>)</em></dt>
  572. <dd><p>This hook should add implicit <code>attribute(target(&quot;...&quot;))</code> attribute
  573. to SIMD clone <var>node</var> if needed.
  574. </p></dd></dl>
  575. <dl>
  576. <dt><a name="index-TARGET_005fSIMD_005fCLONE_005fUSABLE"></a>Target Hook: <em>int</em> <strong>TARGET_SIMD_CLONE_USABLE</strong> <em>(struct cgraph_node *<var></var>)</em></dt>
  577. <dd><p>This hook should return -1 if SIMD clone <var>node</var> shouldn&rsquo;t be used
  578. in vectorized loops in current function, or non-negative number if it is
  579. usable. In that case, the smaller the number is, the more desirable it is
  580. to use it.
  581. </p></dd></dl>
  582. <dl>
  583. <dt><a name="index-TARGET_005fSIMT_005fVF"></a>Target Hook: <em>int</em> <strong>TARGET_SIMT_VF</strong> <em>(void)</em></dt>
  584. <dd><p>Return number of threads in SIMT thread group on the target.
  585. </p></dd></dl>
  586. <dl>
  587. <dt><a name="index-TARGET_005fOMP_005fDEVICE_005fKIND_005fARCH_005fISA"></a>Target Hook: <em>int</em> <strong>TARGET_OMP_DEVICE_KIND_ARCH_ISA</strong> <em>(enum omp_device_kind_arch_isa <var>trait</var>, const char *<var>name</var>)</em></dt>
  588. <dd><p>Return 1 if <var>trait</var> <var>name</var> is present in the OpenMP context&rsquo;s
  589. device trait set, return 0 if not present in any OpenMP context in the
  590. whole translation unit, or -1 if not present in the current OpenMP context
  591. but might be present in another OpenMP context in the same TU.
  592. </p></dd></dl>
  593. <dl>
  594. <dt><a name="index-TARGET_005fGOACC_005fVALIDATE_005fDIMS"></a>Target Hook: <em>bool</em> <strong>TARGET_GOACC_VALIDATE_DIMS</strong> <em>(tree <var>decl</var>, int *<var>dims</var>, int <var>fn_level</var>, unsigned <var>used</var>)</em></dt>
  595. <dd><p>This hook should check the launch dimensions provided for an OpenACC
  596. compute region, or routine. Defaulted values are represented as -1
  597. and non-constant values as 0. The <var>fn_level</var> is negative for the
  598. function corresponding to the compute region. For a routine it is the
  599. outermost level at which partitioned execution may be spawned. The hook
  600. should verify non-default values. If DECL is NULL, global defaults
  601. are being validated and unspecified defaults should be filled in.
  602. Diagnostics should be issued as appropriate. Return
  603. true, if changes have been made. You must override this hook to
  604. provide dimensions larger than 1.
  605. </p></dd></dl>
  606. <dl>
  607. <dt><a name="index-TARGET_005fGOACC_005fDIM_005fLIMIT"></a>Target Hook: <em>int</em> <strong>TARGET_GOACC_DIM_LIMIT</strong> <em>(int <var>axis</var>)</em></dt>
  608. <dd><p>This hook should return the maximum size of a particular dimension,
  609. or zero if unbounded.
  610. </p></dd></dl>
  611. <dl>
  612. <dt><a name="index-TARGET_005fGOACC_005fFORK_005fJOIN"></a>Target Hook: <em>bool</em> <strong>TARGET_GOACC_FORK_JOIN</strong> <em>(gcall *<var>call</var>, const int *<var>dims</var>, bool <var>is_fork</var>)</em></dt>
  613. <dd><p>This hook can be used to convert IFN_GOACC_FORK and IFN_GOACC_JOIN
  614. function calls to target-specific gimple, or indicate whether they
  615. should be retained. It is executed during the oacc_device_lower pass.
  616. It should return true, if the call should be retained. It should
  617. return false, if it is to be deleted (either because target-specific
  618. gimple has been inserted before it, or there is no need for it).
  619. The default hook returns false, if there are no RTL expanders for them.
  620. </p></dd></dl>
  621. <dl>
  622. <dt><a name="index-TARGET_005fGOACC_005fREDUCTION"></a>Target Hook: <em>void</em> <strong>TARGET_GOACC_REDUCTION</strong> <em>(gcall *<var>call</var>)</em></dt>
  623. <dd><p>This hook is used by the oacc_transform pass to expand calls to the
  624. <var>GOACC_REDUCTION</var> internal function, into a sequence of gimple
  625. instructions. <var>call</var> is gimple statement containing the call to
  626. the function. This hook removes statement <var>call</var> after the
  627. expanded sequence has been inserted. This hook is also responsible
  628. for allocating any storage for reductions when necessary.
  629. </p></dd></dl>
  630. <dl>
  631. <dt><a name="index-TARGET_005fPREFERRED_005fELSE_005fVALUE"></a>Target Hook: <em>tree</em> <strong>TARGET_PREFERRED_ELSE_VALUE</strong> <em>(unsigned <var>ifn</var>, tree <var>type</var>, unsigned <var>nops</var>, tree *<var>ops</var>)</em></dt>
  632. <dd><p>This hook returns the target&rsquo;s preferred final argument for a call
  633. to conditional internal function <var>ifn</var> (really of type
  634. <code>internal_fn</code>). <var>type</var> specifies the return type of the
  635. function and <var>ops</var> are the operands to the conditional operation,
  636. of which there are <var>nops</var>.
  637. </p>
  638. <p>For example, if <var>ifn</var> is <code>IFN_COND_ADD</code>, the hook returns
  639. a value of type <var>type</var> that should be used when &lsquo;<samp><var>ops</var>[0]</samp>&rsquo;
  640. and &lsquo;<samp><var>ops</var>[1]</samp>&rsquo; are conditionally added together.
  641. </p>
  642. <p>This hook is only relevant if the target supports conditional patterns
  643. like <code>cond_add<var>m</var></code>. The default implementation returns a zero
  644. constant of type <var>type</var>.
  645. </p></dd></dl>
  646. <hr>
  647. <div class="header">
  648. <p>
  649. Next: <a href="Anchored-Addresses.html#Anchored-Addresses" accesskey="n" rel="next">Anchored Addresses</a>, Previous: <a href="Library-Calls.html#Library-Calls" accesskey="p" rel="prev">Library Calls</a>, Up: <a href="Target-Macros.html#Target-Macros" accesskey="u" rel="up">Target Macros</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>
  650. </div>
  651. </body>
  652. </html>