From Jason Turner

[simd.ctor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpso6pmwvi/{from.md → to.md} +132 -0
tmp/tmpso6pmwvi/{from.md → to.md} RENAMED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Constructors <a id="simd.ctor">[[simd.ctor]]</a>
2
+
3
+ ``` cpp
4
+ template<class U> constexpr explicit(see below) basic_vec(U&& value) noexcept;
5
+ ```
6
+
7
+ Let `From` denote the type `remove_cvref_t<U>`.
8
+
9
+ *Constraints:* `value_type` satisfies `constructible_from<U>`.
10
+
11
+ *Effects:* Initializes each element to the value of the argument after
12
+ conversion to `value_type`.
13
+
14
+ *Remarks:* The expression inside `explicit` evaluates to `false` if and
15
+ only if `U` satisfies `convertible_to<value_type>`, and either
16
+
17
+ - `From` is not an arithmetic type and does not satisfy
18
+ `constexpr-wrapper-like`,
19
+ - `From` is an arithmetic type and the conversion from `From` to
20
+ `value_type` is value-preserving [[simd.general]], or
21
+ - `From` satisfies `constexpr-wrapper-like`,
22
+ `remove_const_t<decltype(From::value)>` is an arithmetic type, and
23
+ `From::value` is representable by `value_type`.
24
+
25
+ ``` cpp
26
+ template<class U, class UAbi>
27
+ constexpr explicit(see below) basic_vec(const basic_vec<U, UAbi>& x) noexcept;
28
+ ```
29
+
30
+ *Constraints:* *`simd-size-v`*`<U, UAbi> == size()` is `true`.
31
+
32
+ *Effects:* Initializes the iᵗʰ element with `static_cast<T>(x[`i`])` for
33
+ all i in the range of \[`0`, `size()`).
34
+
35
+ *Remarks:* The expression inside `explicit` evaluates to `true` if
36
+ either
37
+
38
+ - the conversion from `U` to `value_type` is not value-preserving, or
39
+ - both `U` and `value_type` are integral types and the integer
40
+ conversion rank [[conv.rank]] of `U` is greater than the integer
41
+ conversion rank of `value_type`, or
42
+ - both `U` and `value_type` are floating-point types and the
43
+ floating-point conversion rank [[conv.rank]] of `U` is greater than
44
+ the floating-point conversion rank of `value_type`.
45
+
46
+ ``` cpp
47
+ template<class G> constexpr explicit basic_vec(G&& gen);
48
+ ```
49
+
50
+ Let `From`ᵢ denote the type
51
+ `decltype(gen(integral_constant<`*`simd-size-type`*`, `i`>()))`.
52
+
53
+ *Constraints:* `From`ᵢ satisfies `convertible_to<value_type>` for all i
54
+ in the range of \[`0`, `size()`). In addition, for all i in the range of
55
+ \[`0`, `size()`), if `From`ᵢ is an arithmetic type, conversion from
56
+ `From`ᵢ to `value_type` is value-preserving.
57
+
58
+ *Effects:* Initializes the iᵗʰ element with
59
+ `static_cast<value_type>(gen(integral_constant<`*`simd-size-type`*`, i>()))`
60
+ for all i in the range of \[`0`, `size()`).
61
+
62
+ *Remarks:* `gen` is invoked exactly once for each i, in increasing order
63
+ of i.
64
+
65
+ ``` cpp
66
+ template<class R, class... Flags>
67
+ constexpr basic_vec(R&& r, flags<Flags...> = {});
68
+ template<class R, class... Flags>
69
+ constexpr basic_vec(R&& r, const mask_type& mask, flags<Flags...> = {});
70
+ ```
71
+
72
+ Let `mask` be `mask_type(true)` for the overload with no `mask`
73
+ parameter.
74
+
75
+ *Constraints:*
76
+
77
+ - `R` models `ranges::contiguous_range` and `ranges::sized_range`,
78
+ - `ranges::size(r)` is a constant expression, and
79
+ - `ranges::size(r)` is equal to `size()`.
80
+
81
+ *Mandates:*
82
+
83
+ - `ranges::range_value_t<R>` is a vectorizable type, and
84
+ - if the template parameter pack `Flags` does not contain
85
+ *`convert-flag`*, then the conversion from `ranges::range_value_t<R>`
86
+ to `value_type` is value-preserving.
87
+
88
+ *Preconditions:*
89
+
90
+ - If the template parameter pack `Flags` contains *`aligned-flag`*,
91
+ `ranges::data(r)` points to storage aligned by
92
+ `alignment_v<basic_vec, ranges::range_value_t<R>>`.
93
+ - If the template parameter pack `Flags` contains
94
+ *`overaligned-flag`*`<N>`, `ranges::data(r)` points to storage aligned
95
+ by `N`.
96
+
97
+ *Effects:* Initializes the iᵗʰ element with
98
+ `mask[`i`] ? static_cast<T>(ranges::data(r)[`i`]) : T()` for all i in
99
+ the range of \[`0`, `size()`).
100
+
101
+ ``` cpp
102
+ template<class R, class... Ts>
103
+ basic_vec(R&& r, Ts...) -> see below;
104
+ ```
105
+
106
+ *Constraints:*
107
+
108
+ - `R` models `ranges::contiguous_range` and `ranges::sized_range`, and
109
+ - `ranges::size(r)` is a constant expression.
110
+
111
+ *Remarks:* The deduced type is equivalent to
112
+ `vec<ranges::range_value_t<R>, ranges::size(r)>`.
113
+
114
+ ``` cpp
115
+ template<simd-floating-point V>
116
+ constexpr explicit(see below)
117
+ basic_vec(const V& reals, const V& imags = {}) noexcept;
118
+ ```
119
+
120
+ *Constraints:*
121
+
122
+ - `simd-complex<basic_vec>` is modeled, and
123
+ - `V::size() == size()` is `true`.
124
+
125
+ *Effects:* Initializes the iᵗʰ element with
126
+ `value_type(reals[`i`], imags[`i`])` for all i in the range \[`0`,
127
+ `size()`).
128
+
129
+ *Remarks:* The expression inside `explicit` evaluates to `false` if and
130
+ only if the floating-point conversion rank of `T::value_type` is greater
131
+ than or equal to the floating-point conversion rank of `V::value_type`.
132
+