@@ -45,25 +45,20 @@ template <typename Ty, int N> class simd {
45
45
// / The number of elements in this simd object.
46
46
static constexpr int length = N;
47
47
48
- // TODO @rolandschulz
49
- // Provide examples why constexpr is needed here.
50
- //
51
48
// / @{
52
49
// / Constructors.
53
- constexpr simd () = default;
54
- template <typename SrcTy> constexpr simd (const simd<SrcTy, N> &other) {
55
- if constexpr (std::is_same<SrcTy, Ty>::value)
56
- set (other.data ());
57
- else
58
- set (__builtin_convertvector (other.data (), detail::vector_type_t <Ty, N>));
50
+ simd () = default ;
51
+ simd (const simd &other) { set (other.data ()); }
52
+ template <typename SrcTy> simd (const simd<SrcTy, N> &other) {
53
+ set (__builtin_convertvector (other.data (), detail::vector_type_t <Ty, N>));
59
54
}
60
- template <typename SrcTy> constexpr simd (simd<SrcTy, N> &&other) {
55
+ template <typename SrcTy> simd (simd<SrcTy, N> &&other) {
61
56
if constexpr (std::is_same<SrcTy, Ty>::value)
62
57
set (other.data ());
63
58
else
64
59
set (__builtin_convertvector (other.data (), detail::vector_type_t <Ty, N>));
65
60
}
66
- constexpr simd (const vector_type &Val) { set (Val); }
61
+ simd (const vector_type &Val) { set (Val); }
67
62
68
63
// TODO @rolandschulz
69
64
// {quote}
@@ -84,15 +79,15 @@ template <typename Ty, int N> class simd {
84
79
// thought through seems to have only downsides.
85
80
// {/quote}
86
81
87
- constexpr simd (std::initializer_list<Ty> Ilist) noexcept {
82
+ simd (std::initializer_list<Ty> Ilist) noexcept {
88
83
int i = 0 ;
89
84
for (auto It = Ilist.begin (); It != Ilist.end () && i < N; ++It) {
90
85
M_data[i++] = *It;
91
86
}
92
87
}
93
88
94
89
// / Initialize a simd with an initial value and step.
95
- constexpr simd (Ty Val, Ty Step = Ty()) noexcept {
90
+ simd (Ty Val, Ty Step = Ty()) noexcept {
96
91
if (Step == Ty ())
97
92
M_data = Val;
98
93
else {
0 commit comments