Skip to content

Commit a3b8d12

Browse files
committed
Introduce [parallel.simd.math]
1 parent abc146b commit a3b8d12

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

data_parallel_types.html

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,72 @@ <h1><ins><code>simd</code> algorithms</ins></h1>
23302330
</cxx-function>
23312331
</cxx-section>
23322332
</cxx-section>
2333+
2334+
<cxx-section id="parallel.simd.math">
2335+
<h1><ins><code>simd</code> math library</ins></h1>
2336+
2337+
<p>
2338+
<ins>
2339+
For each set of overloaded functions within <code>&lt;cmath&gt;</code>, there shall be additional overloads sufficient to ensure that if any argument corresponding to a <code>double</code> parameter has type <code>simd&lt;T, Abi&gt;</code>, where <code>is_floating_point_v&lt;T&gt;</code> is <code>true</code>, then:
2340+
2341+
<bl>
2342+
<li>
2343+
<ins>
2344+
All arguments corresponding to <code>double</code> parameters shall be convertible to <code>simd&lt;T, Abi&gt;</code>.
2345+
</ins>
2346+
</li>
2347+
2348+
<li>
2349+
<ins>
2350+
All arguments corresponding to <code>double*</code> parameters shall be of type <code>simd&lt;T, Abi&gt;*</code>.
2351+
</ins>
2352+
</li>
2353+
2354+
<li>
2355+
<ins>
2356+
All arguments corresponding to parameters of integral type <code>U</code> shall be convertible to <code>fixed_size_simd&lt;U, simd_size_v&lt;T, Abi&gt;&gt;</code>.
2357+
</ins>
2358+
</li>
2359+
2360+
<li>
2361+
<ins>
2362+
All arguments corresponding to <code>U*</code>, where <code>U</code> is integral, shall be of type <code>fixed_size_simd&lt;U, simd_size_v&lt;T, Abi&gt;&gt;*</code>.
2363+
</ins>
2364+
</li>
2365+
2366+
<li>
2367+
<ins>
2368+
If the corresponding return type is <code>double</code>, the return type of the additional overloads is <code>simd&lt;T, Abi&gt;</code>. Otherwise, if the corresponding return type is <code>bool</code>, the return type of the additional overload is <code>simd_mask&lt;T, Abi&gt;</code>. Otherwise, the return type is <code>fixed_size_simd&lt;R, simd_size_v&lt;T, Abi&gt;&gt;</code>, with <code>R</code> denoting the corresponding return type.
2369+
</ins>
2370+
</li>
2371+
</bl>
2372+
2373+
<br>
2374+
2375+
<ins>
2376+
It is unspecified whether a call to these overloads with arguments that are all convertible to <code>simd&lt;T, Abi&gt;</code> but are not of type <code>simd&lt;T, Abi&gt;</code> is well-formed.
2377+
</ins>
2378+
</ins>
2379+
</p>
2380+
2381+
<p>
2382+
<ins>
2383+
Each function overload produced by the above rules applies the indicated <code>&lt;cmath&gt;</code> function element-wise. The results per element are not required to be bitwise equal to the application of the function which is overloaded for the element type.
2384+
</ins>
2385+
</p>
2386+
2387+
<p>
2388+
<ins>
2389+
The behavior is undefined if a domain, pole, or range error occurs when the input argument(s) are applied to the indicated <code>&lt;cmath&gt;</code> function.
2390+
</ins>
2391+
</p>
2392+
2393+
<p>
2394+
<ins>
2395+
If <code>abs</code> is called with an argument of type <code>simd&lt;X, Abi&gt;</code> for which <code>is_unsigned_v&lt;X&gt;</code> is <code>true</code>, the program is ill-formed.
2396+
</ins>
2397+
</p>
2398+
</cxx-section>
23332399
</cxx-section>
23342400
</cxx-clause>
23352401

0 commit comments

Comments
 (0)