blob: 17c12b31a1e3e7d24233dc8e403557b18d335644 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2015 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
"GNU Free Documentation License".
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using the GNU Compiler Collection (GCC): Altera Nios II Built-in Functions</title>
<meta name="description" content="Using the GNU Compiler Collection (GCC): Altera Nios II Built-in Functions">
<meta name="keywords" content="Using the GNU Compiler Collection (GCC): Altera Nios II Built-in Functions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Target-Builtins.html#Target-Builtins" rel="up" title="Target Builtins">
<link href="ARC-Built_002din-Functions.html#ARC-Built_002din-Functions" rel="next" title="ARC Built-in Functions">
<link href="Alpha-Built_002din-Functions.html#Alpha-Built_002din-Functions" rel="prev" title="Alpha Built-in Functions">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Altera-Nios-II-Built_002din-Functions"></a>
<div class="header">
<p>
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>
</div>
<hr>
<a name="Altera-Nios-II-Built_002din-Functions-1"></a>
<h4 class="subsection">6.57.3 Altera Nios II Built-in Functions</h4>
<p>These built-in functions are available for the Altera Nios II
family of processors.
</p>
<p>The following built-in functions are always available. They
all generate the machine instruction that is part of the name.
</p>
<div class="example">
<pre class="example">int __builtin_ldbio (volatile const void *)
int __builtin_ldbuio (volatile const void *)
int __builtin_ldhio (volatile const void *)
int __builtin_ldhuio (volatile const void *)
int __builtin_ldwio (volatile const void *)
void __builtin_stbio (volatile void *, int)
void __builtin_sthio (volatile void *, int)
void __builtin_stwio (volatile void *, int)
void __builtin_sync (void)
int __builtin_rdctl (int)
void __builtin_wrctl (int, int)
</pre></div>
<p>The following built-in functions are always available. They
all generate a Nios II Custom Instruction. The name of the
function represents the types that the function takes and
returns. The letter before the <code>n</code> is the return type
or void if absent. The <code>n</code> represents the first parameter
to all the custom instructions, the custom instruction number.
The two letters after the <code>n</code> represent the up to two
parameters to the function.
</p>
<p>The letters represent the following data types:
</p><dl compact="compact">
<dt><code>&lt;no letter&gt;</code></dt>
<dd><p><code>void</code> for return type and no parameter for parameter types.
</p>
</dd>
<dt><code>i</code></dt>
<dd><p><code>int</code> for return type and parameter type
</p>
</dd>
<dt><code>f</code></dt>
<dd><p><code>float</code> for return type and parameter type
</p>
</dd>
<dt><code>p</code></dt>
<dd><p><code>void *</code> for return type and parameter type
</p>
</dd>
</dl>
<p>And the function names are:
</p><div class="example">
<pre class="example">void __builtin_custom_n (void)
void __builtin_custom_ni (int)
void __builtin_custom_nf (float)
void __builtin_custom_np (void *)
void __builtin_custom_nii (int, int)
void __builtin_custom_nif (int, float)
void __builtin_custom_nip (int, void *)
void __builtin_custom_nfi (float, int)
void __builtin_custom_nff (float, float)
void __builtin_custom_nfp (float, void *)
void __builtin_custom_npi (void *, int)
void __builtin_custom_npf (void *, float)
void __builtin_custom_npp (void *, void *)
int __builtin_custom_in (void)
int __builtin_custom_ini (int)
int __builtin_custom_inf (float)
int __builtin_custom_inp (void *)
int __builtin_custom_inii (int, int)
int __builtin_custom_inif (int, float)
int __builtin_custom_inip (int, void *)
int __builtin_custom_infi (float, int)
int __builtin_custom_inff (float, float)
int __builtin_custom_infp (float, void *)
int __builtin_custom_inpi (void *, int)
int __builtin_custom_inpf (void *, float)
int __builtin_custom_inpp (void *, void *)
float __builtin_custom_fn (void)
float __builtin_custom_fni (int)
float __builtin_custom_fnf (float)
float __builtin_custom_fnp (void *)
float __builtin_custom_fnii (int, int)
float __builtin_custom_fnif (int, float)
float __builtin_custom_fnip (int, void *)
float __builtin_custom_fnfi (float, int)
float __builtin_custom_fnff (float, float)
float __builtin_custom_fnfp (float, void *)
float __builtin_custom_fnpi (void *, int)
float __builtin_custom_fnpf (void *, float)
float __builtin_custom_fnpp (void *, void *)
void * __builtin_custom_pn (void)
void * __builtin_custom_pni (int)
void * __builtin_custom_pnf (float)
void * __builtin_custom_pnp (void *)
void * __builtin_custom_pnii (int, int)
void * __builtin_custom_pnif (int, float)
void * __builtin_custom_pnip (int, void *)
void * __builtin_custom_pnfi (float, int)
void * __builtin_custom_pnff (float, float)
void * __builtin_custom_pnfp (float, void *)
void * __builtin_custom_pnpi (void *, int)
void * __builtin_custom_pnpf (void *, float)
void * __builtin_custom_pnpp (void *, void *)
</pre></div>
<hr>
<div class="header">
<p>
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>
</div>
</body>
</html>