Skip to content

Commit d6ceb11

Browse files
committed
Introduce [parallel.simd.ctor]
1 parent 9801a46 commit d6ceb11

File tree

1 file changed

+141
-0
lines changed

1 file changed

+141
-0
lines changed

data_parallel_types.html

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,147 @@ <h1><ins>Element references</ins></h1>
12071207
</cxx-effects>
12081208
</cxx-function>
12091209
</cxx-section>
1210+
1211+
<cxx-section id="parallel.simd.ctor">
1212+
<h1><ins><code>simd</code> constructors</ins></h1>
1213+
1214+
<cxx-function>
1215+
<cxx-signature><ins>template&lt;class U&gt; simd(U&&);</ins></cxx-signature>
1216+
1217+
<cxx-effects>
1218+
<ins>
1219+
Constructs an object with each element initialized to the value of the argument after conversion to <code>value_type</code>.
1220+
</ins>
1221+
</cxx-effects>
1222+
1223+
<cxx-throws>
1224+
<ins>
1225+
Any exception thrown while converting the argument to <code>value_type</code>.
1226+
</ins>
1227+
</cxx-throws>
1228+
1229+
<cxx-remarks>
1230+
<ins>
1231+
Let <code>From</code> identify the type <code>remove_cv_t&lt;remove_reference_t&lt;U&gt;&gt;</code>. This constructor shall not participate in overload resolution unless:
1232+
1233+
<br>
1234+
<br>
1235+
1236+
<bl>
1237+
<li>
1238+
<code>From</code> is a vectorizable type and every possibly value of <code>From</code> can be represented with type <code>value_type</code>, or
1239+
</li>
1240+
1241+
<li>
1242+
<code>From</code> is not an arithmetic type and is implicitly convertible to <code>value_type</code>, or
1243+
</li>
1244+
1245+
<li>
1246+
<code>From</code> is <code>int</code>, or
1247+
1248+
<li>
1249+
<code>From</code> is <code>unsigned int</code> and <code>value_type</code> is an unsigned integral type.
1250+
</li>
1251+
</li>
1252+
</bl>
1253+
</ins>
1254+
</cxx-remarks>
1255+
</cxx-function>
1256+
1257+
<cxx-function>
1258+
<cxx-signature><ins>template&lt;class U&gt; simd(const simd&lt;U, simd_abi::fixed_size&lt;size()&gt;&gt;& x);</ins></cxx-signature>
1259+
1260+
<cxx-effects>
1261+
<ins>
1262+
Constructs an object where the <em>i</em>-th element equals <code>static_cast&lt;T&gt;(x[i])</code> for all <code>i</code> &#8714; <code>[0, size())</code>.
1263+
</ins>
1264+
</cxx-effects>
1265+
1266+
<cxx-remarks>
1267+
<ins>
1268+
This constructor shall not participate in overload resolution unless
1269+
</ins>
1270+
1271+
<bl>
1272+
<li>
1273+
<ins>
1274+
<code>abi_type</code> is <code>simd_abi::fixed_size&lt;size()&gt;</code>, and
1275+
</ins>
1276+
</li>
1277+
1278+
<li>
1279+
<ins>
1280+
every possible value of <code>U</code> can be represented with type <code>value_type</code>, and
1281+
</ins>
1282+
</li>
1283+
1284+
<li>
1285+
<ins>
1286+
if both <code>U</code> and <code>value_type</code> are integral, the integer conversion rank [conv.rank] of <code>value_type</code> is greater than the integer conversion rank of <code>U</code>.
1287+
</ins>
1288+
</li>
1289+
</bl>
1290+
</cxx-remarks>
1291+
</cxx-function>
1292+
1293+
<cxx-function>
1294+
<cxx-signature><ins>template&lt;class G&gt; simd(G&& gen);</ins></cxx-signature>
1295+
1296+
<cxx-effects>
1297+
<ins>
1298+
Constructs an object where the <em>i</em>-th element is initialized to <code>gen(integral_constant&lt;size_t, i&gt;())</code>.
1299+
</ins>
1300+
</cxx-effects>
1301+
1302+
<cxx-remarks>
1303+
<ins>
1304+
This constructor shall not participate in overload resolution unless <code>simd(gen(integral_constant&lt;size_t, i&gt;()))</code> is well-formed for all <code>i</code> &#8714; <code>[0, size())</code>.
1305+
</ins>
1306+
</cxx-remarks>
1307+
1308+
<p>
1309+
<ins>
1310+
The calls to <code>gen</code> are unsequenced with respect to each other. Vectorization-unsafe standard library functions may not be invoked by <code>gen</code> ([algorithms.parallel.exec]).
1311+
</ins>
1312+
</p>
1313+
</cxx-function>
1314+
1315+
<cxx-function>
1316+
<cxx-signature><ins>template&lt;class U, class Flags&gt; simd(const U* mem, Flags);</ins></cxx-signature>
1317+
1318+
<cxx-requires>
1319+
<ins>
1320+
If the template parameter <code>Flags</code> is <code>vector_aligned_tag</code>, <code>mem</code> shall point to storage aligend by <code>memory_alignment_v&lt;simd, U&gt;</code>. If the template parameter <code>Flags</code> is <code>overaligned_tag&lt;N&gt;</code>, <code>mem</code> shall point to storage aligned by <code>N</code>. If the template parameter <code>Flags</code> is <code>element_aligned_tag</code>, <code>mem</code> shall point to storage aligned by <code>alignon(U)</code>. <code>[mem, mem + size())</code> is a valid range.
1321+
</ins>
1322+
</cxx-requires>
1323+
1324+
<cxx-effects>
1325+
<ins>
1326+
Constructs an object where the <em>i</em>-th element is initialized to <code>static_cast&lt;T&gt;(mem[i])</code> for all <code>i</code> &#8714; <code>[0, size())</code>.
1327+
</ins>
1328+
</cxx-effects>
1329+
1330+
<cxx-remarks>
1331+
<ins>
1332+
This constructor shall not participate in overload resolution unless
1333+
1334+
<bl>
1335+
<li>
1336+
<ins>
1337+
<code>is_simd_flag_type_v&lt;Flags&gt;</code> is <code>true</code>, and
1338+
</ins>
1339+
</li>
1340+
1341+
<li>
1342+
<ins>
1343+
<code>U</code> is a vectorizable type.
1344+
</ins>
1345+
</li>
1346+
</bl>
1347+
</ins>
1348+
</cxx-remarks>
1349+
</cxx-function>
1350+
</cxx-section>
12101351
</cxx-section>
12111352
</cxx-clause>
12121353

0 commit comments

Comments
 (0)