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.

203 lines
8.3KB

  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>Altera Nios II Built-in Functions (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="Altera Nios II Built-in Functions (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="Altera Nios II Built-in Functions (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="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.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="Altera-Nios-II-Built_002din-Functions"></a>
  62. <div class="header">
  63. <p>
  64. 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>
  65. </div>
  66. <hr>
  67. <a name="Altera-Nios-II-Built_002din-Functions-1"></a>
  68. <h4 class="subsection">6.60.3 Altera Nios II Built-in Functions</h4>
  69. <p>These built-in functions are available for the Altera Nios II
  70. family of processors.
  71. </p>
  72. <p>The following built-in functions are always available. They
  73. all generate the machine instruction that is part of the name.
  74. </p>
  75. <div class="example">
  76. <pre class="example">int __builtin_ldbio (volatile const void *)
  77. int __builtin_ldbuio (volatile const void *)
  78. int __builtin_ldhio (volatile const void *)
  79. int __builtin_ldhuio (volatile const void *)
  80. int __builtin_ldwio (volatile const void *)
  81. void __builtin_stbio (volatile void *, int)
  82. void __builtin_sthio (volatile void *, int)
  83. void __builtin_stwio (volatile void *, int)
  84. void __builtin_sync (void)
  85. int __builtin_rdctl (int)
  86. int __builtin_rdprs (int, int)
  87. void __builtin_wrctl (int, int)
  88. void __builtin_flushd (volatile void *)
  89. void __builtin_flushda (volatile void *)
  90. int __builtin_wrpie (int);
  91. void __builtin_eni (int);
  92. int __builtin_ldex (volatile const void *)
  93. int __builtin_stex (volatile void *, int)
  94. int __builtin_ldsex (volatile const void *)
  95. int __builtin_stsex (volatile void *, int)
  96. </pre></div>
  97. <p>The following built-in functions are always available. They
  98. all generate a Nios II Custom Instruction. The name of the
  99. function represents the types that the function takes and
  100. returns. The letter before the <code>n</code> is the return type
  101. or void if absent. The <code>n</code> represents the first parameter
  102. to all the custom instructions, the custom instruction number.
  103. The two letters after the <code>n</code> represent the up to two
  104. parameters to the function.
  105. </p>
  106. <p>The letters represent the following data types:
  107. </p><dl compact="compact">
  108. <dt><code>&lt;no letter&gt;</code></dt>
  109. <dd><p><code>void</code> for return type and no parameter for parameter types.
  110. </p>
  111. </dd>
  112. <dt><code>i</code></dt>
  113. <dd><p><code>int</code> for return type and parameter type
  114. </p>
  115. </dd>
  116. <dt><code>f</code></dt>
  117. <dd><p><code>float</code> for return type and parameter type
  118. </p>
  119. </dd>
  120. <dt><code>p</code></dt>
  121. <dd><p><code>void *</code> for return type and parameter type
  122. </p>
  123. </dd>
  124. </dl>
  125. <p>And the function names are:
  126. </p><div class="example">
  127. <pre class="example">void __builtin_custom_n (void)
  128. void __builtin_custom_ni (int)
  129. void __builtin_custom_nf (float)
  130. void __builtin_custom_np (void *)
  131. void __builtin_custom_nii (int, int)
  132. void __builtin_custom_nif (int, float)
  133. void __builtin_custom_nip (int, void *)
  134. void __builtin_custom_nfi (float, int)
  135. void __builtin_custom_nff (float, float)
  136. void __builtin_custom_nfp (float, void *)
  137. void __builtin_custom_npi (void *, int)
  138. void __builtin_custom_npf (void *, float)
  139. void __builtin_custom_npp (void *, void *)
  140. int __builtin_custom_in (void)
  141. int __builtin_custom_ini (int)
  142. int __builtin_custom_inf (float)
  143. int __builtin_custom_inp (void *)
  144. int __builtin_custom_inii (int, int)
  145. int __builtin_custom_inif (int, float)
  146. int __builtin_custom_inip (int, void *)
  147. int __builtin_custom_infi (float, int)
  148. int __builtin_custom_inff (float, float)
  149. int __builtin_custom_infp (float, void *)
  150. int __builtin_custom_inpi (void *, int)
  151. int __builtin_custom_inpf (void *, float)
  152. int __builtin_custom_inpp (void *, void *)
  153. float __builtin_custom_fn (void)
  154. float __builtin_custom_fni (int)
  155. float __builtin_custom_fnf (float)
  156. float __builtin_custom_fnp (void *)
  157. float __builtin_custom_fnii (int, int)
  158. float __builtin_custom_fnif (int, float)
  159. float __builtin_custom_fnip (int, void *)
  160. float __builtin_custom_fnfi (float, int)
  161. float __builtin_custom_fnff (float, float)
  162. float __builtin_custom_fnfp (float, void *)
  163. float __builtin_custom_fnpi (void *, int)
  164. float __builtin_custom_fnpf (void *, float)
  165. float __builtin_custom_fnpp (void *, void *)
  166. void * __builtin_custom_pn (void)
  167. void * __builtin_custom_pni (int)
  168. void * __builtin_custom_pnf (float)
  169. void * __builtin_custom_pnp (void *)
  170. void * __builtin_custom_pnii (int, int)
  171. void * __builtin_custom_pnif (int, float)
  172. void * __builtin_custom_pnip (int, void *)
  173. void * __builtin_custom_pnfi (float, int)
  174. void * __builtin_custom_pnff (float, float)
  175. void * __builtin_custom_pnfp (float, void *)
  176. void * __builtin_custom_pnpi (void *, int)
  177. void * __builtin_custom_pnpf (void *, float)
  178. void * __builtin_custom_pnpp (void *, void *)
  179. </pre></div>
  180. <hr>
  181. <div class="header">
  182. <p>
  183. 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>
  184. </div>
  185. </body>
  186. </html>