summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/arc-simd-built-in-functions.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/gcc~13/arc-simd-built-in-functions.html')
-rw-r--r--devdocs/gcc~13/arc-simd-built-in-functions.html123
1 files changed, 123 insertions, 0 deletions
diff --git a/devdocs/gcc~13/arc-simd-built-in-functions.html b/devdocs/gcc~13/arc-simd-built-in-functions.html
new file mode 100644
index 00000000..c8f56845
--- /dev/null
+++ b/devdocs/gcc~13/arc-simd-built-in-functions.html
@@ -0,0 +1,123 @@
+<div class="subsection-level-extent" id="ARC-SIMD-Built-in-Functions"> <div class="nav-panel"> <p> Next: <a href="arm-iwmmxt-built-in-functions" accesskey="n" rel="next">ARM iWMMXt Built-in Functions</a>, Previous: <a href="arc-built-in-functions" accesskey="p" rel="prev">ARC Built-in Functions</a>, Up: <a href="target-builtins" accesskey="u" rel="up">Built-in Functions Specific to Particular Target Machines</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="subsection" id="ARC-SIMD-Built-in-Functions-1"><span>6.60.5 ARC SIMD Built-in Functions<a class="copiable-link" href="#ARC-SIMD-Built-in-Functions-1"> ΒΆ</a></span></h1> <p>SIMD builtins provided by the compiler can be used to generate the vector instructions. This section describes the available builtins and their usage in programs. With the <samp class="option">-msimd</samp> option, the compiler provides 128-bit vector types, which can be specified using the <code class="code">vector_size</code> attribute. The header file <samp class="file">arc-simd.h</samp> can be included to use the following predefined types: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">typedef int __v4si __attribute__((vector_size(16)));
+typedef short __v8hi __attribute__((vector_size(16)));</pre>
+</div> <p>These types can be used to define 128-bit variables. The built-in functions listed in the following section can be used on these variables to generate the vector operations. </p> <p>For all builtins, <code class="code">__builtin_arc_<var class="var">someinsn</var></code>, the header file <samp class="file">arc-simd.h</samp> also provides equivalent macros called <code class="code">_<var class="var">someinsn</var></code> that can be used for programming ease and improved readability. The following macros for DMA control are also provided: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">#define _setup_dma_in_channel_reg _vdiwr
+#define _setup_dma_out_channel_reg _vdowr</pre>
+</div> <p>The following is a complete list of all the SIMD built-ins provided for ARC, grouped by calling signature. </p> <p>The following take two <code class="code">__v8hi</code> arguments and return a <code class="code">__v8hi</code> result: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vaddaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vaddw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vand (__v8hi, __v8hi);
+__v8hi __builtin_arc_vandaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vavb (__v8hi, __v8hi);
+__v8hi __builtin_arc_vavrb (__v8hi, __v8hi);
+__v8hi __builtin_arc_vbic (__v8hi, __v8hi);
+__v8hi __builtin_arc_vbicaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vdifaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vdifw (__v8hi, __v8hi);
+__v8hi __builtin_arc_veqw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vh264f (__v8hi, __v8hi);
+__v8hi __builtin_arc_vh264ft (__v8hi, __v8hi);
+__v8hi __builtin_arc_vh264fw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vlew (__v8hi, __v8hi);
+__v8hi __builtin_arc_vltw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmaxaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmaxw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vminaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vminw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr1aw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr1w (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr2aw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr2w (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr3aw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr3w (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr4aw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr4w (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr5aw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr5w (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr6aw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr6w (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr7aw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmr7w (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmrb (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmulaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmulfaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmulfw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vmulw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vnew (__v8hi, __v8hi);
+__v8hi __builtin_arc_vor (__v8hi, __v8hi);
+__v8hi __builtin_arc_vsubaw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vsubw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vsummw (__v8hi, __v8hi);
+__v8hi __builtin_arc_vvc1f (__v8hi, __v8hi);
+__v8hi __builtin_arc_vvc1ft (__v8hi, __v8hi);
+__v8hi __builtin_arc_vxor (__v8hi, __v8hi);
+__v8hi __builtin_arc_vxoraw (__v8hi, __v8hi);</pre>
+</div> <p>The following take one <code class="code">__v8hi</code> and one <code class="code">int</code> argument and return a <code class="code">__v8hi</code> result: </p> <div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vbaddw (__v8hi, int);
+__v8hi __builtin_arc_vbmaxw (__v8hi, int);
+__v8hi __builtin_arc_vbminw (__v8hi, int);
+__v8hi __builtin_arc_vbmulaw (__v8hi, int);
+__v8hi __builtin_arc_vbmulfw (__v8hi, int);
+__v8hi __builtin_arc_vbmulw (__v8hi, int);
+__v8hi __builtin_arc_vbrsubw (__v8hi, int);
+__v8hi __builtin_arc_vbsubw (__v8hi, int);</pre>
+</div> <p>The following take one <code class="code">__v8hi</code> argument and one <code class="code">int</code> argument which must be a 3-bit compile time constant indicating a register number I0-I7. They return a <code class="code">__v8hi</code> result. </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vasrw (__v8hi, const int);
+__v8hi __builtin_arc_vsr8 (__v8hi, const int);
+__v8hi __builtin_arc_vsr8aw (__v8hi, const int);</pre>
+</div> <p>The following take one <code class="code">__v8hi</code> argument and one <code class="code">int</code> argument which must be a 6-bit compile time constant. They return a <code class="code">__v8hi</code> result. </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vasrpwbi (__v8hi, const int);
+__v8hi __builtin_arc_vasrrpwbi (__v8hi, const int);
+__v8hi __builtin_arc_vasrrwi (__v8hi, const int);
+__v8hi __builtin_arc_vasrsrwi (__v8hi, const int);
+__v8hi __builtin_arc_vasrwi (__v8hi, const int);
+__v8hi __builtin_arc_vsr8awi (__v8hi, const int);
+__v8hi __builtin_arc_vsr8i (__v8hi, const int);</pre>
+</div> <p>The following take one <code class="code">__v8hi</code> argument and one <code class="code">int</code> argument which must be a 8-bit compile time constant. They return a <code class="code">__v8hi</code> result. </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vd6tapf (__v8hi, const int);
+__v8hi __builtin_arc_vmvaw (__v8hi, const int);
+__v8hi __builtin_arc_vmvw (__v8hi, const int);
+__v8hi __builtin_arc_vmvzw (__v8hi, const int);</pre>
+</div> <p>The following take two <code class="code">int</code> arguments, the second of which which must be a 8-bit compile time constant. They return a <code class="code">__v8hi</code> result: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vmovaw (int, const int);
+__v8hi __builtin_arc_vmovw (int, const int);
+__v8hi __builtin_arc_vmovzw (int, const int);</pre>
+</div> <p>The following take a single <code class="code">__v8hi</code> argument and return a <code class="code">__v8hi</code> result: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vabsaw (__v8hi);
+__v8hi __builtin_arc_vabsw (__v8hi);
+__v8hi __builtin_arc_vaddsuw (__v8hi);
+__v8hi __builtin_arc_vexch1 (__v8hi);
+__v8hi __builtin_arc_vexch2 (__v8hi);
+__v8hi __builtin_arc_vexch4 (__v8hi);
+__v8hi __builtin_arc_vsignw (__v8hi);
+__v8hi __builtin_arc_vupbaw (__v8hi);
+__v8hi __builtin_arc_vupbw (__v8hi);
+__v8hi __builtin_arc_vupsbaw (__v8hi);
+__v8hi __builtin_arc_vupsbw (__v8hi);</pre>
+</div> <p>The following take two <code class="code">int</code> arguments and return no result: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">void __builtin_arc_vdirun (int, int);
+void __builtin_arc_vdorun (int, int);</pre>
+</div> <p>The following take two <code class="code">int</code> arguments and return no result. The first argument must a 3-bit compile time constant indicating one of the DR0-DR7 DMA setup channels: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">void __builtin_arc_vdiwr (const int, int);
+void __builtin_arc_vdowr (const int, int);</pre>
+</div> <p>The following take an <code class="code">int</code> argument and return no result: </p>
+<div class="example"> <pre class="example-preformatted" data-language="cpp">void __builtin_arc_vendrec (int);
+void __builtin_arc_vrec (int);
+void __builtin_arc_vrecrun (int);
+void __builtin_arc_vrun (int);</pre>
+</div> <p>The following take a <code class="code">__v8hi</code> argument and two <code class="code">int</code> arguments and return a <code class="code">__v8hi</code> result. The second argument must be a 3-bit compile time constants, indicating one the registers I0-I7, and the third argument must be an 8-bit compile time constant. </p> <p><em class="emph">Note:</em> Although the equivalent hardware instructions do not take an SIMD register as an operand, these builtins overwrite the relevant bits of the <code class="code">__v8hi</code> register provided as the first argument with the value loaded from the <code class="code">[Ib, u8]</code> location in the SDM. </p> <div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vld32 (__v8hi, const int, const int);
+__v8hi __builtin_arc_vld32wh (__v8hi, const int, const int);
+__v8hi __builtin_arc_vld32wl (__v8hi, const int, const int);
+__v8hi __builtin_arc_vld64 (__v8hi, const int, const int);</pre>
+</div> <p>The following take two <code class="code">int</code> arguments and return a <code class="code">__v8hi</code> result. The first argument must be a 3-bit compile time constants, indicating one the registers I0-I7, and the second argument must be an 8-bit compile time constant. </p> <div class="example"> <pre class="example-preformatted" data-language="cpp">__v8hi __builtin_arc_vld128 (const int, const int);
+__v8hi __builtin_arc_vld64w (const int, const int);</pre>
+</div> <p>The following take a <code class="code">__v8hi</code> argument and two <code class="code">int</code> arguments and return no result. The second argument must be a 3-bit compile time constants, indicating one the registers I0-I7, and the third argument must be an 8-bit compile time constant. </p> <div class="example"> <pre class="example-preformatted" data-language="cpp">void __builtin_arc_vst128 (__v8hi, const int, const int);
+void __builtin_arc_vst64 (__v8hi, const int, const int);</pre>
+</div> <p>The following take a <code class="code">__v8hi</code> argument and three <code class="code">int</code> arguments and return no result. The second argument must be a 3-bit compile-time constant, identifying the 16-bit sub-register to be stored, the third argument must be a 3-bit compile time constants, indicating one the registers I0-I7, and the fourth argument must be an 8-bit compile time constant. </p> <div class="example"> <pre class="example-preformatted" data-language="cpp">void __builtin_arc_vst16_n (__v8hi, const int, const int, const int);
+void __builtin_arc_vst32_n (__v8hi, const int, const int, const int);</pre>
+</div> </div> <div class="nav-panel"> <p> Next: <a href="arm-iwmmxt-built-in-functions">ARM iWMMXt Built-in Functions</a>, Previous: <a href="arc-built-in-functions">ARC Built-in Functions</a>, Up: <a href="target-builtins">Built-in Functions Specific to Particular Target Machines</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
+ <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/ARC-SIMD-Built-in-Functions.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/ARC-SIMD-Built-in-Functions.html</a>
+ </p>
+</div>