Files
dl_old/third/xsimd/docs/source/api/arithmetic_index.rst
T
2026-02-05 20:57:57 +08:00

99 lines
4.9 KiB
ReStructuredText
Vendored

.. Copyright (c) 2016, Johan Mabille, Sylvain Corlay
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
.. raw:: html
<style>
.rst-content table.docutils {
width: 100%;
table-layout: fixed;
}
table.docutils .line-block {
margin-left: 0;
margin-bottom: 0;
}
table.docutils code.literal {
color: initial;
}
code.docutils {
background: initial;
}
</style>
.. _Arithmetic Operations:
Arithmetic Operations
=====================
Binary operations:
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`add` | per slot addition |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`sub` | per slot subtraction |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`mul` | per slot multiply |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`div` | per slot division |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`mod` | per slot modulo |
+---------------------------------------+----------------------------------------------------+
Unary operations:
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`neg` | per slot negate |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`pos` | per slot positive |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`reciprocal` | per slot reciprocal |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`decr` | per slot decrement |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`decr_if` | per slot decrement, based on a mask |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`incr` | per slot increment |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`incr_if` | per slot increment, based on a mask |
+---------------------------------------+----------------------------------------------------+
Saturated arithmetic:
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`sadd` | per slot saturated addition |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`ssub` | per slot saturated subtraction |
+---------------------------------------+----------------------------------------------------+
Fused operations:
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`fma` | fused multiply add |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`fms` | fused multiply sub |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`fnma` | fused negate multiply add |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`fnms` | fused negate multiply sub |
+---------------------------------------+----------------------------------------------------+
Average computation:
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`avg` | per slot average |
+---------------------------------------+----------------------------------------------------+
| :cpp:func:`avgr` | per slot rounded average |
+---------------------------------------+----------------------------------------------------+
----
.. doxygengroup:: batch_arithmetic
:project: xsimd
:content-only: