Source file
src/simd/compare_gen_amd64.go
1
2
3
4
5 package simd
6
7
8
9
10 func (x Int8x16) Less(y Int8x16) Mask8x16 {
11 return y.Greater(x)
12 }
13
14
15
16
17 func (x Int8x16) GreaterEqual(y Int8x16) Mask8x16 {
18 ones := x.Equal(x).AsInt8x16()
19 return y.Greater(x).AsInt8x16().Xor(ones).asMask()
20 }
21
22
23
24
25 func (x Int8x16) LessEqual(y Int8x16) Mask8x16 {
26 ones := x.Equal(x).AsInt8x16()
27 return x.Greater(y).AsInt8x16().Xor(ones).asMask()
28 }
29
30
31
32
33 func (x Int8x16) NotEqual(y Int8x16) Mask8x16 {
34 ones := x.Equal(x).AsInt8x16()
35 return x.Equal(y).AsInt8x16().Xor(ones).asMask()
36 }
37
38
39
40
41 func (x Int16x8) Less(y Int16x8) Mask16x8 {
42 return y.Greater(x)
43 }
44
45
46
47
48 func (x Int16x8) GreaterEqual(y Int16x8) Mask16x8 {
49 ones := x.Equal(x).AsInt16x8()
50 return y.Greater(x).AsInt16x8().Xor(ones).asMask()
51 }
52
53
54
55
56 func (x Int16x8) LessEqual(y Int16x8) Mask16x8 {
57 ones := x.Equal(x).AsInt16x8()
58 return x.Greater(y).AsInt16x8().Xor(ones).asMask()
59 }
60
61
62
63
64 func (x Int16x8) NotEqual(y Int16x8) Mask16x8 {
65 ones := x.Equal(x).AsInt16x8()
66 return x.Equal(y).AsInt16x8().Xor(ones).asMask()
67 }
68
69
70
71
72 func (x Int32x4) Less(y Int32x4) Mask32x4 {
73 return y.Greater(x)
74 }
75
76
77
78
79 func (x Int32x4) GreaterEqual(y Int32x4) Mask32x4 {
80 ones := x.Equal(x).AsInt32x4()
81 return y.Greater(x).AsInt32x4().Xor(ones).asMask()
82 }
83
84
85
86
87 func (x Int32x4) LessEqual(y Int32x4) Mask32x4 {
88 ones := x.Equal(x).AsInt32x4()
89 return x.Greater(y).AsInt32x4().Xor(ones).asMask()
90 }
91
92
93
94
95 func (x Int32x4) NotEqual(y Int32x4) Mask32x4 {
96 ones := x.Equal(x).AsInt32x4()
97 return x.Equal(y).AsInt32x4().Xor(ones).asMask()
98 }
99
100
101
102
103 func (x Int64x2) Less(y Int64x2) Mask64x2 {
104 return y.Greater(x)
105 }
106
107
108
109
110 func (x Int64x2) GreaterEqual(y Int64x2) Mask64x2 {
111 ones := x.Equal(x).AsInt64x2()
112 return y.Greater(x).AsInt64x2().Xor(ones).asMask()
113 }
114
115
116
117
118 func (x Int64x2) LessEqual(y Int64x2) Mask64x2 {
119 ones := x.Equal(x).AsInt64x2()
120 return x.Greater(y).AsInt64x2().Xor(ones).asMask()
121 }
122
123
124
125
126 func (x Int64x2) NotEqual(y Int64x2) Mask64x2 {
127 ones := x.Equal(x).AsInt64x2()
128 return x.Equal(y).AsInt64x2().Xor(ones).asMask()
129 }
130
131
132
133
134 func (x Int8x32) Less(y Int8x32) Mask8x32 {
135 return y.Greater(x)
136 }
137
138
139
140
141 func (x Int8x32) GreaterEqual(y Int8x32) Mask8x32 {
142 ones := x.Equal(x).AsInt8x32()
143 return y.Greater(x).AsInt8x32().Xor(ones).asMask()
144 }
145
146
147
148
149 func (x Int8x32) LessEqual(y Int8x32) Mask8x32 {
150 ones := x.Equal(x).AsInt8x32()
151 return x.Greater(y).AsInt8x32().Xor(ones).asMask()
152 }
153
154
155
156
157 func (x Int8x32) NotEqual(y Int8x32) Mask8x32 {
158 ones := x.Equal(x).AsInt8x32()
159 return x.Equal(y).AsInt8x32().Xor(ones).asMask()
160 }
161
162
163
164
165 func (x Int16x16) Less(y Int16x16) Mask16x16 {
166 return y.Greater(x)
167 }
168
169
170
171
172 func (x Int16x16) GreaterEqual(y Int16x16) Mask16x16 {
173 ones := x.Equal(x).AsInt16x16()
174 return y.Greater(x).AsInt16x16().Xor(ones).asMask()
175 }
176
177
178
179
180 func (x Int16x16) LessEqual(y Int16x16) Mask16x16 {
181 ones := x.Equal(x).AsInt16x16()
182 return x.Greater(y).AsInt16x16().Xor(ones).asMask()
183 }
184
185
186
187
188 func (x Int16x16) NotEqual(y Int16x16) Mask16x16 {
189 ones := x.Equal(x).AsInt16x16()
190 return x.Equal(y).AsInt16x16().Xor(ones).asMask()
191 }
192
193
194
195
196 func (x Int32x8) Less(y Int32x8) Mask32x8 {
197 return y.Greater(x)
198 }
199
200
201
202
203 func (x Int32x8) GreaterEqual(y Int32x8) Mask32x8 {
204 ones := x.Equal(x).AsInt32x8()
205 return y.Greater(x).AsInt32x8().Xor(ones).asMask()
206 }
207
208
209
210
211 func (x Int32x8) LessEqual(y Int32x8) Mask32x8 {
212 ones := x.Equal(x).AsInt32x8()
213 return x.Greater(y).AsInt32x8().Xor(ones).asMask()
214 }
215
216
217
218
219 func (x Int32x8) NotEqual(y Int32x8) Mask32x8 {
220 ones := x.Equal(x).AsInt32x8()
221 return x.Equal(y).AsInt32x8().Xor(ones).asMask()
222 }
223
224
225
226
227 func (x Int64x4) Less(y Int64x4) Mask64x4 {
228 return y.Greater(x)
229 }
230
231
232
233
234 func (x Int64x4) GreaterEqual(y Int64x4) Mask64x4 {
235 ones := x.Equal(x).AsInt64x4()
236 return y.Greater(x).AsInt64x4().Xor(ones).asMask()
237 }
238
239
240
241
242 func (x Int64x4) LessEqual(y Int64x4) Mask64x4 {
243 ones := x.Equal(x).AsInt64x4()
244 return x.Greater(y).AsInt64x4().Xor(ones).asMask()
245 }
246
247
248
249
250 func (x Int64x4) NotEqual(y Int64x4) Mask64x4 {
251 ones := x.Equal(x).AsInt64x4()
252 return x.Equal(y).AsInt64x4().Xor(ones).asMask()
253 }
254
255
256
257
258 func (x Uint8x16) Greater(y Uint8x16) Mask8x16 {
259 a, b := x.AsInt8x16(), y.AsInt8x16()
260 signs := BroadcastInt8x16(-1 << (8 - 1))
261 return a.Xor(signs).Greater(b.Xor(signs))
262 }
263
264
265
266
267 func (x Uint8x16) Less(y Uint8x16) Mask8x16 {
268 a, b := x.AsInt8x16(), y.AsInt8x16()
269 signs := BroadcastInt8x16(-1 << (8 - 1))
270 return b.Xor(signs).Greater(a.Xor(signs))
271 }
272
273
274
275
276 func (x Uint8x16) GreaterEqual(y Uint8x16) Mask8x16 {
277 a, b := x.AsInt8x16(), y.AsInt8x16()
278 ones := x.Equal(x).AsInt8x16()
279 signs := BroadcastInt8x16(-1 << (8 - 1))
280 return b.Xor(signs).Greater(a.Xor(signs)).AsInt8x16().Xor(ones).asMask()
281 }
282
283
284
285
286 func (x Uint8x16) LessEqual(y Uint8x16) Mask8x16 {
287 a, b := x.AsInt8x16(), y.AsInt8x16()
288 ones := x.Equal(x).AsInt8x16()
289 signs := BroadcastInt8x16(-1 << (8 - 1))
290 return a.Xor(signs).Greater(b.Xor(signs)).AsInt8x16().Xor(ones).asMask()
291 }
292
293
294
295
296 func (x Uint8x16) NotEqual(y Uint8x16) Mask8x16 {
297 a, b := x.AsInt8x16(), y.AsInt8x16()
298 ones := x.Equal(x).AsInt8x16()
299 return a.Equal(b).AsInt8x16().Xor(ones).asMask()
300 }
301
302
303
304
305 func (x Uint16x8) Greater(y Uint16x8) Mask16x8 {
306 a, b := x.AsInt16x8(), y.AsInt16x8()
307 ones := x.Equal(x).AsInt16x8()
308 signs := ones.ShiftAllLeft(16 - 1)
309 return a.Xor(signs).Greater(b.Xor(signs))
310 }
311
312
313
314
315 func (x Uint16x8) Less(y Uint16x8) Mask16x8 {
316 a, b := x.AsInt16x8(), y.AsInt16x8()
317 ones := x.Equal(x).AsInt16x8()
318 signs := ones.ShiftAllLeft(16 - 1)
319 return b.Xor(signs).Greater(a.Xor(signs))
320 }
321
322
323
324
325 func (x Uint16x8) GreaterEqual(y Uint16x8) Mask16x8 {
326 a, b := x.AsInt16x8(), y.AsInt16x8()
327 ones := x.Equal(x).AsInt16x8()
328 signs := ones.ShiftAllLeft(16 - 1)
329 return b.Xor(signs).Greater(a.Xor(signs)).AsInt16x8().Xor(ones).asMask()
330 }
331
332
333
334
335 func (x Uint16x8) LessEqual(y Uint16x8) Mask16x8 {
336 a, b := x.AsInt16x8(), y.AsInt16x8()
337 ones := x.Equal(x).AsInt16x8()
338 signs := ones.ShiftAllLeft(16 - 1)
339 return a.Xor(signs).Greater(b.Xor(signs)).AsInt16x8().Xor(ones).asMask()
340 }
341
342
343
344
345 func (x Uint16x8) NotEqual(y Uint16x8) Mask16x8 {
346 a, b := x.AsInt16x8(), y.AsInt16x8()
347 ones := x.Equal(x).AsInt16x8()
348 return a.Equal(b).AsInt16x8().Xor(ones).asMask()
349 }
350
351
352
353
354 func (x Uint32x4) Greater(y Uint32x4) Mask32x4 {
355 a, b := x.AsInt32x4(), y.AsInt32x4()
356 ones := x.Equal(x).AsInt32x4()
357 signs := ones.ShiftAllLeft(32 - 1)
358 return a.Xor(signs).Greater(b.Xor(signs))
359 }
360
361
362
363
364 func (x Uint32x4) Less(y Uint32x4) Mask32x4 {
365 a, b := x.AsInt32x4(), y.AsInt32x4()
366 ones := x.Equal(x).AsInt32x4()
367 signs := ones.ShiftAllLeft(32 - 1)
368 return b.Xor(signs).Greater(a.Xor(signs))
369 }
370
371
372
373
374 func (x Uint32x4) GreaterEqual(y Uint32x4) Mask32x4 {
375 a, b := x.AsInt32x4(), y.AsInt32x4()
376 ones := x.Equal(x).AsInt32x4()
377 signs := ones.ShiftAllLeft(32 - 1)
378 return b.Xor(signs).Greater(a.Xor(signs)).AsInt32x4().Xor(ones).asMask()
379 }
380
381
382
383
384 func (x Uint32x4) LessEqual(y Uint32x4) Mask32x4 {
385 a, b := x.AsInt32x4(), y.AsInt32x4()
386 ones := x.Equal(x).AsInt32x4()
387 signs := ones.ShiftAllLeft(32 - 1)
388 return a.Xor(signs).Greater(b.Xor(signs)).AsInt32x4().Xor(ones).asMask()
389 }
390
391
392
393
394 func (x Uint32x4) NotEqual(y Uint32x4) Mask32x4 {
395 a, b := x.AsInt32x4(), y.AsInt32x4()
396 ones := x.Equal(x).AsInt32x4()
397 return a.Equal(b).AsInt32x4().Xor(ones).asMask()
398 }
399
400
401
402
403 func (x Uint64x2) Greater(y Uint64x2) Mask64x2 {
404 a, b := x.AsInt64x2(), y.AsInt64x2()
405 ones := x.Equal(x).AsInt64x2()
406 signs := ones.ShiftAllLeft(64 - 1)
407 return a.Xor(signs).Greater(b.Xor(signs))
408 }
409
410
411
412
413 func (x Uint64x2) Less(y Uint64x2) Mask64x2 {
414 a, b := x.AsInt64x2(), y.AsInt64x2()
415 ones := x.Equal(x).AsInt64x2()
416 signs := ones.ShiftAllLeft(64 - 1)
417 return b.Xor(signs).Greater(a.Xor(signs))
418 }
419
420
421
422
423 func (x Uint64x2) GreaterEqual(y Uint64x2) Mask64x2 {
424 a, b := x.AsInt64x2(), y.AsInt64x2()
425 ones := x.Equal(x).AsInt64x2()
426 signs := ones.ShiftAllLeft(64 - 1)
427 return b.Xor(signs).Greater(a.Xor(signs)).AsInt64x2().Xor(ones).asMask()
428 }
429
430
431
432
433 func (x Uint64x2) LessEqual(y Uint64x2) Mask64x2 {
434 a, b := x.AsInt64x2(), y.AsInt64x2()
435 ones := x.Equal(x).AsInt64x2()
436 signs := ones.ShiftAllLeft(64 - 1)
437 return a.Xor(signs).Greater(b.Xor(signs)).AsInt64x2().Xor(ones).asMask()
438 }
439
440
441
442
443 func (x Uint64x2) NotEqual(y Uint64x2) Mask64x2 {
444 a, b := x.AsInt64x2(), y.AsInt64x2()
445 ones := x.Equal(x).AsInt64x2()
446 return a.Equal(b).AsInt64x2().Xor(ones).asMask()
447 }
448
449
450
451
452 func (x Uint8x32) Greater(y Uint8x32) Mask8x32 {
453 a, b := x.AsInt8x32(), y.AsInt8x32()
454 signs := BroadcastInt8x32(-1 << (8 - 1))
455 return a.Xor(signs).Greater(b.Xor(signs))
456 }
457
458
459
460
461 func (x Uint8x32) Less(y Uint8x32) Mask8x32 {
462 a, b := x.AsInt8x32(), y.AsInt8x32()
463 signs := BroadcastInt8x32(-1 << (8 - 1))
464 return b.Xor(signs).Greater(a.Xor(signs))
465 }
466
467
468
469
470 func (x Uint8x32) GreaterEqual(y Uint8x32) Mask8x32 {
471 a, b := x.AsInt8x32(), y.AsInt8x32()
472 ones := x.Equal(x).AsInt8x32()
473 signs := BroadcastInt8x32(-1 << (8 - 1))
474 return b.Xor(signs).Greater(a.Xor(signs)).AsInt8x32().Xor(ones).asMask()
475 }
476
477
478
479
480 func (x Uint8x32) LessEqual(y Uint8x32) Mask8x32 {
481 a, b := x.AsInt8x32(), y.AsInt8x32()
482 ones := x.Equal(x).AsInt8x32()
483 signs := BroadcastInt8x32(-1 << (8 - 1))
484 return a.Xor(signs).Greater(b.Xor(signs)).AsInt8x32().Xor(ones).asMask()
485 }
486
487
488
489
490 func (x Uint8x32) NotEqual(y Uint8x32) Mask8x32 {
491 a, b := x.AsInt8x32(), y.AsInt8x32()
492 ones := x.Equal(x).AsInt8x32()
493 return a.Equal(b).AsInt8x32().Xor(ones).asMask()
494 }
495
496
497
498
499 func (x Uint16x16) Greater(y Uint16x16) Mask16x16 {
500 a, b := x.AsInt16x16(), y.AsInt16x16()
501 ones := x.Equal(x).AsInt16x16()
502 signs := ones.ShiftAllLeft(16 - 1)
503 return a.Xor(signs).Greater(b.Xor(signs))
504 }
505
506
507
508
509 func (x Uint16x16) Less(y Uint16x16) Mask16x16 {
510 a, b := x.AsInt16x16(), y.AsInt16x16()
511 ones := x.Equal(x).AsInt16x16()
512 signs := ones.ShiftAllLeft(16 - 1)
513 return b.Xor(signs).Greater(a.Xor(signs))
514 }
515
516
517
518
519 func (x Uint16x16) GreaterEqual(y Uint16x16) Mask16x16 {
520 a, b := x.AsInt16x16(), y.AsInt16x16()
521 ones := x.Equal(x).AsInt16x16()
522 signs := ones.ShiftAllLeft(16 - 1)
523 return b.Xor(signs).Greater(a.Xor(signs)).AsInt16x16().Xor(ones).asMask()
524 }
525
526
527
528
529 func (x Uint16x16) LessEqual(y Uint16x16) Mask16x16 {
530 a, b := x.AsInt16x16(), y.AsInt16x16()
531 ones := x.Equal(x).AsInt16x16()
532 signs := ones.ShiftAllLeft(16 - 1)
533 return a.Xor(signs).Greater(b.Xor(signs)).AsInt16x16().Xor(ones).asMask()
534 }
535
536
537
538
539 func (x Uint16x16) NotEqual(y Uint16x16) Mask16x16 {
540 a, b := x.AsInt16x16(), y.AsInt16x16()
541 ones := x.Equal(x).AsInt16x16()
542 return a.Equal(b).AsInt16x16().Xor(ones).asMask()
543 }
544
545
546
547
548 func (x Uint32x8) Greater(y Uint32x8) Mask32x8 {
549 a, b := x.AsInt32x8(), y.AsInt32x8()
550 ones := x.Equal(x).AsInt32x8()
551 signs := ones.ShiftAllLeft(32 - 1)
552 return a.Xor(signs).Greater(b.Xor(signs))
553 }
554
555
556
557
558 func (x Uint32x8) Less(y Uint32x8) Mask32x8 {
559 a, b := x.AsInt32x8(), y.AsInt32x8()
560 ones := x.Equal(x).AsInt32x8()
561 signs := ones.ShiftAllLeft(32 - 1)
562 return b.Xor(signs).Greater(a.Xor(signs))
563 }
564
565
566
567
568 func (x Uint32x8) GreaterEqual(y Uint32x8) Mask32x8 {
569 a, b := x.AsInt32x8(), y.AsInt32x8()
570 ones := x.Equal(x).AsInt32x8()
571 signs := ones.ShiftAllLeft(32 - 1)
572 return b.Xor(signs).Greater(a.Xor(signs)).AsInt32x8().Xor(ones).asMask()
573 }
574
575
576
577
578 func (x Uint32x8) LessEqual(y Uint32x8) Mask32x8 {
579 a, b := x.AsInt32x8(), y.AsInt32x8()
580 ones := x.Equal(x).AsInt32x8()
581 signs := ones.ShiftAllLeft(32 - 1)
582 return a.Xor(signs).Greater(b.Xor(signs)).AsInt32x8().Xor(ones).asMask()
583 }
584
585
586
587
588 func (x Uint32x8) NotEqual(y Uint32x8) Mask32x8 {
589 a, b := x.AsInt32x8(), y.AsInt32x8()
590 ones := x.Equal(x).AsInt32x8()
591 return a.Equal(b).AsInt32x8().Xor(ones).asMask()
592 }
593
594
595
596
597 func (x Uint64x4) Greater(y Uint64x4) Mask64x4 {
598 a, b := x.AsInt64x4(), y.AsInt64x4()
599 ones := x.Equal(x).AsInt64x4()
600 signs := ones.ShiftAllLeft(64 - 1)
601 return a.Xor(signs).Greater(b.Xor(signs))
602 }
603
604
605
606
607 func (x Uint64x4) Less(y Uint64x4) Mask64x4 {
608 a, b := x.AsInt64x4(), y.AsInt64x4()
609 ones := x.Equal(x).AsInt64x4()
610 signs := ones.ShiftAllLeft(64 - 1)
611 return b.Xor(signs).Greater(a.Xor(signs))
612 }
613
614
615
616
617 func (x Uint64x4) GreaterEqual(y Uint64x4) Mask64x4 {
618 a, b := x.AsInt64x4(), y.AsInt64x4()
619 ones := x.Equal(x).AsInt64x4()
620 signs := ones.ShiftAllLeft(64 - 1)
621 return b.Xor(signs).Greater(a.Xor(signs)).AsInt64x4().Xor(ones).asMask()
622 }
623
624
625
626
627 func (x Uint64x4) LessEqual(y Uint64x4) Mask64x4 {
628 a, b := x.AsInt64x4(), y.AsInt64x4()
629 ones := x.Equal(x).AsInt64x4()
630 signs := ones.ShiftAllLeft(64 - 1)
631 return a.Xor(signs).Greater(b.Xor(signs)).AsInt64x4().Xor(ones).asMask()
632 }
633
634
635
636
637 func (x Uint64x4) NotEqual(y Uint64x4) Mask64x4 {
638 a, b := x.AsInt64x4(), y.AsInt64x4()
639 ones := x.Equal(x).AsInt64x4()
640 return a.Equal(b).AsInt64x4().Xor(ones).asMask()
641 }
642
View as plain text