From Jason Turner

[simd.alg]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpar5cr4o_/{from.md → to.md} +72 -0
tmp/tmpar5cr4o_/{from.md → to.md} RENAMED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Algorithms <a id="simd.alg">[[simd.alg]]</a>
2
+
3
+ ``` cpp
4
+ template<class T, class Abi>
5
+ constexpr basic_vec<T, Abi> min(const basic_vec<T, Abi>& a,
6
+ const basic_vec<T, Abi>& b) noexcept;
7
+ ```
8
+
9
+ *Constraints:* `T` models `totally_ordered`.
10
+
11
+ *Returns:* The result of the element-wise application of
12
+ `min(a[`i`], b[`i`])` for all i in the range of \[`0`,
13
+ `basic_vec<T, Abi>::size()`).
14
+
15
+ ``` cpp
16
+ template<class T, class Abi>
17
+ constexpr basic_vec<T, Abi> max(const basic_vec<T, Abi>& a,
18
+ const basic_vec<T, Abi>& b) noexcept;
19
+ ```
20
+
21
+ *Constraints:* `T` models `totally_ordered`.
22
+
23
+ *Returns:* The result of the element-wise application of
24
+ `max(a[`i`], b[`i`])` for all i in the range of \[`0`,
25
+ `basic_vec<T, Abi>::size()`).
26
+
27
+ ``` cpp
28
+ template<class T, class Abi>
29
+ constexpr pair<basic_vec<T, Abi>, basic_vec<T, Abi>>
30
+ minmax(const basic_vec<T, Abi>& a, const basic_vec<T, Abi>& b) noexcept;
31
+ ```
32
+
33
+ *Effects:* Equivalent to: `return pair{min(a, b), max(a, b)};`
34
+
35
+ ``` cpp
36
+ template<class T, class Abi>
37
+ constexpr basic_vec<T, Abi> clamp(
38
+ const basic_vec<T, Abi>& v, const basic_vec<T, Abi>& lo, const basic_vec<T, Abi>& hi);
39
+ ```
40
+
41
+ *Constraints:* `T` models `totally_ordered`.
42
+
43
+ *Preconditions:* No element in `lo` is greater than the corresponding
44
+ element in `hi`.
45
+
46
+ *Returns:* The result of element-wise application of
47
+ `clamp(v[`i`], lo[`i`], hi[`i`])` for all i in the range of \[`0`,
48
+ `basic_vec<T, Abi>::size()`).
49
+
50
+ ``` cpp
51
+ template<class T, class U>
52
+ constexpr auto select(bool c, const T& a, const U& b)
53
+ -> remove_cvref_t<decltype(c ? a : b)>;
54
+ ```
55
+
56
+ *Effects:* Equivalent to: `return c ? a : b;`
57
+
58
+ ``` cpp
59
+ template<size_t Bytes, class Abi, class T, class U>
60
+ constexpr auto select(const basic_mask<Bytes, Abi>& c, const T& a, const U& b)
61
+ noexcept -> decltype(simd-select-impl(c, a, b));
62
+ ```
63
+
64
+ *Effects:* Equivalent to:
65
+
66
+ ``` cpp
67
+ return simd-select-impl(c, a, b);
68
+ ```
69
+
70
+ where *`simd-select-impl`* is found by argument-dependent
71
+ lookup [[basic.lookup.argdep]] contrary to [[contents]].
72
+