]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gcc/extensions-to-the-c-language-family/target-builtins/altera-nios-ii-built-in-functions.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gcc / extensions-to-the-c-language-family / target-builtins / altera-nios-ii-built-in-functions.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. _altera-nios-ii-built-in-functions:
7
8Altera Nios II Built-in Functions
9^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
11These built-in functions are available for the Altera Nios II
12family of processors.
13
14The following built-in functions are always available. They
15all generate the machine instruction that is part of the name.
16
17.. code-block:: c++
18
19 int __builtin_ldbio (volatile const void *);
20 int __builtin_ldbuio (volatile const void *);
21 int __builtin_ldhio (volatile const void *);
22 int __builtin_ldhuio (volatile const void *);
23 int __builtin_ldwio (volatile const void *);
24 void __builtin_stbio (volatile void *, int);
25 void __builtin_sthio (volatile void *, int);
26 void __builtin_stwio (volatile void *, int);
27 void __builtin_sync (void);
28 int __builtin_rdctl (int);
29 int __builtin_rdprs (int, int);
30 void __builtin_wrctl (int, int);
31 void __builtin_flushd (volatile void *);
32 void __builtin_flushda (volatile void *);
33 int __builtin_wrpie (int);
34 void __builtin_eni (int);
35 int __builtin_ldex (volatile const void *);
36 int __builtin_stex (volatile void *, int);
37 int __builtin_ldsex (volatile const void *);
38 int __builtin_stsex (volatile void *, int);
39
40The following built-in functions are always available. They
41all generate a Nios II Custom Instruction. The name of the
42function represents the types that the function takes and
43returns. The letter before the ``n`` is the return type
44or void if absent. The ``n`` represents the first parameter
45to all the custom instructions, the custom instruction number.
46The two letters after the ``n`` represent the up to two
47parameters to the function.
48
49The letters represent the following data types:
50
51``<no letter>``
52 ``void`` for return type and no parameter for parameter types.
53
54``i``
55 ``int`` for return type and parameter type
56
57``f``
58 ``float`` for return type and parameter type
59
60``p``
61 ``void *`` for return type and parameter type
62
63 And the function names are:
64
65.. code-block:: c++
66
67 void __builtin_custom_n (void);
68 void __builtin_custom_ni (int);
69 void __builtin_custom_nf (float);
70 void __builtin_custom_np (void *);
71 void __builtin_custom_nii (int, int);
72 void __builtin_custom_nif (int, float);
73 void __builtin_custom_nip (int, void *);
74 void __builtin_custom_nfi (float, int);
75 void __builtin_custom_nff (float, float);
76 void __builtin_custom_nfp (float, void *);
77 void __builtin_custom_npi (void *, int);
78 void __builtin_custom_npf (void *, float);
79 void __builtin_custom_npp (void *, void *);
80 int __builtin_custom_in (void);
81 int __builtin_custom_ini (int);
82 int __builtin_custom_inf (float);
83 int __builtin_custom_inp (void *);
84 int __builtin_custom_inii (int, int);
85 int __builtin_custom_inif (int, float);
86 int __builtin_custom_inip (int, void *);
87 int __builtin_custom_infi (float, int);
88 int __builtin_custom_inff (float, float);
89 int __builtin_custom_infp (float, void *);
90 int __builtin_custom_inpi (void *, int);
91 int __builtin_custom_inpf (void *, float);
92 int __builtin_custom_inpp (void *, void *);
93 float __builtin_custom_fn (void);
94 float __builtin_custom_fni (int);
95 float __builtin_custom_fnf (float);
96 float __builtin_custom_fnp (void *);
97 float __builtin_custom_fnii (int, int);
98 float __builtin_custom_fnif (int, float);
99 float __builtin_custom_fnip (int, void *);
100 float __builtin_custom_fnfi (float, int);
101 float __builtin_custom_fnff (float, float);
102 float __builtin_custom_fnfp (float, void *);
103 float __builtin_custom_fnpi (void *, int);
104 float __builtin_custom_fnpf (void *, float);
105 float __builtin_custom_fnpp (void *, void *);
106 void * __builtin_custom_pn (void);
107 void * __builtin_custom_pni (int);
108 void * __builtin_custom_pnf (float);
109 void * __builtin_custom_pnp (void *);
110 void * __builtin_custom_pnii (int, int);
111 void * __builtin_custom_pnif (int, float);
112 void * __builtin_custom_pnip (int, void *);
113 void * __builtin_custom_pnfi (float, int);
114 void * __builtin_custom_pnff (float, float);
115 void * __builtin_custom_pnfp (float, void *);
116 void * __builtin_custom_pnpi (void *, int);
117 void * __builtin_custom_pnpf (void *, float);
3ed1b4ce 118 void * __builtin_custom_pnpp (void *, void *);