From Jason Turner

[simd.creation]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp68lhv7sl/{from.md → to.md} +80 -0
tmp/tmp68lhv7sl/{from.md → to.md} RENAMED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Creation <a id="simd.creation">[[simd.creation]]</a>
2
+
3
+ ``` cpp
4
+ template<class T, class Abi>
5
+ constexpr auto chunk(const basic_vec<typename T::value_type, Abi>& x) noexcept;
6
+ template<class T, class Abi>
7
+ constexpr auto chunk(const basic_mask<mask-element-size<T>, Abi>& x) noexcept;
8
+ ```
9
+
10
+ *Constraints:*
11
+
12
+ - For the first overload, `T` is an enabled specialization of
13
+ `basic_vec`. If
14
+ `basic_vec<typename T::value_type, Abi>::size() % T::size()` is not
15
+ `0`, then
16
+ `resize_t<basic_vec<typename T::value_type, Abi>::size() % T::size(), T>`
17
+ is valid and denotes a type.
18
+ - For the second overload, `T` is an enabled specialization of
19
+ `basic_mask`. If
20
+ `basic_mask<`*`mask-element-size`*`<T>, Abi>::size() % T::size()` is
21
+ not `0`, then
22
+ `resize_t<basic_mask<`*`mask-element-size`*`<T>, Abi>::size() % T::size(), T>`
23
+ is valid and denotes a type.
24
+
25
+ Let N be `x.size() / T::size()`.
26
+
27
+ *Returns:*
28
+
29
+ - If `x.size() % T::size() == 0` is `true`, an `array<T, `N`>` with the
30
+ iᵗʰ `basic_vec` or `basic_mask` element of the jᵗʰ `array` element
31
+ initialized to the value of the element in `x` with index
32
+ i` + `j` * T::size()`.
33
+ - Otherwise, a `tuple` of N objects of type `T` and one object of type
34
+ `resize_t<x.size() % T::size(), T>`. The iᵗʰ `basic_vec` or
35
+ `basic_mask` element of the jᵗʰ `tuple` element of type `T` is
36
+ initialized to the value of the element in `x` with index
37
+ i` + `j` * T::size()`. The iᵗʰ `basic_vec` or `basic_mask` element of
38
+ the Nᵗʰ `tuple` element is initialized to the value of the element in
39
+ `x` with index i` + `N` * T::size()`.
40
+
41
+ ``` cpp
42
+ template<simd-size-type N, class T, class Abi>
43
+ constexpr auto chunk(const basic_vec<T, Abi>& x) noexcept;
44
+ ```
45
+
46
+ *Effects:* Equivalent to:
47
+ `return chunk<resize_t<N, basic_vec<T, Abi>>>(x);`
48
+
49
+ ``` cpp
50
+ template<simd-size-type N, size_t Bytes, class Abi>
51
+ constexpr auto chunk(const basic_mask<Bytes, Abi>& x) noexcept;
52
+ ```
53
+
54
+ *Effects:* Equivalent to:
55
+ `return chunk<resize_t<N, basic_mask<Bytes, Abi>>>(x);`
56
+
57
+ ``` cpp
58
+ template<class T, class... Abis>
59
+ constexpr vec<T, (basic_vec<T, Abis>::size() + ...)>
60
+ cat(const basic_vec<T, Abis>&... xs) noexcept;
61
+ template<size_t Bytes, class... Abis>
62
+ constexpr basic_mask<Bytes, deduce-abi-t<integer-from<Bytes>,
63
+ (basic_mask<Bytes, Abis>::size() + ...)>>
64
+ cat(const basic_mask<Bytes, Abis>&... xs) noexcept;
65
+ ```
66
+
67
+ *Constraints:*
68
+
69
+ - For the first overload `vec<T, (basic_vec<T, Abis>::size() + ...)>` is
70
+ enabled.
71
+ - For the second overload
72
+ `basic_mask<Bytes, `*`deduce-abi-t`*`<`*`integer-from`*`<Bytes>, (basic_mask<Bytes, Abis>::size() + ...)>>`
73
+ is enabled.
74
+
75
+ *Returns:* A data-parallel object initialized with the concatenated
76
+ values in the `xs` pack of data-parallel objects: The iᵗʰ
77
+ `basic_vec`/`basic_mask` element of the jᵗʰ parameter in the `xs` pack
78
+ is copied to the return value’s element with index i + the sum of the
79
+ width of the first j parameters in the `xs` pack.
80
+