summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/paired-single-arithmetic.html
blob: 2d4ca99c865459a45eea9629988398110a013fbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<div class="subsubsection-level-extent" id="Paired-Single-Arithmetic"> <div class="nav-panel"> <p> Next: <a href="paired-single-built-in-functions" accesskey="n" rel="next">Paired-Single Built-in Functions</a>, Up: <a href="mips-loongson-built-in-functions" accesskey="u" rel="up">MIPS Loongson Built-in Functions</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="subsubsection" id="Paired-Single-Arithmetic-1"><span>6.60.17.1 Paired-Single Arithmetic<a class="copiable-link" href="#Paired-Single-Arithmetic-1"> ¶</a></span></h1> <p>The table below lists the <code class="code">v2sf</code> operations for which hardware support exists. <code class="code">a</code>, <code class="code">b</code> and <code class="code">c</code> are <code class="code">v2sf</code> values and <code class="code">x</code> is an integral value. </p> <table class="multitable"> <thead><tr>
<th width="50%">C code</th>
<th width="50%">MIPS instruction</th>
</tr></thead> <tbody>
<tr>
<td width="50%"><code class="code">a + b</code></td>
<td width="50%"><code class="code">add.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">a - b</code></td>
<td width="50%"><code class="code">sub.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">-a</code></td>
<td width="50%"><code class="code">neg.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">a * b</code></td>
<td width="50%"><code class="code">mul.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">a * b + c</code></td>
<td width="50%"><code class="code">madd.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">a * b - c</code></td>
<td width="50%"><code class="code">msub.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">-(a * b + c)</code></td>
<td width="50%"><code class="code">nmadd.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">-(a * b - c)</code></td>
<td width="50%"><code class="code">nmsub.ps</code></td>
</tr> <tr>
<td width="50%"><code class="code">x ? a : b</code></td>
<td width="50%">
<code class="code">movn.ps</code>/<code class="code">movz.ps</code>
</td>
</tr> </tbody> </table> <p>Note that the multiply-accumulate instructions can be disabled using the command-line option <code class="code">-mno-fused-madd</code>. </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/Paired-Single-Arithmetic.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Paired-Single-Arithmetic.html</a>
  </p>
</div>