1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
// DIRECTIONS:
// This file isn't very robust and makes several assumptions
// You can execute it by calling "csi .\GenerateTests.csx"
//
// csi can be found under the <repo-root>\tools\net46\roslyn directory
// It must be run such from the directory that contains the csx script
//
// New tests can be generated from the template by adding an entry to the
// appropriate <Isa>Inputs array below.
//
// You can support a new Isa by creating a new array and adding a new
// "ProcessInputs" call at the bottom of the script.
private static readonly (string templateFileName, string[] templateData)[] SseInputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3TBaseype, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Add", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "AddScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "And", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "(BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "AndNot", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(~BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "(~BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareEqual", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] == right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] == right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareEqualScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] == right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareEqualOrderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] == right[0]) != result"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareEqualUnorderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] == right[0]) != result"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThan", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] > right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] > right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThanScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] > right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThanOrderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] > right[0]) != result"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThanUnorderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] > right[0]) != result"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThanOrEqual", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] >= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] >= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThanOrEqualScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] >= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThanOrEqualOrderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] >= right[0]) != result"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareGreaterThanOrEqualUnorderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] >= right[0]) != result"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareLessThan", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] < right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] < right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareLessThanScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] < right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareLessThanOrderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] < right[0]) != result"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareLessThanUnorderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] < right[0]) != result"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareLessThanOrEqual", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] <= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] <= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareLessThanOrEqualScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] <= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareLessThanOrEqualOrderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] <= right[0]) != result"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareLessThanOrEqualUnorderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] <= right[0]) != result"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotEqual", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] != right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] != right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotEqualScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] != right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareNotEqualOrderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] != right[0]) != result"}),
("BooleanCmpOpTest.template", new string[] { "Sse", "Sse", "CompareNotEqualUnorderedScalar", "Vector128", "Boolean", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(left[0] != right[0]) != result"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotGreaterThan", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] > right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != (!(left[i] > right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotGreaterThanScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] > right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotGreaterThanOrEqual", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] >= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != (!(left[i] >= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotGreaterThanOrEqualScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] >= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotLessThan", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] < right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != (!(left[i] < right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotLessThanScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] < right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotLessThanOrEqual", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] <= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != (!(left[i] <= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareNotLessThanOrEqualScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != (!(left[0] <= right[0]) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareOrdered", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((!float.IsNaN(left[0]) && !float.IsNaN(right[0])) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((!float.IsNaN(left[i]) && !float.IsNaN(right[i])) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareOrderedScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((!float.IsNaN(left[0]) && !float.IsNaN(right[0])) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareUnordered", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((float.IsNaN(left[0]) || float.IsNaN(right[0])) ? -1 : 0)", "BitConverter.SingleToInt32Bits(result[i]) != ((float.IsNaN(left[i]) || float.IsNaN(right[i])) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "CompareUnorderedScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != ((float.IsNaN(left[0]) || float.IsNaN(right[0])) ? -1 : 0)", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Divide", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] / right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] / right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "DivideScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] / right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Max", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(Math.Max(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(Math.Max(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "MaxScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(Math.Max(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Min", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(Math.Min(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(Math.Min(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "MinScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(Math.Min(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Multiply", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] * right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] * right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "MultiplyScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] * right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Or", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(left[0]) | BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "(BitConverter.SingleToInt32Bits(left[0]) | BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Subtract", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] - right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] - right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "SubtractScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] - right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse", "Sse", "Xor", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "(BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])"}),
};
private static readonly (string templateFileName, string[] templateData)[] Sse2Inputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3BaseType, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] + right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] + right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] + right[0]) != result[0]", "(byte)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] + right[0]) != result[0]", "(short)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] + right[0]) != result[0]", "(int)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] + right[0]) != result[0]", "(long)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] + right[0]) != result[0]", "(sbyte)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] + right[0]) != result[0]", "(ushort)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] + right[0]) != result[0]", "(uint)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Add", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] + right[0]) != result[0]", "(ulong)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(BitConverter.DoubleToInt64Bits(left[0]) & BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "(BitConverter.DoubleToInt64Bits(left[i]) & BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] & right[0]) != result[0]", "(byte)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] & right[0]) != result[0]", "(short)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] & right[0]) != result[0]", "(int)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] & right[0]) != result[0]", "(long)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] & right[0]) != result[0]", "(sbyte)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] & right[0]) != result[0]", "(ushort)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] & right[0]) != result[0]", "(uint)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "And", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] & right[0]) != result[0]", "(ulong)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(~BitConverter.DoubleToInt64Bits(left[0]) & BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "(~BitConverter.DoubleToInt64Bits(left[i]) & BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(~left[0] & right[0]) != result[0]", "(byte)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(~left[0] & right[0]) != result[0]", "(short)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(~left[0] & right[0]) != result[0]", "(int)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(~left[0] & right[0]) != result[0]", "(long)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(~left[0] & right[0]) != result[0]", "(sbyte)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(~left[0] & right[0]) != result[0]", "(ushort)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(~left[0] & right[0]) != result[0]", "(uint)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "AndNot", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(~left[0] & right[0]) != result[0]", "(ulong)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareEqual", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] == right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] == right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareEqual", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((byte)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((byte)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareEqual", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((short)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((short)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareEqual", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((int)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((int)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareEqual", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((sbyte)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((sbyte)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareEqual", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((ushort)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((ushort)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareEqual", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((uint)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((uint)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareGreaterThan", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] > right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] > right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareGreaterThan", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((short)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((short)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareGreaterThan", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((int)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((int)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareGreaterThan", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((sbyte)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((sbyte)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareGreaterThanOrEqual", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] >= right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] >= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareLessThan", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] < right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] < right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareLessThan", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[0] != ((left[0] < right[0]) ? unchecked((short)(-1)) : 0)", "result[i] != ((left[i] < right[i]) ? unchecked((short)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareLessThan", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] < right[0]) ? unchecked((int)(-1)) : 0)", "result[i] != ((left[i] < right[i]) ? unchecked((int)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareLessThan", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != ((left[0] < right[0]) ? unchecked((sbyte)(-1)) : 0)", "result[i] != ((left[i] < right[i]) ? unchecked((sbyte)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareLessThanOrEqual", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] <= right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] <= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareNotEqual", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] != right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] != right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareNotGreaterThan", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != (!(left[0] > right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != (!(left[i] > right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareNotGreaterThanOrEqual", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != (!(left[0] >= right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != (!(left[i] >= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareNotLessThan", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != (!(left[0] < right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != (!(left[i] < right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareNotLessThanOrEqual", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != (!(left[0] <= right[0]) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != (!(left[i] <= right[i]) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareOrdered", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((!double.IsNaN(left[0]) && !double.IsNaN(right[0])) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((!double.IsNaN(left[i]) && !double.IsNaN(right[i])) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "CompareUnordered", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != ((double.IsNaN(left[0]) || double.IsNaN(right[0])) ? -1 : 0)", "BitConverter.DoubleToInt64Bits(result[i]) != ((double.IsNaN(left[i]) || double.IsNaN(right[i])) ? -1 : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Divide", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] / right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] / right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Max", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(Math.Max(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(Math.Max(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Max", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "Math.Max(left[0], right[0]) != result[0]", "Math.Max(left[i], right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Max", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "Math.Max(left[0], right[0]) != result[0]", "Math.Max(left[i], right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Min", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(Math.Min(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(Math.Min(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Min", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MinValue))", "(byte)(random.Next(0, byte.MinValue))", "Math.Min(left[0], right[0]) != result[0]", "Math.Min(left[i], right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Min", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MinValue))", "(short)(random.Next(short.MinValue, short.MinValue))", "Math.Min(left[0], right[0]) != result[0]", "Math.Min(left[i], right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Multiply", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] * right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] * right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(BitConverter.DoubleToInt64Bits(left[0]) | BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "(BitConverter.DoubleToInt64Bits(left[i]) | BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] | right[0]) != result[0]", "(byte)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] | right[0]) != result[0]", "(short)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] | right[0]) != result[0]", "(int)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] | right[0]) != result[0]", "(long)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] | right[0]) != result[0]", "(sbyte)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] | right[0]) != result[0]", "(ushort)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] | right[0]) != result[0]", "(uint)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Or", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] | right[0]) != result[0]", "(ulong)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] - right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] - right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] - right[0]) != result[0]", "(byte)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] - right[0]) != result[0]", "(short)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] - right[0]) != result[0]", "(int)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] - right[0]) != result[0]", "(long)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] - right[0]) != result[0]", "(sbyte)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] - right[0]) != result[0]", "(ushort)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] - right[0]) != result[0]", "(uint)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Subtract", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] - right[0]) != result[0]", "(ulong)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(BitConverter.DoubleToInt64Bits(left[0]) ^ BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "(BitConverter.DoubleToInt64Bits(left[i]) ^ BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] ^ right[0]) != result[0]", "(byte)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] ^ right[0]) != result[0]", "(short)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] ^ right[0]) != result[0]", "(int)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] ^ right[0]) != result[0]", "(long)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] ^ right[0]) != result[0]", "(sbyte)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] ^ right[0]) != result[0]", "(ushort)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] ^ right[0]) != result[0]", "(uint)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Sse2", "Sse2", "Xor", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] ^ right[0]) != result[0]", "(ulong)(left[i] ^ right[i]) != result[i]"}),
// IMM intrinsics
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, IMM, VectorSize, NextValueOp1, ValidateFirstResult, ValidateRemainingResults
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "Int16", "Vector128", "Int16", "1", "16", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] << 1) != result[0]", "(short)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "UInt16", "Vector128", "UInt16", "1", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(firstOp[0] << 1) != result[0]", "(ushort)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "Int32", "Vector128", "Int32", "1", "16", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] << 1) != result[0]", "(int)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "UInt32", "Vector128", "UInt32", "1", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(firstOp[0] << 1) != result[0]", "(uint)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "Int64", "Vector128", "Int64", "1", "16", "(long)(random.Next(0, int.MaxValue))", "(long)(firstOp[0] << 1) != result[0]", "(long)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "UInt64", "Vector128", "UInt64", "1", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(firstOp[0] << 1) != result[0]", "(ulong)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "Int16", "Vector128", "Int16", "16", "16", "(short)(random.Next(0, short.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "UInt16", "Vector128", "UInt16", "16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "Int32", "Vector128", "Int32", "32", "16", "(int)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "UInt32", "Vector128", "UInt32", "32", "16", "(uint)(random.Next(0, int.MaxValue))", "0 != result[0]", "0!= result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "Int64", "Vector128", "Int64", "64", "16", "(long)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical", "Vector128", "UInt64", "Vector128", "UInt64", "64", "16", "(ulong)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "Int16", "Vector128", "Int16", "1", "16", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] >> 1) != result[0]", "(short)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "UInt16", "Vector128", "UInt16", "1", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(firstOp[0] >> 1) != result[0]", "(ushort)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "Int32", "Vector128", "Int32", "1", "16", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] >> 1) != result[0]", "(int)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "UInt32", "Vector128", "UInt32", "1", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(firstOp[0] >> 1) != result[0]", "(uint)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "Int64", "Vector128", "Int64", "1", "16", "(long)(random.Next(0, int.MaxValue))", "(long)(firstOp[0] >> 1) != result[0]", "(long)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "UInt64", "Vector128", "UInt64", "1", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(firstOp[0] >> 1) != result[0]", "(ulong)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "Int16", "Vector128", "Int16", "16", "16", "(short)(random.Next(0, short.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "UInt16", "Vector128", "UInt16", "16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "Int32", "Vector128", "Int32", "32", "16", "(int)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "UInt32", "Vector128", "UInt32", "32", "16", "(uint)(random.Next(0, int.MaxValue))", "0 != result[0]", "0!= result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "Int64", "Vector128", "Int64", "64", "16", "(long)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical", "Vector128", "UInt64", "Vector128", "UInt64", "64", "16", "(ulong)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightArithmetic", "Vector128", "Int16", "Vector128", "Int16", "1", "16", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] >> 1) != result[0]", "(short)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightArithmetic", "Vector128", "Int32", "Vector128", "Int32", "1", "16", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] >> 1) != result[0]", "(int)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightArithmetic", "Vector128", "Int16", "Vector128", "Int16", "16", "16", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] >> 15) != result[0]", "(short)(firstOp[i] >> 15) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightArithmetic", "Vector128", "Int32", "Vector128", "Int32", "32", "16", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] >> 31) != result[0]", "(int)(firstOp[i] >> 31) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "SByte", "Vector128", "SByte", "1", "16", "(sbyte)8", "result[0] != 0", "result[i] != 8"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "Byte", "Vector128", "Byte", "1", "16", "(byte)8", "result[0] != 0", "result[i] != 8"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "Int16", "Vector128", "Int16", "1", "16", "(short)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "UInt16", "Vector128", "UInt16", "1", "16", "(ushort)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "Int32", "Vector128", "Int32", "1", "16", "(int)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "UInt32", "Vector128", "UInt32", "1", "16", "(uint)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "Int64", "Vector128", "Int64", "1", "16", "(long)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftLeftLogical128BitLane", "Vector128", "UInt64", "Vector128", "UInt64", "1", "16", "(ulong)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "SByte", "Vector128", "SByte", "1", "16", "(sbyte)8", "result[0] != 8", "(i == 15 ? result[i] != 0 : result[i] != 8)"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "Byte", "Vector128", "Byte", "1", "16", "(byte)8", "result[0] != 8", "(i == 15 ? result[i] != 0 : result[i] != 8)"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "Int16", "Vector128", "Int16", "1", "16", "(short)8", "result[0] != 2048", "(i == 7 ? result[i] != 0 : result[i] != 2048)"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "UInt16", "Vector128", "UInt16", "1", "16", "(ushort)8", "result[0] != 2048", "(i == 7 ? result[i] != 0 : result[i] != 2048)"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "Int32", "Vector128", "Int32", "1", "16", "(int)8", "result[0] != 134217728", "(i == 3 ? result[i] != 0 : result[i] != 134217728)"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "UInt32", "Vector128", "UInt32", "1", "16", "(uint)8", "result[0] != 134217728", "(i == 3 ? result[i] != 0 : result[i] != 134217728)"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "Int64", "Vector128", "Int64", "1", "16", "(long)8", "result[0] != 576460752303423488L", "(result[i] != 0)"}),
("ImmUnOpTest.template", new string[] { "Sse2", "Sse2", "ShiftRightLogical128BitLane", "Vector128", "UInt64", "Vector128", "UInt64", "1", "16", "(ulong)8", "result[0] != 576460752303423488UL", "(result[i] != 0)"}),
("ExtractScalarTest.template",new string[] {"Sse2", "Sse2", "Extract", "Vector128", "Int16", "Vector128", "Int16", "1", "16", "(short)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] {"Sse2", "Sse2", "Extract", "Vector128", "UInt16", "Vector128", "UInt16", "1", "16", "(ushort)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] {"Sse2", "Sse2", "Extract", "Vector128", "Int16", "Vector128", "Int16", "129", "16", "(short)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] {"Sse2", "Sse2", "Extract", "Vector128", "UInt16", "Vector128", "UInt16", "129", "16", "(ushort)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("InsertScalarTest.template",new string[] { "Sse2", "Sse2", "Insert", "Vector128", "Int16", "Vector128", "Int16", "1", "(short)2", "16", "(short)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse2", "Sse2", "Insert", "Vector128", "UInt16", "Vector128", "UInt16", "1", "(ushort)2","16", "(ushort)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse2", "Sse2", "Insert", "Vector128", "Int16", "Vector128", "Int16", "129","(short)2", "16", "(short)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse2", "Sse2", "Insert", "Vector128", "UInt16", "Vector128", "UInt16", "129","(ushort)2","16", "(ushort)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
};
private static readonly (string templateFileName, string[] templateData)[] Sse3Inputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3BaseType, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("AlternatingBinOpTest.template", new string[] { "Sse3", "Sse2", "AddSubtract", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i] - right[i])", "BitConverter.DoubleToInt64Bits(result[i + 1]) != BitConverter.DoubleToInt64Bits(left[i + 1] + right[i + 1])"}),
("AlternatingBinOpTest.template", new string[] { "Sse3", "Sse" , "AddSubtract", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i] - right[i])", "BitConverter.SingleToInt32Bits(result[i + 1]) != BitConverter.SingleToInt32Bits(left[i + 1] + right[i + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Sse3", "Sse2", "HorizontalAdd", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[i1]) != BitConverter.DoubleToInt64Bits(left[i3] + left[i3 + 1])", "BitConverter.DoubleToInt64Bits(result[i2]) != BitConverter.DoubleToInt64Bits(right[i3] + right[i3 + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Sse3", "Sse", "HorizontalAdd", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[i1]) != BitConverter.SingleToInt32Bits(left[i3] + left[i3 + 1])", "BitConverter.SingleToInt32Bits(result[i2]) != BitConverter.SingleToInt32Bits(right[i3] + right[i3 + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Sse3", "Sse2", "HorizontalSubtract", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[i1]) != BitConverter.DoubleToInt64Bits(left[i3] - left[i3 + 1])", "BitConverter.DoubleToInt64Bits(result[i2]) != BitConverter.DoubleToInt64Bits(right[i3] - right[i3 + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Sse3", "Sse", "HorizontalSubtract", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[i1]) != BitConverter.SingleToInt32Bits(left[i3] - left[i3 + 1])", "BitConverter.SingleToInt32Bits(result[i2]) != BitConverter.SingleToInt32Bits(right[i3] - right[i3 + 1])"}),
};
private static readonly (string templateFileName, string[] templateData)[] Ssse3Inputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3BaseType, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("SimpleUnOpTest.template", new string[] { "Ssse3", "Sse2", "Abs", "Vector128", "Byte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue + 1, sbyte.MaxValue))", "result[0] != Math.Abs(firstOp[0])", "result[i] != Math.Abs(firstOp[i])"}),
("SimpleUnOpTest.template", new string[] { "Ssse3", "Sse2", "Abs", "Vector128", "UInt16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue + 1, short.MaxValue))", "result[0] != Math.Abs(firstOp[0])", "result[i] != Math.Abs(firstOp[i])"}),
("SimpleUnOpTest.template", new string[] { "Ssse3", "Sse2", "Abs", "Vector128", "UInt32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue + 1, int.MaxValue))", "result[0] != Math.Abs(firstOp[0])", "result[i] != Math.Abs(firstOp[i])"}),
("HorizontalBinOpTest.template", new string[] { "Ssse3", "Sse2", "HorizontalAdd", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[i1] != (short)(left[i3] + left[i3 + 1])", "result[i2] != (short)(right[i3] + right[i3 + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Ssse3", "Sse2", "HorizontalAdd", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[i1] != (int)(left[i3] + left[i3 + 1])", "result[i2] != (int)(right[i3] + right[i3 + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Ssse3", "Sse2", "HorizontalAddSaturate", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[i1] != Math.Clamp((left[i3] + left[i3 + 1]), short.MinValue, short.MaxValue)", "result[i2] != Math.Clamp((right[i3] + right[i3 + 1]), short.MinValue, short.MaxValue)"}),
("HorizontalBinOpTest.template", new string[] { "Ssse3", "Sse2", "HorizontalSubtract", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[i1] != (short)(left[i3] - left[i3 + 1])", "result[i2] != (short)(right[i3] - right[i3 + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Ssse3", "Sse2", "HorizontalSubtract", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[i1] != (int)(left[i3] - left[i3 + 1])", "result[i2] != (int)(right[i3] - right[i3 + 1])"}),
("HorizontalBinOpTest.template", new string[] { "Ssse3", "Sse2", "HorizontalSubtractSaturate", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[i1] != Math.Clamp((left[i3] - left[i3 + 1]), short.MinValue, short.MaxValue)", "result[i2] != Math.Clamp((right[i3] - right[i3 + 1]), short.MinValue, short.MaxValue)"}),
("SimpleBinOpTest.template", new string[] { "Ssse3", "Sse2", "MultiplyAddAdjacent", "Vector128", "Int16", "Vector128", "Byte", "Vector128", "SByte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != Math.Clamp(((right[1] * left[1]) + (right[0] * left[0])), short.MinValue, short.MaxValue)", "result[i] != Math.Clamp(((right[(i * 2) + 1] * left[(i * 2) + 1]) + (right[i * 2] * left[i * 2])), short.MinValue, short.MaxValue)"}),
("SimpleBinOpTest.template", new string[] { "Ssse3", "Sse2", "MultiplyHighRoundScale", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[0] != (short)((((left[0] * right[0]) >> 14) + 1) >> 1)", "result[i] != (short)((((left[i] * right[i]) >> 14) + 1) >> 1)"}),
("SimpleBinOpTest.template", new string[] { "Ssse3", "Sse2", "Shuffle", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != ((right[0] < 0) ? 0 : left[right[0] & 0x0F])", "result[i] != ((right[i] < 0) ? 0 : left[right[i] & 0x0F])"}),
("SimpleBinOpTest.template", new string[] { "Ssse3", "Sse2", "Sign", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue + 1, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != (right[0] < 0 ? (sbyte)(-left[0]) : (right[0] > 0 ? left[0] : 0))", "result[i] != (right[i] < 0 ? (sbyte)(-left[i]) : (right[i] > 0 ? left[i] : 0))"}),
("SimpleBinOpTest.template", new string[] { "Ssse3", "Sse2", "Sign", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue + 1, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[0] != (right[0] < 0 ? (short)(-left[0]) : (right[0] > 0 ? left[0] : 0))", "result[i] != (right[i] < 0 ? (short)(-left[i]) : (right[i] > 0 ? left[i] : 0))"}),
("SimpleBinOpTest.template", new string[] { "Ssse3", "Sse2", "Sign", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue + 1, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != (right[0] < 0 ? (int)(-left[0]) : (right[0] > 0 ? left[0] : 0))", "result[i] != (right[i] < 0 ? (int)(-left[i]) : (right[i] > 0 ? left[i] : 0))"}),
};
private static readonly (string templateFileName, string[] templateData)[] Sse41Inputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3BaseType, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("SimpleTernOpTest.template", new string[] { "Sse41", "Sse2", "BlendVariable", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(((i % 2) == 0) ? 128 : 1)", "((thirdOp[0] >> 7) & 1) == 1 ? secondOp[0] != result[0] : firstOp[0] != result[0]", "((thirdOp[i] >> 7) & 1) == 1 ? secondOp[i] != result[i] : firstOp[i] != result[i]"}),
("SimpleTernOpTest.template", new string[] { "Sse41", "Sse2", "BlendVariable", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(double)(((i % 2) == 0) ? -0.0 : 1.0)", "((BitConverter.DoubleToInt64Bits(thirdOp[0]) >> 63) & 1) == 1 ? BitConverter.DoubleToInt64Bits(secondOp[0]) != BitConverter.DoubleToInt64Bits(result[0]) : BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])", "((BitConverter.DoubleToInt64Bits(thirdOp[i]) >> 63) & 1) == 1 ? BitConverter.DoubleToInt64Bits(secondOp[i]) != BitConverter.DoubleToInt64Bits(result[i]) : BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleTernOpTest.template", new string[] { "Sse41", "Sse2", "BlendVariable", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(((i % 2) == 0) ? -128 : 1)", "((thirdOp[0] >> 7) & 1) == 1 ? secondOp[0] != result[0] : firstOp[0] != result[0]", "((thirdOp[i] >> 7) & 1) == 1 ? secondOp[i] != result[i] : firstOp[i] != result[i]"}),
("SimpleTernOpTest.template", new string[] { "Sse41", "Sse", "BlendVariable", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(float)(((i % 2) == 0) ? -0.0 : 1.0)", "((BitConverter.SingleToInt32Bits(thirdOp[0]) >> 31) & 1) == 1 ? BitConverter.SingleToInt32Bits(secondOp[0]) != BitConverter.SingleToInt32Bits(result[0]) : BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])", "((BitConverter.SingleToInt32Bits(thirdOp[i]) >> 31) & 1) == 1 ? BitConverter.SingleToInt32Bits(secondOp[i]) != BitConverter.SingleToInt32Bits(result[i]) : BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse2", "Ceiling", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse", "Ceiling", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "CeilingScalar", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(right[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse", "CeilingScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(right[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "CompareEqual", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((long)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((long)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "CompareEqual", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((ulong)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((ulong)(-1)) : 0)"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse2", "Floor", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse", "Floor", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "FloorScalar", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(right[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse", "FloorScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(right[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Max", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != Math.Max(left[0], right[0])", "result[i] != Math.Max(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Max", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != Math.Max(left[0], right[0])", "result[i] != Math.Max(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Max", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "result[0] != Math.Max(left[0], right[0])", "result[i] != Math.Max(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Max", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "result[0] != Math.Max(left[0], right[0])", "result[i] != Math.Max(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Min", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != Math.Min(left[0], right[0])", "result[i] != Math.Min(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Min", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != Math.Min(left[0], right[0])", "result[i] != Math.Min(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Min", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "result[0] != Math.Min(left[0], right[0])", "result[i] != Math.Min(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "Min", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "result[0] != Math.Min(left[0], right[0])", "result[i] != Math.Min(left[i], right[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "MultiplyLow", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != BitConverter.ToInt32(BitConverter.GetBytes(((long)(left[0])) * right[0]), 0)", "result[i] != BitConverter.ToInt32(BitConverter.GetBytes(((long)(left[i])) * right[i]), 0)"}),
("HorizontalBinOpTest.template", new string[] { "Sse41", "Sse2", "PackUnsignedSaturate", "Vector128", "UInt16", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[i1] != ((left[i3 - inner] > 0xFFFF) ? 0xFFFF : ((left[i3 - inner] < 0) ? 0 : BitConverter.ToUInt16(BitConverter.GetBytes(left[i3 - inner]), 0)))", "result[i2] != ((right[i3 - inner] > 0xFFFF) ? 0xFFFF : ((right[i3 - inner] < 0) ? 0 : BitConverter.ToUInt16(BitConverter.GetBytes(right[i3 - inner]), 0)))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse2", "RoundCurrentDirection", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse", "RoundCurrentDirection", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "RoundCurrentDirectionScalar", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Round(right[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse", "RoundCurrentDirectionScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Round(right[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse2", "RoundToNearestInteger", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[0], MidpointRounding.AwayFromZero))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[i], MidpointRounding.AwayFromZero))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse", "RoundToNearestInteger", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[0], MidpointRounding.AwayFromZero))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[i], MidpointRounding.AwayFromZero))"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "RoundToNearestIntegerScalar", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Round(right[0], MidpointRounding.AwayFromZero))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse", "RoundToNearestIntegerScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Round(right[0], MidpointRounding.AwayFromZero))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse2", "RoundToNegativeInfinity", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse", "RoundToNegativeInfinity", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "RoundToNegativeInfinityScalar", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(right[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse", "RoundToNegativeInfinityScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(right[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse2", "RoundToPositiveInfinity", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse", "RoundToPositiveInfinity", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "RoundToPositiveInfinityScalar", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(right[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse", "RoundToPositiveInfinityScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(right[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse2", "RoundToZero", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits((firstOp[0] > 0) ? Math.Floor(firstOp[0]) : Math.Ceiling(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits((firstOp[i] > 0) ? Math.Floor(firstOp[i]) : Math.Ceiling(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Sse41", "Sse", "RoundToZero", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits((firstOp[0] > 0) ? MathF.Floor(firstOp[0]) : MathF.Ceiling(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits((firstOp[i] > 0) ? MathF.Floor(firstOp[i]) : MathF.Ceiling(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse2", "RoundToZeroScalar", "Vector128", "Double", "Vector128", "Double", "Vector128", "Double", "16", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits((right[0] > 0) ? Math.Floor(right[0]) : Math.Ceiling(right[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
("SimpleBinOpTest.template", new string[] { "Sse41", "Sse", "RoundToZeroScalar", "Vector128", "Single", "Vector128", "Single", "Vector128", "Single", "16", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits((right[0] > 0) ? MathF.Floor(right[0]) : MathF.Ceiling(right[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(~value[i] & byte.MaxValue) == 0"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(~value[i] & -1) == 0"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(~value[i] & -1) == 0"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(~value[i] & -1) == 0"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(~value[i] & -1) == 0"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(~value[i] & ushort.MaxValue) == 0"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(~value[i] & uint.MaxValue) == 0"}),
("BooleanUnOpTest.template", new string[] { "Sse41", "Sse2", "TestAllOnes", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(~value[i] & ulong.MaxValue) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestAllZeros", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestC", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestMixOnesZeros", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Sse41", "Sse2", "TestNotZAndNotC", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "Byte", "Vector128", "Byte", "Vector128", "Byte", "16", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "Int16", "Vector128", "Int16", "Vector128", "Int16", "16", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "Int32", "Vector128", "Int32", "Vector128", "Int32", "16", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "SByte", "Vector128", "SByte", "Vector128", "SByte", "16", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "UInt16", "Vector128", "UInt16", "Vector128", "UInt16", "16", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "UInt32", "Vector128", "UInt32", "Vector128", "UInt32", "16", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Sse41", "Sse2", "TestZ", "Vector128", "UInt64", "Vector128", "UInt64", "Vector128", "UInt64", "16", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(left[i] & right[i]) == 0"}),
// IMM intrinsics
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, IMM, Op2 VectorSize, NextValueOp1, ValidateResults
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "Byte", "Vector128", "Byte", "1", "16", "(byte)(random.Next(0, byte.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "SByte", "Vector128", "SByte", "1", "16", "(sbyte)(random.Next(0, sbyte.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "Int32", "Vector128", "Int32", "1", "16", "(int)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "UInt32", "Vector128", "UInt32", "1", "16", "(uint)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "Int64", "Vector128", "Int64", "1", "16", "(long)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "UInt64", "Vector128", "UInt64", "1", "16", "(ulong)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse", "Extract", "Vector128", "Single", "Vector128", "Single", "1", "16", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(firstOp[1]))"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "Byte", "Vector128", "Byte", "129", "16", "(byte)(random.Next(0, byte.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "SByte", "Vector128", "SByte", "129", "16", "(sbyte)(random.Next(0, sbyte.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "Int32", "Vector128", "Int32", "129", "16", "(int)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "UInt32", "Vector128", "UInt32", "129", "16", "(uint)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "Int64", "Vector128", "Int64", "129", "16", "(long)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse2", "Extract", "Vector128", "UInt64", "Vector128", "UInt64", "129", "16", "(ulong)(random.Next(0, int.MaxValue))", "(result[0] != firstOp[1])"}),
("ExtractScalarTest.template",new string[] { "Sse41", "Sse", "Extract", "Vector128", "Single", "Vector128", "Single", "129", "16", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(firstOp[1]))"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "Byte", "Vector128", "Byte", "1", "(byte)2", "16", "(byte)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "SByte", "Vector128", "SByte", "1", "(sbyte)2", "16", "(sbyte)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "Int32", "Vector128", "Int32", "1", "(int)2", "16", "(int)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "UInt32", "Vector128", "UInt32", "1", "(uint)2", "16", "(uint)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "Int64", "Vector128", "Int64", "1", "(long)2", "16", "(long)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "UInt64", "Vector128", "UInt64", "1", "(ulong)2", "16", "(ulong)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse", "Insert", "Vector128", "Single", "Vector128", "Single", "0", "(float)2", "16", "(float)0", "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits((float)2) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits((float)0))"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "Byte", "Vector128", "Byte", "129", "(byte)2", "16", "(byte)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "SByte", "Vector128", "SByte", "129", "(sbyte)2", "16", "(sbyte)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "Int32", "Vector128", "Int32", "129", "(int)2", "16", "(int)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "UInt32", "Vector128", "UInt32", "129", "(uint)2", "16", "(uint)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "Int64", "Vector128", "Int64", "129", "(long)2", "16", "(long)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse2", "Insert", "Vector128", "UInt64", "Vector128", "UInt64", "129", "(ulong)2", "16", "(ulong)0", "(i == 1 ? result[i] != 2 : result[i] != 0)"}),
("InsertScalarTest.template",new string[] { "Sse41", "Sse", "Insert", "Vector128", "Single", "Vector128", "Single", "217", "(float)2", "16", "(float)(random.NextDouble())", "(i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits((float)0))"}),
};
private static readonly (string templateFileName, string[] templateData)[] Sse42Inputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3BaseType, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("SimpleBinOpTest.template", new string[] { "Sse42", "Sse2", "CompareGreaterThan", "Vector128", "Int64", "Vector128", "Int64", "Vector128", "Int64", "16", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((long)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((long)(-1)) : 0)"}),
};
private static readonly (string templateFileName, string[] templateData)[] AvxInputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3BaseType, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Add", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] + right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] + right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Add", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "AddSubtract", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] - right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "((i % 2 != 0) && (BitConverter.DoubleToInt64Bits(left[i] + right[i]) != BitConverter.DoubleToInt64Bits(result[i]))) || ((i % 2 == 0) && (BitConverter.DoubleToInt64Bits(left[i] - right[i]) != BitConverter.DoubleToInt64Bits(result[i])))"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "AddSubtract", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] - right[0]) != BitConverter.SingleToInt32Bits(result[0])", "((i % 2 != 0) && (BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i]))) || ((i % 2 == 0) && (BitConverter.SingleToInt32Bits(left[i] - right[i]) != BitConverter.SingleToInt32Bits(result[i])))"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "And", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(BitConverter.DoubleToInt64Bits(left[0]) & BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "(BitConverter.DoubleToInt64Bits(left[i]) & BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "And", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "(BitConverter.SingleToInt32Bits(left[i]) & BitConverter.SingleToInt32Bits(right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "AndNot", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "((~BitConverter.DoubleToInt64Bits(left[0])) & BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "((~BitConverter.DoubleToInt64Bits(left[i])) & BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "AndNot", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "((~BitConverter.SingleToInt32Bits(left[0])) & BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "((~BitConverter.SingleToInt32Bits(left[i])) & BitConverter.SingleToInt32Bits(right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleTernOpTest.template", new string[] { "Avx", "Avx", "BlendVariable", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(double)(((i % 2) == 0) ? -0.0 : 1.0)", "((BitConverter.DoubleToInt64Bits(thirdOp[0]) >> 63) & 1) == 1 ? BitConverter.DoubleToInt64Bits(secondOp[0]) != BitConverter.DoubleToInt64Bits(result[0]) : BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])", "((BitConverter.DoubleToInt64Bits(thirdOp[i]) >> 63) & 1) == 1 ? BitConverter.DoubleToInt64Bits(secondOp[i]) != BitConverter.DoubleToInt64Bits(result[i]) : BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleTernOpTest.template", new string[] { "Avx", "Avx", "BlendVariable", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(float)(((i % 2) == 0) ? -0.0 : 1.0)", "((BitConverter.SingleToInt32Bits(thirdOp[0]) >> 31) & 1) == 1 ? BitConverter.SingleToInt32Bits(secondOp[0]) != BitConverter.SingleToInt32Bits(result[0]) : BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])", "((BitConverter.SingleToInt32Bits(thirdOp[i]) >> 31) & 1) == 1 ? BitConverter.SingleToInt32Bits(secondOp[i]) != BitConverter.SingleToInt32Bits(result[i]) : BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "Ceiling", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "Ceiling", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Divide", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] / right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] / right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Divide", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] / right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] / right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "DuplicateEvenIndexed", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])", "(i % 2 == 0) ? (BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])) : (BitConverter.DoubleToInt64Bits(firstOp[i - 1]) != BitConverter.DoubleToInt64Bits(result[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "DuplicateEvenIndexed", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])", "(i % 2 == 0) ? (BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])) : (BitConverter.SingleToInt32Bits(firstOp[i - 1]) != BitConverter.SingleToInt32Bits(result[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "DuplicateOddIndexed", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(firstOp[1]) != BitConverter.SingleToInt32Bits(result[0])", "(i % 2 == 0) ? (BitConverter.SingleToInt32Bits(firstOp[i + 1]) != BitConverter.SingleToInt32Bits(result[i])) : (BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "Floor", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "Floor", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Max", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(Math.Max(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(Math.Max(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Max", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(MathF.Max(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(MathF.Max(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Min", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(Math.Min(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(Math.Min(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Min", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(MathF.Min(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(MathF.Min(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Multiply", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] * right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] * right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Multiply", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] * right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] * right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Or", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(BitConverter.DoubleToInt64Bits(left[0]) | BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "(BitConverter.DoubleToInt64Bits(left[i]) | BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Or", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(left[0]) | BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "(BitConverter.SingleToInt32Bits(left[i]) | BitConverter.SingleToInt32Bits(right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundCurrentDirection", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundCurrentDirection", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToNearestInteger", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[0], MidpointRounding.AwayFromZero))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Round(firstOp[i], MidpointRounding.AwayFromZero))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToNearestInteger", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[0], MidpointRounding.AwayFromZero))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Round(firstOp[i], MidpointRounding.AwayFromZero))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToNegativeInfinity", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Floor(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToNegativeInfinity", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToPositiveInfinity", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(Math.Ceiling(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToPositiveInfinity", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Ceiling(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToZero", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits((firstOp[0] > 0) ? Math.Floor(firstOp[0]) : Math.Ceiling(firstOp[0]))", "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits((firstOp[i] > 0) ? Math.Floor(firstOp[i]) : Math.Ceiling(firstOp[i]))"}),
("SimpleUnOpTest.template", new string[] { "Avx", "Avx", "RoundToZero", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits((firstOp[0] > 0) ? MathF.Floor(firstOp[0]) : MathF.Ceiling(firstOp[0]))", "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits((firstOp[i] > 0) ? MathF.Floor(firstOp[i]) : MathF.Ceiling(firstOp[i]))"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Subtract", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "BitConverter.DoubleToInt64Bits(left[0] - right[0]) != BitConverter.DoubleToInt64Bits(result[0])", "BitConverter.DoubleToInt64Bits(left[i] - right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Subtract", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "BitConverter.SingleToInt32Bits(left[0] - right[0]) != BitConverter.SingleToInt32Bits(result[0])", "BitConverter.SingleToInt32Bits(left[i] - right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestC", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(~left[i] & right[i]) == 0"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanTwoCmpOpTest.template", new string[] { "Avx", "Avx", "TestNotZAndNotC", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "((left[i] & right[i]) == 0)", "((~left[i] & right[i]) == 0)"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("BooleanBinOpTest.template", new string[] { "Avx", "Avx", "TestZ", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(left[i] & right[i]) == 0"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Xor", "Vector256", "Double", "Vector256", "Double", "Vector256", "Double", "32", "(double)(random.NextDouble())", "(double)(random.NextDouble())", "(BitConverter.DoubleToInt64Bits(left[0]) ^ BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", "(BitConverter.DoubleToInt64Bits(left[i]) ^ BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}),
("SimpleBinOpTest.template", new string[] { "Avx", "Avx", "Xor", "Vector256", "Single", "Vector256", "Single", "Vector256", "Single", "32", "(float)(random.NextDouble())", "(float)(random.NextDouble())", "(BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", "(BitConverter.SingleToInt32Bits(left[i]) ^ BitConverter.SingleToInt32Bits(right[i])) != BitConverter.SingleToInt32Bits(result[i])"}),
};
private static readonly (string templateFileName, string[] templateData)[] Avx2Inputs = new []
{
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, Op2VectorType, Op2BaseType, Op3VectorType, Op3BaseType, VectorSize, NextValueOp1, NextValueOp2, NextValueOp3, ValidateFirstResult, ValidateRemainingResults
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] + right[0]) != result[0]", "(byte)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] + right[0]) != result[0]", "(short)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] + right[0]) != result[0]", "(int)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] + right[0]) != result[0]", "(long)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] + right[0]) != result[0]", "(sbyte)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] + right[0]) != result[0]", "(ushort)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] + right[0]) != result[0]", "(uint)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Add", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] + right[0]) != result[0]", "(ulong)(left[i] + right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] & right[0]) != result[0]", "(byte)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] & right[0]) != result[0]", "(short)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] & right[0]) != result[0]", "(int)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] & right[0]) != result[0]", "(long)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] & right[0]) != result[0]", "(sbyte)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] & right[0]) != result[0]", "(ushort)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] & right[0]) != result[0]", "(uint)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "And", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] & right[0]) != result[0]", "(ulong)(left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(~left[0] & right[0]) != result[0]", "(byte)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(~left[0] & right[0]) != result[0]", "(short)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(~left[0] & right[0]) != result[0]", "(int)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(~left[0] & right[0]) != result[0]", "(long)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(~left[0] & right[0]) != result[0]", "(sbyte)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(~left[0] & right[0]) != result[0]", "(ushort)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(~left[0] & right[0]) != result[0]", "(uint)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "AndNot", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(~left[0] & right[0]) != result[0]", "(ulong)(~left[i] & right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Average", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)((left[0] + right[0] + 1) >> 1) != result[0]", "(byte)((left[i] + right[i] + 1) >> 1) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Average", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(short.MinValue, short.MaxValue))", "(ushort)(random.Next(short.MinValue, short.MaxValue))", "(ushort)((left[0] + right[0] + 1) >> 1) != result[0]", "(ushort)((left[i] + right[i] + 1) >> 1) != result[i]"}),
("SimpleTernOpTest.template", new string[] { "Avx2", "Avx", "BlendVariable", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(((i % 2) == 0) ? 128 : 1)", "((thirdOp[0] >> 7) & 1) == 1 ? secondOp[0] != result[0] : firstOp[0] != result[0]", "((thirdOp[i] >> 7) & 1) == 1 ? secondOp[i] != result[i] : firstOp[i] != result[i]"}),
("SimpleTernOpTest.template", new string[] { "Avx2", "Avx", "BlendVariable", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(((i % 2) == 0) ? -128 : 1)", "((thirdOp[0] >> 7) & 1) == 1 ? secondOp[0] != result[0] : firstOp[0] != result[0]", "((thirdOp[i] >> 7) & 1) == 1 ? secondOp[i] != result[i] : firstOp[i] != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((byte)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((byte)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((short)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((short)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((int)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((int)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((long)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((long)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((sbyte)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((sbyte)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((ushort)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((ushort)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((uint)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((uint)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareEqual", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "result[0] != ((left[0] == right[0]) ? unchecked((ulong)(-1)) : 0)", "result[i] != ((left[i] == right[i]) ? unchecked((ulong)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareGreaterThan", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((short)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((short)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareGreaterThan", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((int)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((int)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareGreaterThan", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((long)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((long)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "CompareGreaterThan", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "result[0] != ((left[0] > right[0]) ? unchecked((sbyte)(-1)) : 0)", "result[i] != ((left[i] > right[i]) ? unchecked((sbyte)(-1)) : 0)"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] | right[0]) != result[0]", "(byte)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] | right[0]) != result[0]", "(short)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] | right[0]) != result[0]", "(int)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] | right[0]) != result[0]", "(long)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] | right[0]) != result[0]", "(sbyte)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] | right[0]) != result[0]", "(ushort)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] | right[0]) != result[0]", "(uint)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Or", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] | right[0]) != result[0]", "(ulong)(left[i] | right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] - right[0]) != result[0]", "(byte)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] - right[0]) != result[0]", "(short)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] - right[0]) != result[0]", "(int)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] - right[0]) != result[0]", "(long)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] - right[0]) != result[0]", "(sbyte)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] - right[0]) != result[0]", "(ushort)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] - right[0]) != result[0]", "(uint)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Subtract", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] - right[0]) != result[0]", "(ulong)(left[i] - right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "Byte", "Vector256", "Byte", "Vector256", "Byte", "32", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(random.Next(0, byte.MaxValue))", "(byte)(left[0] ^ right[0]) != result[0]", "(byte)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "Int16", "Vector256", "Int16", "Vector256", "Int16", "32", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(random.Next(short.MinValue, short.MaxValue))", "(short)(left[0] ^ right[0]) != result[0]", "(short)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "Int32", "Vector256", "Int32", "Vector256", "Int32", "32", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(random.Next(int.MinValue, int.MaxValue))", "(int)(left[0] ^ right[0]) != result[0]", "(int)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "Int64", "Vector256", "Int64", "Vector256", "Int64", "32", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(random.Next(int.MinValue, int.MaxValue))", "(long)(left[0] ^ right[0]) != result[0]", "(long)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "SByte", "Vector256", "SByte", "Vector256", "SByte", "32", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", "(sbyte)(left[0] ^ right[0]) != result[0]", "(sbyte)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "UInt16", "Vector256", "UInt16", "Vector256", "UInt16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(left[0] ^ right[0]) != result[0]", "(ushort)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "UInt32", "Vector256", "UInt32", "Vector256", "UInt32", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(random.Next(0, int.MaxValue))", "(uint)(left[0] ^ right[0]) != result[0]", "(uint)(left[i] ^ right[i]) != result[i]"}),
("SimpleBinOpTest.template", new string[] { "Avx2", "Avx", "Xor", "Vector256", "UInt64", "Vector256", "UInt64", "Vector256", "UInt64", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(left[0] ^ right[0]) != result[0]", "(ulong)(left[i] ^ right[i]) != result[i]"}),
// IMM intrinsics
// TemplateName Isa, LoadIsa, Method, RetVectorType, RetBaseType, Op1VectorType, Op1BaseType, IMM, VectorSize, NextValueOp1, ValidateFirstResult, ValidateRemainingResults
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "Int16", "Vector256", "Int16", "1", "32", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] << 1) != result[0]", "(short)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "UInt16", "Vector256", "UInt16", "1", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(firstOp[0] << 1) != result[0]", "(ushort)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "Int32", "Vector256", "Int32", "1", "32", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] << 1) != result[0]", "(int)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "UInt32", "Vector256", "UInt32", "1", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(firstOp[0] << 1) != result[0]", "(uint)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "Int64", "Vector256", "Int64", "1", "32", "(long)(random.Next(0, int.MaxValue))", "(long)(firstOp[0] << 1) != result[0]", "(long)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "UInt64", "Vector256", "UInt64", "1", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(firstOp[0] << 1) != result[0]", "(ulong)(firstOp[i] << 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "Int16", "Vector256", "Int16", "16", "32", "(short)(random.Next(0, short.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "UInt16", "Vector256", "UInt16", "16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "Int32", "Vector256", "Int32", "32", "32", "(int)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "UInt32", "Vector256", "UInt32", "32", "32", "(uint)(random.Next(0, int.MaxValue))", "0 != result[0]", "0!= result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "Int64", "Vector256", "Int64", "64", "32", "(long)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical", "Vector256", "UInt64", "Vector256", "UInt64", "64", "32", "(ulong)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "Int16", "Vector256", "Int16", "1", "32", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] >> 1) != result[0]", "(short)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "UInt16", "Vector256", "UInt16", "1", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "(ushort)(firstOp[0] >> 1) != result[0]", "(ushort)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "Int32", "Vector256", "Int32", "1", "32", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] >> 1) != result[0]", "(int)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "UInt32", "Vector256", "UInt32", "1", "32", "(uint)(random.Next(0, int.MaxValue))", "(uint)(firstOp[0] >> 1) != result[0]", "(uint)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "Int64", "Vector256", "Int64", "1", "32", "(long)(random.Next(0, int.MaxValue))", "(long)(firstOp[0] >> 1) != result[0]", "(long)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "UInt64", "Vector256", "UInt64", "1", "32", "(ulong)(random.Next(0, int.MaxValue))", "(ulong)(firstOp[0] >> 1) != result[0]", "(ulong)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "Int16", "Vector256", "Int16", "16", "32", "(short)(random.Next(0, short.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "UInt16", "Vector256", "UInt16", "16", "32", "(ushort)(random.Next(0, ushort.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "Int32", "Vector256", "Int32", "32", "32", "(int)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "UInt32", "Vector256", "UInt32", "32", "32", "(uint)(random.Next(0, int.MaxValue))", "0 != result[0]", "0!= result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "Int64", "Vector256", "Int64", "64", "32", "(long)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical", "Vector256", "UInt64", "Vector256", "UInt64", "64", "32", "(ulong)(random.Next(0, int.MaxValue))", "0 != result[0]", "0 != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightArithmetic", "Vector256", "Int16", "Vector256", "Int16", "1", "32", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] >> 1) != result[0]", "(short)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightArithmetic", "Vector256", "Int32", "Vector256", "Int32", "1", "32", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] >> 1) != result[0]", "(int)(firstOp[i] >> 1) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightArithmetic", "Vector256", "Int16", "Vector256", "Int16", "16", "32", "(short)(random.Next(0, short.MaxValue))", "(short)(firstOp[0] >> 15) != result[0]", "(short)(firstOp[i] >> 15) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightArithmetic", "Vector256", "Int32", "Vector256", "Int32", "32", "32", "(int)(random.Next(0, int.MaxValue))", "(int)(firstOp[0] >> 31) != result[0]", "(int)(firstOp[i] >> 31) != result[i]"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "SByte", "Vector256", "SByte", "1", "32", "(sbyte)8", "result[0] != 0", "(i == 16 ? result[i] != 0 : result[i] != 8)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "Byte", "Vector256", "Byte", "1", "32", "(byte)8", "result[0] != 0", "(i == 16 ? result[i] != 0 : result[i] != 8)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "Int16", "Vector256", "Int16", "1", "32", "(short)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "UInt16", "Vector256", "UInt16", "1", "32", "(ushort)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "Int32", "Vector256", "Int32", "1", "32", "(int)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "UInt32", "Vector256", "UInt32", "1", "32", "(uint)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "Int64", "Vector256", "Int64", "1", "32", "(long)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftLeftLogical128BitLane", "Vector256", "UInt64", "Vector256", "UInt64", "1", "32", "(ulong)8", "result[0] != 2048", "result[i] != 2048"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "SByte", "Vector256", "SByte", "1", "32", "(sbyte)8", "result[0] != 8", "(i == 31 || i == 15 ? result[i] != 0 : result[i] != 8)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "Byte", "Vector256", "Byte", "1", "32", "(byte)8", "result[0] != 8", "(i == 31 || i == 15 ? result[i] != 0 : result[i] != 8)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "Int16", "Vector256", "Int16", "1", "32", "(short)8", "result[0] != 2048", "(i == 7 || i == 15 ? result[i] != 0 : result[i] != 2048)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "UInt16", "Vector256", "UInt16", "1", "32", "(ushort)8", "result[0] != 2048", "(i == 7 || i == 15 ? result[i] != 0 : result[i] != 2048)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "Int32", "Vector256", "Int32", "1", "32", "(int)8", "result[0] != 134217728", "(i == 3 || i == 7 ? result[i] != 0 : result[i] != 134217728)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "UInt32", "Vector256", "UInt32", "1", "32", "(uint)8", "result[0] != 134217728", "(i == 3 || i == 7 ? result[i] != 0 : result[i] != 134217728)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "Int64", "Vector256", "Int64", "1", "32", "(long)8", "result[0] != 576460752303423488L", "(i == 2 ? result[i] != 576460752303423488L : result[i] != 0)"}),
("ImmUnOpTest.template", new string[] { "Avx2", "Avx", "ShiftRightLogical128BitLane", "Vector256", "UInt64", "Vector256", "UInt64", "1", "32", "(ulong)8", "result[0] != 576460752303423488UL", "(i == 2 ? result[i] != 576460752303423488UL : result[i] != 0)"}),
};
private static void ProcessInputs(string isa, (string templateFileName, string[] templateData)[] inputs)
{
var testListFileName = Path.Combine("..", isa, $"Program.{isa}.cs");
using (var testListFile = new StreamWriter(testListFileName, append: false))
{
testListFile.WriteLine(@"// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
namespace JIT.HardwareIntrinsics.X86
{
public static partial class Program
{
static Program()
{
TestList = new Dictionary<string, Action>() {");
foreach (var input in inputs)
{
ProcessInput(testListFile, input);
}
testListFile.WriteLine(@" };
}
}
}");
}
}
private static bool isImmTemplate(string name)
{
return name == "ImmUnOpTest.template" || name == "InsertScalarTest.template" ||
name == "ExtractScalarTest.template";
}
private static void ProcessInput(StreamWriter testListFile, (string templateFileName, string[] templateData) input)
{
var testName = $"{input.templateData[2]}.{input.templateData[4]}";
if (isImmTemplate(input.templateFileName))
{
testName += $".{input.templateData[7]}";
}
// Ex: ["Add.Single"] = AddSingle
testListFile.WriteLine($@" [""{testName}""] = {input.templateData[2]}{input.templateData[4]}{(isImmTemplate(input.templateFileName) ? input.templateData[7] : "")},");
var testFileName = Path.Combine("..", input.templateData[0], $"{testName}.cs");
var template = File.ReadAllText(input.templateFileName);
if (input.templateData.Length != 0)
{
template = string.Format(template, input.templateData);
}
File.WriteAllText(testFileName, template);
}
ProcessInputs("Sse", SseInputs);
ProcessInputs("Sse2", Sse2Inputs);
ProcessInputs("Sse3", Sse3Inputs);
ProcessInputs("Ssse3", Ssse3Inputs);
ProcessInputs("Sse41", Sse41Inputs);
ProcessInputs("Sse42", Sse42Inputs);
ProcessInputs("Avx", AvxInputs);
ProcessInputs("Avx2", Avx2Inputs);
|