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.

308 line
14KB

  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>PowerPC Function Attributes (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="PowerPC Function Attributes (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="PowerPC Function Attributes (Using the GNU Compiler Collection (GCC))">
  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="Function-Attributes.html#Function-Attributes" rel="up" title="Function Attributes">
  30. <link href="RISC_002dV-Function-Attributes.html#RISC_002dV-Function-Attributes" rel="next" title="RISC-V Function Attributes">
  31. <link href="Nvidia-PTX-Function-Attributes.html#Nvidia-PTX-Function-Attributes" rel="prev" title="Nvidia PTX Function Attributes">
  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="PowerPC-Function-Attributes"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="RISC_002dV-Function-Attributes.html#RISC_002dV-Function-Attributes" accesskey="n" rel="next">RISC-V Function Attributes</a>, Previous: <a href="Nvidia-PTX-Function-Attributes.html#Nvidia-PTX-Function-Attributes" accesskey="p" rel="prev">Nvidia PTX Function Attributes</a>, Up: <a href="Function-Attributes.html#Function-Attributes" accesskey="u" rel="up">Function Attributes</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="PowerPC-Function-Attributes-1"></a>
  68. <h4 class="subsection">6.33.26 PowerPC Function Attributes</h4>
  69. <p>These function attributes are supported by the PowerPC back end:
  70. </p>
  71. <dl compact="compact">
  72. <dt><code>longcall</code></dt>
  73. <dt><code>shortcall</code></dt>
  74. <dd><a name="index-indirect-calls_002c-PowerPC"></a>
  75. <a name="index-longcall-function-attribute_002c-PowerPC"></a>
  76. <a name="index-shortcall-function-attribute_002c-PowerPC"></a>
  77. <p>The <code>longcall</code> attribute
  78. indicates that the function might be far away from the call site and
  79. require a different (more expensive) calling sequence. The
  80. <code>shortcall</code> attribute indicates that the function is always close
  81. enough for the shorter calling sequence to be used. These attributes
  82. override both the <samp>-mlongcall</samp> switch and
  83. the <code>#pragma longcall</code> setting.
  84. </p>
  85. <p>See <a href="RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options">RS/6000 and PowerPC Options</a>, for more information on whether long
  86. calls are necessary.
  87. </p>
  88. </dd>
  89. <dt><code>target (<var>options</var>)</code></dt>
  90. <dd><a name="index-target-function-attribute-3"></a>
  91. <p>As discussed in <a href="Common-Function-Attributes.html#Common-Function-Attributes">Common Function Attributes</a>, this attribute
  92. allows specification of target-specific compilation options.
  93. </p>
  94. <p>On the PowerPC, the following options are allowed:
  95. </p>
  96. <dl compact="compact">
  97. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  98. <dt>&lsquo;<samp>no-altivec</samp>&rsquo;</dt>
  99. <dd><a name="index-target_0028_0022altivec_0022_0029-function-attribute_002c-PowerPC"></a>
  100. <p>Generate code that uses (does not use) AltiVec instructions. In
  101. 32-bit code, you cannot enable AltiVec instructions unless
  102. <samp>-mabi=altivec</samp> is used on the command line.
  103. </p>
  104. </dd>
  105. <dt>&lsquo;<samp>cmpb</samp>&rsquo;</dt>
  106. <dt>&lsquo;<samp>no-cmpb</samp>&rsquo;</dt>
  107. <dd><a name="index-target_0028_0022cmpb_0022_0029-function-attribute_002c-PowerPC"></a>
  108. <p>Generate code that uses (does not use) the compare bytes instruction
  109. implemented on the POWER6 processor and other processors that support
  110. the PowerPC V2.05 architecture.
  111. </p>
  112. </dd>
  113. <dt>&lsquo;<samp>dlmzb</samp>&rsquo;</dt>
  114. <dt>&lsquo;<samp>no-dlmzb</samp>&rsquo;</dt>
  115. <dd><a name="index-target_0028_0022dlmzb_0022_0029-function-attribute_002c-PowerPC"></a>
  116. <p>Generate code that uses (does not use) the string-search &lsquo;<samp>dlmzb</samp>&rsquo;
  117. instruction on the IBM 405, 440, 464 and 476 processors. This instruction is
  118. generated by default when targeting those processors.
  119. </p>
  120. </dd>
  121. <dt>&lsquo;<samp>fprnd</samp>&rsquo;</dt>
  122. <dt>&lsquo;<samp>no-fprnd</samp>&rsquo;</dt>
  123. <dd><a name="index-target_0028_0022fprnd_0022_0029-function-attribute_002c-PowerPC"></a>
  124. <p>Generate code that uses (does not use) the FP round to integer
  125. instructions implemented on the POWER5+ processor and other processors
  126. that support the PowerPC V2.03 architecture.
  127. </p>
  128. </dd>
  129. <dt>&lsquo;<samp>hard-dfp</samp>&rsquo;</dt>
  130. <dt>&lsquo;<samp>no-hard-dfp</samp>&rsquo;</dt>
  131. <dd><a name="index-target_0028_0022hard_002ddfp_0022_0029-function-attribute_002c-PowerPC"></a>
  132. <p>Generate code that uses (does not use) the decimal floating-point
  133. instructions implemented on some POWER processors.
  134. </p>
  135. </dd>
  136. <dt>&lsquo;<samp>isel</samp>&rsquo;</dt>
  137. <dt>&lsquo;<samp>no-isel</samp>&rsquo;</dt>
  138. <dd><a name="index-target_0028_0022isel_0022_0029-function-attribute_002c-PowerPC"></a>
  139. <p>Generate code that uses (does not use) ISEL instruction.
  140. </p>
  141. </dd>
  142. <dt>&lsquo;<samp>mfcrf</samp>&rsquo;</dt>
  143. <dt>&lsquo;<samp>no-mfcrf</samp>&rsquo;</dt>
  144. <dd><a name="index-target_0028_0022mfcrf_0022_0029-function-attribute_002c-PowerPC"></a>
  145. <p>Generate code that uses (does not use) the move from condition
  146. register field instruction implemented on the POWER4 processor and
  147. other processors that support the PowerPC V2.01 architecture.
  148. </p>
  149. </dd>
  150. <dt>&lsquo;<samp>mulhw</samp>&rsquo;</dt>
  151. <dt>&lsquo;<samp>no-mulhw</samp>&rsquo;</dt>
  152. <dd><a name="index-target_0028_0022mulhw_0022_0029-function-attribute_002c-PowerPC"></a>
  153. <p>Generate code that uses (does not use) the half-word multiply and
  154. multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
  155. These instructions are generated by default when targeting those
  156. processors.
  157. </p>
  158. </dd>
  159. <dt>&lsquo;<samp>multiple</samp>&rsquo;</dt>
  160. <dt>&lsquo;<samp>no-multiple</samp>&rsquo;</dt>
  161. <dd><a name="index-target_0028_0022multiple_0022_0029-function-attribute_002c-PowerPC"></a>
  162. <p>Generate code that uses (does not use) the load multiple word
  163. instructions and the store multiple word instructions.
  164. </p>
  165. </dd>
  166. <dt>&lsquo;<samp>update</samp>&rsquo;</dt>
  167. <dt>&lsquo;<samp>no-update</samp>&rsquo;</dt>
  168. <dd><a name="index-target_0028_0022update_0022_0029-function-attribute_002c-PowerPC"></a>
  169. <p>Generate code that uses (does not use) the load or store instructions
  170. that update the base register to the address of the calculated memory
  171. location.
  172. </p>
  173. </dd>
  174. <dt>&lsquo;<samp>popcntb</samp>&rsquo;</dt>
  175. <dt>&lsquo;<samp>no-popcntb</samp>&rsquo;</dt>
  176. <dd><a name="index-target_0028_0022popcntb_0022_0029-function-attribute_002c-PowerPC"></a>
  177. <p>Generate code that uses (does not use) the popcount and double-precision
  178. FP reciprocal estimate instruction implemented on the POWER5
  179. processor and other processors that support the PowerPC V2.02
  180. architecture.
  181. </p>
  182. </dd>
  183. <dt>&lsquo;<samp>popcntd</samp>&rsquo;</dt>
  184. <dt>&lsquo;<samp>no-popcntd</samp>&rsquo;</dt>
  185. <dd><a name="index-target_0028_0022popcntd_0022_0029-function-attribute_002c-PowerPC"></a>
  186. <p>Generate code that uses (does not use) the popcount instruction
  187. implemented on the POWER7 processor and other processors that support
  188. the PowerPC V2.06 architecture.
  189. </p>
  190. </dd>
  191. <dt>&lsquo;<samp>powerpc-gfxopt</samp>&rsquo;</dt>
  192. <dt>&lsquo;<samp>no-powerpc-gfxopt</samp>&rsquo;</dt>
  193. <dd><a name="index-target_0028_0022powerpc_002dgfxopt_0022_0029-function-attribute_002c-PowerPC"></a>
  194. <p>Generate code that uses (does not use) the optional PowerPC
  195. architecture instructions in the Graphics group, including
  196. floating-point select.
  197. </p>
  198. </dd>
  199. <dt>&lsquo;<samp>powerpc-gpopt</samp>&rsquo;</dt>
  200. <dt>&lsquo;<samp>no-powerpc-gpopt</samp>&rsquo;</dt>
  201. <dd><a name="index-target_0028_0022powerpc_002dgpopt_0022_0029-function-attribute_002c-PowerPC"></a>
  202. <p>Generate code that uses (does not use) the optional PowerPC
  203. architecture instructions in the General Purpose group, including
  204. floating-point square root.
  205. </p>
  206. </dd>
  207. <dt>&lsquo;<samp>recip-precision</samp>&rsquo;</dt>
  208. <dt>&lsquo;<samp>no-recip-precision</samp>&rsquo;</dt>
  209. <dd><a name="index-target_0028_0022recip_002dprecision_0022_0029-function-attribute_002c-PowerPC"></a>
  210. <p>Assume (do not assume) that the reciprocal estimate instructions
  211. provide higher-precision estimates than is mandated by the PowerPC
  212. ABI.
  213. </p>
  214. </dd>
  215. <dt>&lsquo;<samp>string</samp>&rsquo;</dt>
  216. <dt>&lsquo;<samp>no-string</samp>&rsquo;</dt>
  217. <dd><a name="index-target_0028_0022string_0022_0029-function-attribute_002c-PowerPC"></a>
  218. <p>Generate code that uses (does not use) the load string instructions
  219. and the store string word instructions to save multiple registers and
  220. do small block moves.
  221. </p>
  222. </dd>
  223. <dt>&lsquo;<samp>vsx</samp>&rsquo;</dt>
  224. <dt>&lsquo;<samp>no-vsx</samp>&rsquo;</dt>
  225. <dd><a name="index-target_0028_0022vsx_0022_0029-function-attribute_002c-PowerPC"></a>
  226. <p>Generate code that uses (does not use) vector/scalar (VSX)
  227. instructions, and also enable the use of built-in functions that allow
  228. more direct access to the VSX instruction set. In 32-bit code, you
  229. cannot enable VSX or AltiVec instructions unless
  230. <samp>-mabi=altivec</samp> is used on the command line.
  231. </p>
  232. </dd>
  233. <dt>&lsquo;<samp>friz</samp>&rsquo;</dt>
  234. <dt>&lsquo;<samp>no-friz</samp>&rsquo;</dt>
  235. <dd><a name="index-target_0028_0022friz_0022_0029-function-attribute_002c-PowerPC"></a>
  236. <p>Generate (do not generate) the <code>friz</code> instruction when the
  237. <samp>-funsafe-math-optimizations</samp> option is used to optimize
  238. rounding a floating-point value to 64-bit integer and back to floating
  239. point. The <code>friz</code> instruction does not return the same value if
  240. the floating-point number is too large to fit in an integer.
  241. </p>
  242. </dd>
  243. <dt>&lsquo;<samp>avoid-indexed-addresses</samp>&rsquo;</dt>
  244. <dt>&lsquo;<samp>no-avoid-indexed-addresses</samp>&rsquo;</dt>
  245. <dd><a name="index-target_0028_0022avoid_002dindexed_002daddresses_0022_0029-function-attribute_002c-PowerPC"></a>
  246. <p>Generate code that tries to avoid (not avoid) the use of indexed load
  247. or store instructions.
  248. </p>
  249. </dd>
  250. <dt>&lsquo;<samp>paired</samp>&rsquo;</dt>
  251. <dt>&lsquo;<samp>no-paired</samp>&rsquo;</dt>
  252. <dd><a name="index-target_0028_0022paired_0022_0029-function-attribute_002c-PowerPC"></a>
  253. <p>Generate code that uses (does not use) the generation of PAIRED simd
  254. instructions.
  255. </p>
  256. </dd>
  257. <dt>&lsquo;<samp>longcall</samp>&rsquo;</dt>
  258. <dt>&lsquo;<samp>no-longcall</samp>&rsquo;</dt>
  259. <dd><a name="index-target_0028_0022longcall_0022_0029-function-attribute_002c-PowerPC"></a>
  260. <p>Generate code that assumes (does not assume) that all calls are far
  261. away so that a longer more expensive calling sequence is required.
  262. </p>
  263. </dd>
  264. <dt>&lsquo;<samp>cpu=<var>CPU</var></samp>&rsquo;</dt>
  265. <dd><a name="index-target_0028_0022cpu_003dCPU_0022_0029-function-attribute_002c-PowerPC"></a>
  266. <p>Specify the architecture to generate code for when compiling the
  267. function. If you select the <code>target(&quot;cpu=power7&quot;)</code> attribute when
  268. generating 32-bit code, VSX and AltiVec instructions are not generated
  269. unless you use the <samp>-mabi=altivec</samp> option on the command line.
  270. </p>
  271. </dd>
  272. <dt>&lsquo;<samp>tune=<var>TUNE</var></samp>&rsquo;</dt>
  273. <dd><a name="index-target_0028_0022tune_003dTUNE_0022_0029-function-attribute_002c-PowerPC"></a>
  274. <p>Specify the architecture to tune for when compiling the function. If
  275. you do not specify the <code>target(&quot;tune=<var>TUNE</var>&quot;)</code> attribute and
  276. you do specify the <code>target(&quot;cpu=<var>CPU</var>&quot;)</code> attribute,
  277. compilation tunes for the <var>CPU</var> architecture, and not the
  278. default tuning specified on the command line.
  279. </p></dd>
  280. </dl>
  281. <p>On the PowerPC, the inliner does not inline a
  282. function that has different target options than the caller, unless the
  283. callee has a subset of the target options of the caller.
  284. </p></dd>
  285. </dl>
  286. <hr>
  287. <div class="header">
  288. <p>
  289. Next: <a href="RISC_002dV-Function-Attributes.html#RISC_002dV-Function-Attributes" accesskey="n" rel="next">RISC-V Function Attributes</a>, Previous: <a href="Nvidia-PTX-Function-Attributes.html#Nvidia-PTX-Function-Attributes" accesskey="p" rel="prev">Nvidia PTX Function Attributes</a>, Up: <a href="Function-Attributes.html#Function-Attributes" accesskey="u" rel="up">Function Attributes</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>
  290. </div>
  291. </body>
  292. </html>