@@ -57,6 +57,20 @@ void CharUsage() {
57
57
constexpr auto H = FourCharsVecSize{1 , 2 , 3 , 4 } != 3 ;
58
58
static_assert (H[0 ] == -1 && H[1 ] == -1 && H[2 ] == 0 && H[3 ] == -1 , " " );
59
59
60
+ constexpr auto O = FourCharsVecSize{5 , 0 , 6 , 0 } &&
61
+ FourCharsVecSize{5 , 5 , 0 , 0 };
62
+ static_assert (O[0 ] == 1 && O[1 ] == 0 && O[2 ] == 0 && O[3 ] == 0 , " " );
63
+
64
+ constexpr auto P = FourCharsVecSize{5 , 0 , 6 , 0 } ||
65
+ FourCharsVecSize{5 , 5 , 0 , 0 };
66
+ static_assert (P[0 ] == 1 && P[1 ] == 1 && P[2 ] == 1 && P[3 ] == 0 , " " );
67
+
68
+ constexpr auto Q = FourCharsVecSize{5 , 0 , 6 , 0 } && 3 ;
69
+ static_assert (Q[0 ] == 1 && Q[1 ] == 0 && Q[2 ] == 1 && Q[3 ] == 0 , " " );
70
+
71
+ constexpr auto R = FourCharsVecSize{5 , 0 , 6 , 0 } || 3 ;
72
+ static_assert (R[0 ] == 1 && R[1 ] == 1 && R[2 ] == 1 && R[3 ] == 1 , " " );
73
+
60
74
constexpr auto H1 = FourCharsVecSize{-1 , -1 , 0 , -1 };
61
75
constexpr auto InvH = -H1;
62
76
static_assert (InvH[0 ] == 1 && InvH[1 ] == 1 && InvH[2 ] == 0 && InvH[3 ] == 1 , " " );
@@ -111,6 +125,21 @@ void CharExtVecUsage() {
111
125
constexpr auto H = FourCharsExtVec{1 , 2 , 3 , 4 } != 3 ;
112
126
static_assert (H[0 ] == -1 && H[1 ] == -1 && H[2 ] == 0 && H[3 ] == -1 , " " );
113
127
128
+ constexpr auto O = FourCharsExtVec{5 , 0 , 6 , 0 } &&
129
+ FourCharsExtVec{5 , 5 , 0 , 0 };
130
+ static_assert (O[0 ] == 1 && O[1 ] == 0 && O[2 ] == 0 && O[3 ] == 0 , " " );
131
+
132
+ constexpr auto P = FourCharsExtVec{5 , 0 , 6 , 0 } ||
133
+ FourCharsExtVec{5 , 5 , 0 , 0 };
134
+ static_assert (P[0 ] == 1 && P[1 ] == 1 && P[2 ] == 1 && P[3 ] == 0 , " " );
135
+
136
+ constexpr auto Q = FourCharsExtVec{5 , 0 , 6 , 0 } && 3 ;
137
+ static_assert (Q[0 ] == 1 && Q[1 ] == 0 && Q[2 ] == 1 && Q[3 ] == 0 , " " );
138
+
139
+ constexpr auto R = FourCharsExtVec{5 , 0 , 6 , 0 } || 3 ;
140
+ static_assert (R[0 ] == 1 && R[1 ] == 1 && R[2 ] == 1 && R[3 ] == 1 , " " );
141
+
142
+
114
143
constexpr auto H1 = FourCharsExtVec{-1 , -1 , 0 , -1 };
115
144
constexpr auto InvH = -H1;
116
145
static_assert (InvH[0 ] == 1 && InvH[1 ] == 1 && InvH[2 ] == 0 && InvH[3 ] == 1 , " " );
@@ -165,10 +194,33 @@ void FloatUsage() {
165
194
constexpr auto H = FourFloatsVecSize{1 , 2 , 3 , 4 } != 3 ;
166
195
static_assert (H[0 ] == -1 && H[1 ] == -1 && H[2 ] == 0 && H[3 ] == -1 , " " );
167
196
197
+ constexpr auto O1 = FourFloatsVecSize{5 , 0 , 6 , 0 } &&
198
+ FourFloatsVecSize{5 , 5 , 0 , 0 };
199
+ static_assert (O1[0 ] == 1 && O1[1 ] == 0 && O1[2 ] == 0 && O1[3 ] == 0 , " " );
200
+
201
+ constexpr auto P1 = FourFloatsVecSize{5 , 0 , 6 , 0 } ||
202
+ FourFloatsVecSize{5 , 5 , 0 , 0 };
203
+ static_assert (P1[0 ] == 1 && P1[1 ] == 1 && P1[2 ] == 1 && P1[3 ] == 0 , " " );
204
+
205
+ constexpr auto Q = FourFloatsVecSize{5 , 0 , 6 , 0 } && 3 ;
206
+ static_assert (Q[0 ] == 1 && Q[1 ] == 0 && Q[2 ] == 1 && Q[3 ] == 0 , " " );
207
+
208
+ constexpr auto R = FourFloatsVecSize{5 , 0 , 6 , 0 } || 3 ;
209
+ static_assert (R[0 ] == 1 && R[1 ] == 1 && R[2 ] == 1 && R[3 ] == 1 , " " );
210
+
211
+
168
212
constexpr auto Y = FourFloatsVecSize{1.200000e+01 , 1.700000e+01 , -1.000000e+00 , -1.000000e+00 };
169
213
constexpr auto Z = -Y;
170
214
static_assert (Z[0 ] == -1.200000e+01 && Z[1 ] == -1.700000e+01 && Z[2 ] == 1.000000e+00 && Z[3 ] == 1.000000e+00 , " " );
171
215
216
+ constexpr auto O = FourFloatsVecSize{5 , 0 , 6 , 0 } &&
217
+ FourFloatsVecSize{5 , 5 , 0 , 0 };
218
+ static_assert (O[0 ] == 1 && O[1 ] == 0 && O[2 ] == 0 && O[3 ] == 0 , " " );
219
+
220
+ constexpr auto P = FourFloatsVecSize{5 , 0 , 6 , 0 } ||
221
+ FourFloatsVecSize{5 , 5 , 0 , 0 };
222
+ static_assert (P[0 ] == 1 && P[1 ] == 1 && P[2 ] == 1 && P[3 ] == 0 , " " );
223
+
172
224
// Operator ~ is illegal on floats.
173
225
constexpr auto ae = ~FourFloatsVecSize{0 , 1 , 8 , -1 }; // expected-error {{invalid argument type}}
174
226
@@ -219,6 +271,20 @@ void FloatVecUsage() {
219
271
constexpr auto H = FourFloatsVecSize{1 , 2 , 3 , 4 } != 3 ;
220
272
static_assert (H[0 ] == -1 && H[1 ] == -1 && H[2 ] == 0 && H[3 ] == -1 , " " );
221
273
274
+ constexpr auto O = FourFloatsVecSize{5 , 0 , 6 , 0 } &&
275
+ FourFloatsVecSize{5 , 5 , 0 , 0 };
276
+ static_assert (O[0 ] == 1 && O[1 ] == 0 && O[2 ] == 0 && O[3 ] == 0 , " " );
277
+
278
+ constexpr auto P = FourFloatsVecSize{5 , 0 , 6 , 0 } ||
279
+ FourFloatsVecSize{5 , 5 , 0 , 0 };
280
+ static_assert (P[0 ] == 1 && P[1 ] == 1 && P[2 ] == 1 && P[3 ] == 0 , " " );
281
+
282
+ constexpr auto Q = FourFloatsVecSize{5 , 0 , 6 , 0 } && 3 ;
283
+ static_assert (Q[0 ] == 1 && Q[1 ] == 0 && Q[2 ] == 1 && Q[3 ] == 0 , " " );
284
+
285
+ constexpr auto R = FourFloatsVecSize{5 , 0 , 6 , 0 } || 3 ;
286
+ static_assert (R[0 ] == 1 && R[1 ] == 1 && R[2 ] == 1 && R[3 ] == 1 , " " );
287
+
222
288
constexpr auto Y = FourFloatsVecSize{1.200000e+01 , 1.700000e+01 , -1.000000e+00 , -1.000000e+00 };
223
289
constexpr auto Z = -Y;
224
290
static_assert (Z[0 ] == -1.200000e+01 && Z[1 ] == -1.700000e+01 && Z[2 ] == 1.000000e+00 && Z[3 ] == 1.000000e+00 , " " );
@@ -234,6 +300,18 @@ void I128Usage() {
234
300
constexpr auto a = FourI128VecSize{1 , 2 , 3 , 4 };
235
301
static_assert (a[0 ] == 1 && a[1 ] == 2 && a[2 ] == 3 && a[3 ] == 4 , " " );
236
302
303
+ constexpr auto a1 = FourI128VecSize{5 , 0 , 6 , 0 } && FourI128VecSize{5 , 5 , 0 , 0 };
304
+ static_assert (a1[0 ] == 1 && a1[1 ] == 0 && a1[2 ] == 0 && a1[3 ] == 0 , " " );
305
+
306
+ constexpr auto a2 = FourI128VecSize{5 , 0 , 6 , 0 } || FourI128VecSize{5 , 5 , 0 , 0 };
307
+ static_assert (a2[0 ] == 1 && a2[1 ] == 1 && a2[2 ] == 1 && a2[3 ] == 0 , " " );
308
+
309
+ constexpr auto Q = FourI128VecSize{5 , 0 , 6 , 0 } && 3 ;
310
+ static_assert (Q[0 ] == 1 && Q[1 ] == 0 && Q[2 ] == 1 && Q[3 ] == 0 , " " );
311
+
312
+ constexpr auto R = FourI128VecSize{5 , 0 , 6 , 0 } || 3 ;
313
+ static_assert (R[0 ] == 1 && R[1 ] == 1 && R[2 ] == 1 && R[3 ] == 1 , " " );
314
+
237
315
constexpr auto b = a < 3 ;
238
316
static_assert (b[0 ] == -1 && b[1 ] == -1 && b[2 ] == 0 && b[3 ] == 0 , " " );
239
317
@@ -249,6 +327,18 @@ void I128VecUsage() {
249
327
constexpr auto a = FourI128ExtVec{1 , 2 , 3 , 4 };
250
328
static_assert (a[0 ] == 1 && a[1 ] == 2 && a[2 ] == 3 && a[3 ] == 4 , " " );
251
329
330
+ constexpr auto a1 = FourI128ExtVec{5 , 0 , 6 , 0 } && FourI128ExtVec{5 , 5 , 0 , 0 };
331
+ static_assert (a1[0 ] == 1 && a1[1 ] == 0 && a1[2 ] == 0 && a1[3 ] == 0 , " " );
332
+
333
+ constexpr auto a2 = FourI128ExtVec{5 , 0 , 6 , 0 } || FourI128ExtVec{5 , 5 , 0 , 0 };
334
+ static_assert (a2[0 ] == 1 && a2[1 ] == 1 && a2[2 ] == 1 && a2[3 ] == 0 , " " );
335
+
336
+ constexpr auto Q = FourI128ExtVec{5 , 0 , 6 , 0 } && 3 ;
337
+ static_assert (Q[0 ] == 1 && Q[1 ] == 0 && Q[2 ] == 1 && Q[3 ] == 0 , " " );
338
+
339
+ constexpr auto R = FourI128ExtVec{5 , 0 , 6 , 0 } || 3 ;
340
+ static_assert (R[0 ] == 1 && R[1 ] == 1 && R[2 ] == 1 && R[3 ] == 1 , " " );
341
+
252
342
constexpr auto b = a < 3 ;
253
343
static_assert (b[0 ] == -1 && b[1 ] == -1 && b[2 ] == 0 && b[3 ] == 0 , " " );
254
344
0 commit comments