From Jason Turner

[simd.mask.nonmembers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpixs87q0p/{from.md → to.md} +169 -0
tmp/tmpixs87q0p/{from.md → to.md} RENAMED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### `basic_mask` non-member operations <a id="simd.mask.nonmembers">[[simd.mask.nonmembers]]</a>
2
+
3
+ #### Binary operators <a id="simd.mask.binary">[[simd.mask.binary]]</a>
4
+
5
+ ``` cpp
6
+ friend constexpr basic_mask
7
+ operator&&(const basic_mask& lhs, const basic_mask& rhs) noexcept;
8
+ friend constexpr basic_mask
9
+ operator||(const basic_mask& lhs, const basic_mask& rhs) noexcept;
10
+ friend constexpr basic_mask
11
+ operator& (const basic_mask& lhs, const basic_mask& rhs) noexcept;
12
+ friend constexpr basic_mask
13
+ operator| (const basic_mask& lhs, const basic_mask& rhs) noexcept;
14
+ friend constexpr basic_mask
15
+ operator^ (const basic_mask& lhs, const basic_mask& rhs) noexcept;
16
+ ```
17
+
18
+ Let *op* be the operator.
19
+
20
+ *Returns:* A `basic_mask` object initialized with the results of
21
+ applying *op* to `lhs` and `rhs` as a binary element-wise operation.
22
+
23
+ #### Compound assignment <a id="simd.mask.cassign">[[simd.mask.cassign]]</a>
24
+
25
+ ``` cpp
26
+ friend constexpr basic_mask&
27
+ operator&=(basic_mask& lhs, const basic_mask& rhs) noexcept;
28
+ friend constexpr basic_mask&
29
+ operator|=(basic_mask& lhs, const basic_mask& rhs) noexcept;
30
+ friend constexpr basic_mask&
31
+ operator^=(basic_mask& lhs, const basic_mask& rhs) noexcept;
32
+ ```
33
+
34
+ Let *op* be the operator.
35
+
36
+ *Effects:* These operators apply *op* to `lhs` and `rhs` as a binary
37
+ element-wise operation.
38
+
39
+ *Returns:* `lhs`.
40
+
41
+ #### Comparisons <a id="simd.mask.comparison">[[simd.mask.comparison]]</a>
42
+
43
+ ``` cpp
44
+ friend constexpr basic_mask
45
+ operator==(const basic_mask& lhs, const basic_mask& rhs) noexcept;
46
+ friend constexpr basic_mask
47
+ operator!=(const basic_mask& lhs, const basic_mask& rhs) noexcept;
48
+ friend constexpr basic_mask
49
+ operator>=(const basic_mask& lhs, const basic_mask& rhs) noexcept;
50
+ friend constexpr basic_mask
51
+ operator<=(const basic_mask& lhs, const basic_mask& rhs) noexcept;
52
+ friend constexpr basic_mask
53
+ operator>(const basic_mask& lhs, const basic_mask& rhs) noexcept;
54
+ friend constexpr basic_mask
55
+ operator<(const basic_mask& lhs, const basic_mask& rhs) noexcept;
56
+ ```
57
+
58
+ Let *op* be the operator.
59
+
60
+ *Returns:* A `basic_mask` object initialized with the results of
61
+ applying *op* to `lhs` and `rhs` as a binary element-wise operation.
62
+
63
+ #### Exposition-only conditional operators <a id="simd.mask.cond">[[simd.mask.cond]]</a>
64
+
65
+ ``` cpp
66
+ friend constexpr basic_mask simd-select-impl(
67
+ const basic_mask& mask, const basic_mask& a, const basic_mask& b) noexcept;
68
+ ```
69
+
70
+ *Returns:* A `basic_mask` object where the iᵗʰ element equals
71
+ `mask[`i`] ? a[`i`] : b[`i`]` for all i in the range of \[`0`,
72
+ `size()`).
73
+
74
+ ``` cpp
75
+ friend constexpr basic_mask
76
+ simd-select-impl(const basic_mask& mask, same_as<bool> auto a, same_as<bool> auto b) noexcept;
77
+ ```
78
+
79
+ *Returns:* A `basic_mask` object where the iᵗʰ element equals
80
+ `mask[`i`] ? a : b` for all i in the range of \[`0`, `size()`).
81
+
82
+ ``` cpp
83
+ template<class T0, class T1>
84
+ friend constexpr vec<see below, size()>
85
+ simd-select-impl(const basic_mask& mask, const T0& a, const T1& b) noexcept;
86
+ ```
87
+
88
+ *Constraints:*
89
+
90
+ - `same_as<T0, T1>` is `true`,
91
+ - `T0` is a vectorizable type, and
92
+ - `sizeof(T0) == Bytes`.
93
+
94
+ *Returns:* A `vec<T0, size()>` object where the iᵗʰ element equals
95
+ `mask[`i`] ? a : b` for all i in the range of \[`0`, `size()`).
96
+
97
+ #### Reductions <a id="simd.mask.reductions">[[simd.mask.reductions]]</a>
98
+
99
+ ``` cpp
100
+ template<size_t Bytes, class Abi>
101
+ constexpr bool all_of(const basic_mask<Bytes, Abi>& k) noexcept;
102
+ ```
103
+
104
+ *Returns:* `true` if all boolean elements in `k` are `true`, otherwise
105
+ `false`.
106
+
107
+ ``` cpp
108
+ template<size_t Bytes, class Abi>
109
+ constexpr bool any_of(const basic_mask<Bytes, Abi>& k) noexcept;
110
+ ```
111
+
112
+ *Returns:* `true` if at least one boolean element in `k` is `true`,
113
+ otherwise `false`.
114
+
115
+ ``` cpp
116
+ template<size_t Bytes, class Abi>
117
+ constexpr bool none_of(const basic_mask<Bytes, Abi>& k) noexcept;
118
+ ```
119
+
120
+ *Returns:* `!any_of(k)`.
121
+
122
+ ``` cpp
123
+ template<size_t Bytes, class Abi>
124
+ constexpr simd-size-type reduce_count(const basic_mask<Bytes, Abi>& k) noexcept;
125
+ ```
126
+
127
+ *Returns:* The number of boolean elements in `k` that are `true`.
128
+
129
+ ``` cpp
130
+ template<size_t Bytes, class Abi>
131
+ constexpr simd-size-type reduce_min_index(const basic_mask<Bytes, Abi>& k);
132
+ ```
133
+
134
+ *Preconditions:* `any_of(k)` is `true`.
135
+
136
+ *Returns:* The lowest element index i where `k[`i`]` is `true`.
137
+
138
+ ``` cpp
139
+ template<size_t Bytes, class Abi>
140
+ constexpr simd-size-type reduce_max_index(const basic_mask<Bytes, Abi>& k);
141
+ ```
142
+
143
+ *Preconditions:* `any_of(k)` is `true`.
144
+
145
+ *Returns:* The greatest element index i where `k[`i`]` is `true`.
146
+
147
+ ``` cpp
148
+ constexpr bool all_of(same_as<bool> auto x) noexcept;
149
+ constexpr bool any_of(same_as<bool> auto x) noexcept;
150
+ constexpr simd-size-type reduce_count(same_as<bool> auto x) noexcept;
151
+ ```
152
+
153
+ *Returns:* `x`.
154
+
155
+ ``` cpp
156
+ constexpr bool none_of(same_as<bool> auto x) noexcept;
157
+ ```
158
+
159
+ *Returns:* `!x`.
160
+
161
+ ``` cpp
162
+ constexpr simd-size-type reduce_min_index(same_as<bool> auto x);
163
+ constexpr simd-size-type reduce_max_index(same_as<bool> auto x);
164
+ ```
165
+
166
+ *Preconditions:* `x` is `true`.
167
+
168
+ *Returns:* `0`.
169
+