Altera-Nios-II-Built_002din-Functions.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>Using the GNU Compiler Collection (GCC): Altera Nios II Built-in Functions</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): Altera Nios II Built-in Functions">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): Altera Nios II Built-in Functions">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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-Builtins.html#Target-Builtins" rel="up" title="Target Builtins">
  30. <link href="ARC-Built_002din-Functions.html#ARC-Built_002din-Functions" rel="next" title="ARC Built-in Functions">
  31. <link href="Alpha-Built_002din-Functions.html#Alpha-Built_002din-Functions" rel="prev" title="Alpha Built-in Functions">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="Altera-Nios-II-Built_002din-Functions"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="ARC-Built_002din-Functions.html#ARC-Built_002din-Functions" accesskey="n" rel="next">ARC Built-in Functions</a>, Previous: <a href="Alpha-Built_002din-Functions.html#Alpha-Built_002din-Functions" accesskey="p" rel="prev">Alpha Built-in Functions</a>, Up: <a href="Target-Builtins.html#Target-Builtins" accesskey="u" rel="up">Target Builtins</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>
  66. </div>
  67. <hr>
  68. <a name="Altera-Nios-II-Built_002din-Functions-1"></a>
  69. <h4 class="subsection">6.60.3 Altera Nios II Built-in Functions</h4>
  70. <p>These built-in functions are available for the Altera Nios II
  71. family of processors.
  72. </p>
  73. <p>The following built-in functions are always available. They
  74. all generate the machine instruction that is part of the name.
  75. </p>
  76. <div class="example">
  77. <pre class="example">int __builtin_ldbio (volatile const void *)
  78. int __builtin_ldbuio (volatile const void *)
  79. int __builtin_ldhio (volatile const void *)
  80. int __builtin_ldhuio (volatile const void *)
  81. int __builtin_ldwio (volatile const void *)
  82. void __builtin_stbio (volatile void *, int)
  83. void __builtin_sthio (volatile void *, int)
  84. void __builtin_stwio (volatile void *, int)
  85. void __builtin_sync (void)
  86. int __builtin_rdctl (int)
  87. int __builtin_rdprs (int, int)
  88. void __builtin_wrctl (int, int)
  89. void __builtin_flushd (volatile void *)
  90. void __builtin_flushda (volatile void *)
  91. int __builtin_wrpie (int);
  92. void __builtin_eni (int);
  93. int __builtin_ldex (volatile const void *)
  94. int __builtin_stex (volatile void *, int)
  95. int __builtin_ldsex (volatile const void *)
  96. int __builtin_stsex (volatile void *, int)
  97. </pre></div>
  98. <p>The following built-in functions are always available. They
  99. all generate a Nios II Custom Instruction. The name of the
  100. function represents the types that the function takes and
  101. returns. The letter before the <code>n</code> is the return type
  102. or void if absent. The <code>n</code> represents the first parameter
  103. to all the custom instructions, the custom instruction number.
  104. The two letters after the <code>n</code> represent the up to two
  105. parameters to the function.
  106. </p>
  107. <p>The letters represent the following data types:
  108. </p><dl compact="compact">
  109. <dt><code>&lt;no letter&gt;</code></dt>
  110. <dd><p><code>void</code> for return type and no parameter for parameter types.
  111. </p>
  112. </dd>
  113. <dt><code>i</code></dt>
  114. <dd><p><code>int</code> for return type and parameter type
  115. </p>
  116. </dd>
  117. <dt><code>f</code></dt>
  118. <dd><p><code>float</code> for return type and parameter type
  119. </p>
  120. </dd>
  121. <dt><code>p</code></dt>
  122. <dd><p><code>void *</code> for return type and parameter type
  123. </p>
  124. </dd>
  125. </dl>
  126. <p>And the function names are:
  127. </p><div class="example">
  128. <pre class="example">void __builtin_custom_n (void)
  129. void __builtin_custom_ni (int)
  130. void __builtin_custom_nf (float)
  131. void __builtin_custom_np (void *)
  132. void __builtin_custom_nii (int, int)
  133. void __builtin_custom_nif (int, float)
  134. void __builtin_custom_nip (int, void *)
  135. void __builtin_custom_nfi (float, int)
  136. void __builtin_custom_nff (float, float)
  137. void __builtin_custom_nfp (float, void *)
  138. void __builtin_custom_npi (void *, int)
  139. void __builtin_custom_npf (void *, float)
  140. void __builtin_custom_npp (void *, void *)
  141. int __builtin_custom_in (void)
  142. int __builtin_custom_ini (int)
  143. int __builtin_custom_inf (float)
  144. int __builtin_custom_inp (void *)
  145. int __builtin_custom_inii (int, int)
  146. int __builtin_custom_inif (int, float)
  147. int __builtin_custom_inip (int, void *)
  148. int __builtin_custom_infi (float, int)
  149. int __builtin_custom_inff (float, float)
  150. int __builtin_custom_infp (float, void *)
  151. int __builtin_custom_inpi (void *, int)
  152. int __builtin_custom_inpf (void *, float)
  153. int __builtin_custom_inpp (void *, void *)
  154. float __builtin_custom_fn (void)
  155. float __builtin_custom_fni (int)
  156. float __builtin_custom_fnf (float)
  157. float __builtin_custom_fnp (void *)
  158. float __builtin_custom_fnii (int, int)
  159. float __builtin_custom_fnif (int, float)
  160. float __builtin_custom_fnip (int, void *)
  161. float __builtin_custom_fnfi (float, int)
  162. float __builtin_custom_fnff (float, float)
  163. float __builtin_custom_fnfp (float, void *)
  164. float __builtin_custom_fnpi (void *, int)
  165. float __builtin_custom_fnpf (void *, float)
  166. float __builtin_custom_fnpp (void *, void *)
  167. void * __builtin_custom_pn (void)
  168. void * __builtin_custom_pni (int)
  169. void * __builtin_custom_pnf (float)
  170. void * __builtin_custom_pnp (void *)
  171. void * __builtin_custom_pnii (int, int)
  172. void * __builtin_custom_pnif (int, float)
  173. void * __builtin_custom_pnip (int, void *)
  174. void * __builtin_custom_pnfi (float, int)
  175. void * __builtin_custom_pnff (float, float)
  176. void * __builtin_custom_pnfp (float, void *)
  177. void * __builtin_custom_pnpi (void *, int)
  178. void * __builtin_custom_pnpf (void *, float)
  179. void * __builtin_custom_pnpp (void *, void *)
  180. </pre></div>
  181. <hr>
  182. <div class="header">
  183. <p>
  184. Next: <a href="ARC-Built_002din-Functions.html#ARC-Built_002din-Functions" accesskey="n" rel="next">ARC Built-in Functions</a>, Previous: <a href="Alpha-Built_002din-Functions.html#Alpha-Built_002din-Functions" accesskey="p" rel="prev">Alpha Built-in Functions</a>, Up: <a href="Target-Builtins.html#Target-Builtins" accesskey="u" rel="up">Target Builtins</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>
  185. </div>
  186. </body>
  187. </html>