-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
simd_avx.s
801 lines (737 loc) · 31.6 KB
/
simd_avx.s
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
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
//go:build !noasm && amd64
// AUTO-GENERATED BY GOCC -- DO NOT EDIT
TEXT ·_and(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ n+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
LONG $0xf8e48348 // and rsp, -8
WORD $0x8548; BYTE $0xd2 // test rdx, rdx
JE LBB0_10
LONG $0x04fa8348 // cmp rdx, 4
JAE LBB0_3
WORD $0xc031 // xor eax, eax
JMP LBB0_9
LBB0_3:
LONG $0xd6048d48 // lea rax, [rsi + 8*rdx]
WORD $0x3948; BYTE $0xf8 // cmp rax, rdi
JBE LBB0_6
LONG $0xd7048d48 // lea rax, [rdi + 8*rdx]
WORD $0x3948; BYTE $0xf0 // cmp rax, rsi
JBE LBB0_6
WORD $0xc031 // xor eax, eax
JMP LBB0_9
LBB0_6:
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0xfce08348 // and rax, -4
WORD $0xc931 // xor ecx, ecx
LBB0_7:
LONG $0x0410fcc5; BYTE $0xcf // vmovups ymm0, ymmword ptr [rdi + 8*rcx]
LONG $0x0454fcc5; BYTE $0xce // vandps ymm0, ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0411fcc5; BYTE $0xcf // vmovups ymmword ptr [rdi + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3948; BYTE $0xc8 // cmp rax, rcx
JNE LBB0_7
WORD $0x3948; BYTE $0xd0 // cmp rax, rdx
JE LBB0_10
LBB0_9:
LONG $0xc60c8b48 // mov rcx, qword ptr [rsi + 8*rax]
LONG $0xc70c2148 // and qword ptr [rdi + 8*rax], rcx
WORD $0xff48; BYTE $0xc0 // inc rax
WORD $0x3948; BYTE $0xc2 // cmp rdx, rax
JNE LBB0_9
LBB0_10:
WORD $0x8948; BYTE $0xec // mov rsp, rbp
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_andn(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ n+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
LONG $0xf8e48348 // and rsp, -8
WORD $0x8548; BYTE $0xd2 // test rdx, rdx
JE LBB1_10
LONG $0x04fa8348 // cmp rdx, 4
JAE LBB1_3
WORD $0xc031 // xor eax, eax
JMP LBB1_9
LBB1_3:
LONG $0xd6048d48 // lea rax, [rsi + 8*rdx]
WORD $0x3948; BYTE $0xf8 // cmp rax, rdi
JBE LBB1_6
LONG $0xd7048d48 // lea rax, [rdi + 8*rdx]
WORD $0x3948; BYTE $0xf0 // cmp rax, rsi
JBE LBB1_6
WORD $0xc031 // xor eax, eax
JMP LBB1_9
LBB1_6:
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0xfce08348 // and rax, -4
WORD $0xc931 // xor ecx, ecx
LBB1_7:
LONG $0x0410fcc5; BYTE $0xce // vmovups ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0455fcc5; BYTE $0xcf // vandnps ymm0, ymm0, ymmword ptr [rdi + 8*rcx]
LONG $0x0411fcc5; BYTE $0xcf // vmovups ymmword ptr [rdi + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3948; BYTE $0xc8 // cmp rax, rcx
JNE LBB1_7
WORD $0x3948; BYTE $0xd0 // cmp rax, rdx
JE LBB1_10
LBB1_9:
LONG $0xc60c8b48 // mov rcx, qword ptr [rsi + 8*rax]
WORD $0xf748; BYTE $0xd1 // not rcx
LONG $0xc70c2148 // and qword ptr [rdi + 8*rax], rcx
WORD $0xff48; BYTE $0xc0 // inc rax
WORD $0x3948; BYTE $0xc2 // cmp rdx, rax
JNE LBB1_9
LBB1_10:
WORD $0x8948; BYTE $0xec // mov rsp, rbp
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_or(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ n+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
LONG $0xf8e48348 // and rsp, -8
WORD $0x8548; BYTE $0xd2 // test rdx, rdx
JE LBB2_10
LONG $0x04fa8348 // cmp rdx, 4
JAE LBB2_3
WORD $0xc031 // xor eax, eax
JMP LBB2_9
LBB2_3:
LONG $0xd6048d48 // lea rax, [rsi + 8*rdx]
WORD $0x3948; BYTE $0xf8 // cmp rax, rdi
JBE LBB2_6
LONG $0xd7048d48 // lea rax, [rdi + 8*rdx]
WORD $0x3948; BYTE $0xf0 // cmp rax, rsi
JBE LBB2_6
WORD $0xc031 // xor eax, eax
JMP LBB2_9
LBB2_6:
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0xfce08348 // and rax, -4
WORD $0xc931 // xor ecx, ecx
LBB2_7:
LONG $0x0410fcc5; BYTE $0xcf // vmovups ymm0, ymmword ptr [rdi + 8*rcx]
LONG $0x0456fcc5; BYTE $0xce // vorps ymm0, ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0411fcc5; BYTE $0xcf // vmovups ymmword ptr [rdi + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3948; BYTE $0xc8 // cmp rax, rcx
JNE LBB2_7
WORD $0x3948; BYTE $0xd0 // cmp rax, rdx
JE LBB2_10
LBB2_9:
LONG $0xc60c8b48 // mov rcx, qword ptr [rsi + 8*rax]
LONG $0xc70c0948 // or qword ptr [rdi + 8*rax], rcx
WORD $0xff48; BYTE $0xc0 // inc rax
WORD $0x3948; BYTE $0xc2 // cmp rdx, rax
JNE LBB2_9
LBB2_10:
WORD $0x8948; BYTE $0xec // mov rsp, rbp
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_xor(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ n+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
LONG $0xf8e48348 // and rsp, -8
WORD $0x8548; BYTE $0xd2 // test rdx, rdx
JE LBB3_10
LONG $0x04fa8348 // cmp rdx, 4
JAE LBB3_3
WORD $0xc031 // xor eax, eax
JMP LBB3_9
LBB3_3:
LONG $0xd6048d48 // lea rax, [rsi + 8*rdx]
WORD $0x3948; BYTE $0xf8 // cmp rax, rdi
JBE LBB3_6
LONG $0xd7048d48 // lea rax, [rdi + 8*rdx]
WORD $0x3948; BYTE $0xf0 // cmp rax, rsi
JBE LBB3_6
WORD $0xc031 // xor eax, eax
JMP LBB3_9
LBB3_6:
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0xfce08348 // and rax, -4
WORD $0xc931 // xor ecx, ecx
LBB3_7:
LONG $0x0410fcc5; BYTE $0xcf // vmovups ymm0, ymmword ptr [rdi + 8*rcx]
LONG $0x0457fcc5; BYTE $0xce // vxorps ymm0, ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0411fcc5; BYTE $0xcf // vmovups ymmword ptr [rdi + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3948; BYTE $0xc8 // cmp rax, rcx
JNE LBB3_7
WORD $0x3948; BYTE $0xd0 // cmp rax, rdx
JE LBB3_10
LBB3_9:
LONG $0xc60c8b48 // mov rcx, qword ptr [rsi + 8*rax]
LONG $0xc70c3148 // xor qword ptr [rdi + 8*rax], rcx
WORD $0xff48; BYTE $0xc0 // inc rax
WORD $0x3948; BYTE $0xc2 // cmp rdx, rax
JNE LBB3_9
LBB3_10:
WORD $0x8948; BYTE $0xec // mov rsp, rbp
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_and_many(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ dims+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
WORD $0x5741 // push r15
WORD $0x5641 // push r14
WORD $0x5541 // push r13
WORD $0x5441 // push r12
BYTE $0x53 // push rbx
LONG $0xf8e48348 // and rsp, -8
LONG $0x68ec8348 // sub rsp, 104
LONG $0xffffffbb; BYTE $0xff // mov ebx, 4294967295
WORD $0x2148; BYTE $0xd3 // and rbx, rdx
JE LBB4_14
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0x20e8c148 // shr rax, 32
LONG $0x02f88348 // cmp rax, 2
LONG $0x0001bc41; WORD $0x0000 // mov r12d, 1
LONG $0x24448948; BYTE $0x28 // mov qword ptr [rsp + 40], rax
LONG $0xe0430f4c // cmovae r12, rax
LONG $0x000200b9; BYTE $0x00 // mov ecx, 512
WORD $0xc031 // xor eax, eax
LONG $0x24448948; BYTE $0x18 // mov qword ptr [rsp + 24], rax
WORD $0x8948; BYTE $0xf8 // mov rax, rdi
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x10 // mov qword ptr [rsp + 16], rdx
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x08 // mov qword ptr [rsp + 8], rdx
WORD $0x3145; BYTE $0xc9 // xor r9d, r9d
LONG $0x245c8948; BYTE $0x20 // mov qword ptr [rsp + 32], rbx
JMP LBB4_3
LBB4_2:
LONG $0x2444ff48; BYTE $0x08 // inc qword ptr [rsp + 8]
LONG $0x244c8b48; BYTE $0x38 // mov rcx, qword ptr [rsp + 56]
LONG $0x00c18148; WORD $0x0002; BYTE $0x00 // add rcx, 512
QUAD $0xfffe001024448148; BYTE $0xff // add qword ptr [rsp + 16], -512
QUAD $0x0010001824448148; BYTE $0x00 // add qword ptr [rsp + 24], 4096
LONG $0x10000548; WORD $0x0000 // add rax, 4096
LONG $0x245c8b48; BYTE $0x20 // mov rbx, qword ptr [rsp + 32]
LONG $0x244c8b4c; BYTE $0x30 // mov r9, qword ptr [rsp + 48]
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB4_14
LBB4_3:
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
WORD $0x8949; BYTE $0xda // mov r10, rbx
LONG $0x244c8948; BYTE $0x38 // mov qword ptr [rsp + 56], rcx
LONG $0xd1420f4c // cmovb r10, rcx
LONG $0x00898d49; WORD $0x0002; BYTE $0x00 // lea rcx, [r9 + 512]
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
LONG $0x244c8948; BYTE $0x30 // mov qword ptr [rsp + 48], rcx
LONG $0xd9420f48 // cmovb rbx, rcx
LONG $0x247c8348; WORD $0x0028 // cmp qword ptr [rsp + 40], 0
JE LBB4_2
LONG $0x2454034c; BYTE $0x10 // add r10, qword ptr [rsp + 16]
LONG $0xfce28349 // and r10, -4
LONG $0x247c8b4c; BYTE $0x08 // mov r15, qword ptr [rsp + 8]
WORD $0x894c; BYTE $0xf9 // mov rcx, r15
LONG $0x09e1c148 // shl rcx, 9
WORD $0x8949; BYTE $0xd8 // mov r8, rbx
WORD $0x2949; BYTE $0xc8 // sub r8, rcx
LONG $0x0ce7c149 // shl r15, 12
LONG $0x3f1c8d4e // lea r11, [rdi + r15]
LONG $0x247c894c; BYTE $0x60 // mov qword ptr [rsp + 96], r15
LONG $0xc73c8d4f // lea r15, [r15 + 8*r8]
LONG $0x3f0c8d49 // lea rcx, [r15 + rdi]
LONG $0x244c8948; BYTE $0x58 // mov qword ptr [rsp + 88], rcx
WORD $0x894c; BYTE $0xc1 // mov rcx, r8
LONG $0xfce18348 // and rcx, -4
LONG $0x244c8948; BYTE $0x48 // mov qword ptr [rsp + 72], rcx
WORD $0x014c; BYTE $0xc9 // add rcx, r9
LONG $0x244c8948; BYTE $0x40 // mov qword ptr [rsp + 64], rcx
WORD $0x3145; BYTE $0xf6 // xor r14d, r14d
LONG $0x247c894c; BYTE $0x50 // mov qword ptr [rsp + 80], r15
JMP LBB4_5
LBB4_12:
WORD $0xff49; BYTE $0xc6 // inc r14
WORD $0x394d; BYTE $0xe6 // cmp r14, r12
JE LBB4_2
LBB4_5:
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB4_12
LONG $0xf6148b4a // mov rdx, qword ptr [rsi + 8*r14]
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x04f88349 // cmp r8, 4
JB LBB4_13
LONG $0x3a0c8d4a // lea rcx, [rdx + r15]
WORD $0x3949; BYTE $0xcb // cmp r11, rcx
JAE LBB4_9
LONG $0x244c8b48; BYTE $0x60 // mov rcx, qword ptr [rsp + 96]
WORD $0x0148; BYTE $0xd1 // add rcx, rdx
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x244c3b48; BYTE $0x58 // cmp rcx, qword ptr [rsp + 88]
JB LBB4_13
LBB4_9:
WORD $0x894d; BYTE $0xdf // mov r15, r11
WORD $0x8949; BYTE $0xf3 // mov r11, rsi
LONG $0x244c8b48; BYTE $0x18 // mov rcx, qword ptr [rsp + 24]
LONG $0x0a348d48 // lea rsi, [rdx + rcx]
WORD $0xc931 // xor ecx, ecx
LBB4_10:
LONG $0x0410fcc5; BYTE $0xc8 // vmovups ymm0, ymmword ptr [rax + 8*rcx]
LONG $0x0454fcc5; BYTE $0xce // vandps ymm0, ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0411fcc5; BYTE $0xc8 // vmovups ymmword ptr [rax + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3949; BYTE $0xca // cmp r10, rcx
JNE LBB4_10
LONG $0x246c8b4c; BYTE $0x40 // mov r13, qword ptr [rsp + 64]
LONG $0x24443b4c; BYTE $0x48 // cmp r8, qword ptr [rsp + 72]
WORD $0x894c; BYTE $0xde // mov rsi, r11
WORD $0x894d; BYTE $0xfb // mov r11, r15
LONG $0x247c8b4c; BYTE $0x50 // mov r15, qword ptr [rsp + 80]
JE LBB4_12
LBB4_13:
LONG $0xea0c8b4a // mov rcx, qword ptr [rdx + 8*r13]
LONG $0xef0c214a // and qword ptr [rdi + 8*r13], rcx
WORD $0xff49; BYTE $0xc5 // inc r13
WORD $0x3949; BYTE $0xdd // cmp r13, rbx
JB LBB4_13
JMP LBB4_12
LBB4_14:
LONG $0xd8658d48 // lea rsp, [rbp - 40]
BYTE $0x5b // pop rbx
WORD $0x5c41 // pop r12
WORD $0x5d41 // pop r13
WORD $0x5e41 // pop r14
WORD $0x5f41 // pop r15
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_andn_many(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ dims+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
WORD $0x5741 // push r15
WORD $0x5641 // push r14
WORD $0x5541 // push r13
WORD $0x5441 // push r12
BYTE $0x53 // push rbx
LONG $0xf8e48348 // and rsp, -8
LONG $0x68ec8348 // sub rsp, 104
LONG $0xffffffbb; BYTE $0xff // mov ebx, 4294967295
WORD $0x2148; BYTE $0xd3 // and rbx, rdx
JE LBB5_14
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0x20e8c148 // shr rax, 32
LONG $0x02f88348 // cmp rax, 2
LONG $0x0001bc41; WORD $0x0000 // mov r12d, 1
LONG $0x24448948; BYTE $0x28 // mov qword ptr [rsp + 40], rax
LONG $0xe0430f4c // cmovae r12, rax
LONG $0x000200b9; BYTE $0x00 // mov ecx, 512
WORD $0xc031 // xor eax, eax
LONG $0x24448948; BYTE $0x18 // mov qword ptr [rsp + 24], rax
WORD $0x8948; BYTE $0xf8 // mov rax, rdi
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x10 // mov qword ptr [rsp + 16], rdx
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x08 // mov qword ptr [rsp + 8], rdx
WORD $0x3145; BYTE $0xc9 // xor r9d, r9d
LONG $0x245c8948; BYTE $0x20 // mov qword ptr [rsp + 32], rbx
JMP LBB5_3
LBB5_2:
LONG $0x2444ff48; BYTE $0x08 // inc qword ptr [rsp + 8]
LONG $0x244c8b48; BYTE $0x38 // mov rcx, qword ptr [rsp + 56]
LONG $0x00c18148; WORD $0x0002; BYTE $0x00 // add rcx, 512
QUAD $0xfffe001024448148; BYTE $0xff // add qword ptr [rsp + 16], -512
QUAD $0x0010001824448148; BYTE $0x00 // add qword ptr [rsp + 24], 4096
LONG $0x10000548; WORD $0x0000 // add rax, 4096
LONG $0x245c8b48; BYTE $0x20 // mov rbx, qword ptr [rsp + 32]
LONG $0x244c8b4c; BYTE $0x30 // mov r9, qword ptr [rsp + 48]
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB5_14
LBB5_3:
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
WORD $0x8949; BYTE $0xdb // mov r11, rbx
LONG $0x244c8948; BYTE $0x38 // mov qword ptr [rsp + 56], rcx
LONG $0xd9420f4c // cmovb r11, rcx
LONG $0x00898d49; WORD $0x0002; BYTE $0x00 // lea rcx, [r9 + 512]
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
LONG $0x244c8948; BYTE $0x30 // mov qword ptr [rsp + 48], rcx
LONG $0xd9420f48 // cmovb rbx, rcx
LONG $0x247c8348; WORD $0x0028 // cmp qword ptr [rsp + 40], 0
JE LBB5_2
LONG $0x245c034c; BYTE $0x10 // add r11, qword ptr [rsp + 16]
LONG $0xfce38349 // and r11, -4
LONG $0x247c8b4c; BYTE $0x08 // mov r15, qword ptr [rsp + 8]
WORD $0x894c; BYTE $0xf9 // mov rcx, r15
LONG $0x09e1c148 // shl rcx, 9
WORD $0x8949; BYTE $0xd8 // mov r8, rbx
WORD $0x2949; BYTE $0xc8 // sub r8, rcx
LONG $0x0ce7c149 // shl r15, 12
LONG $0x3f148d4e // lea r10, [rdi + r15]
LONG $0x247c894c; BYTE $0x60 // mov qword ptr [rsp + 96], r15
LONG $0xc73c8d4f // lea r15, [r15 + 8*r8]
LONG $0x3f0c8d49 // lea rcx, [r15 + rdi]
LONG $0x244c8948; BYTE $0x58 // mov qword ptr [rsp + 88], rcx
WORD $0x894c; BYTE $0xc1 // mov rcx, r8
LONG $0xfce18348 // and rcx, -4
LONG $0x244c8948; BYTE $0x48 // mov qword ptr [rsp + 72], rcx
WORD $0x014c; BYTE $0xc9 // add rcx, r9
LONG $0x244c8948; BYTE $0x40 // mov qword ptr [rsp + 64], rcx
WORD $0x3145; BYTE $0xf6 // xor r14d, r14d
LONG $0x247c894c; BYTE $0x50 // mov qword ptr [rsp + 80], r15
JMP LBB5_5
LBB5_12:
WORD $0xff49; BYTE $0xc6 // inc r14
WORD $0x394d; BYTE $0xe6 // cmp r14, r12
JE LBB5_2
LBB5_5:
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB5_12
LONG $0xf6148b4a // mov rdx, qword ptr [rsi + 8*r14]
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x04f88349 // cmp r8, 4
JB LBB5_13
LONG $0x3a0c8d4a // lea rcx, [rdx + r15]
WORD $0x3949; BYTE $0xca // cmp r10, rcx
JAE LBB5_9
LONG $0x244c8b48; BYTE $0x60 // mov rcx, qword ptr [rsp + 96]
WORD $0x0148; BYTE $0xd1 // add rcx, rdx
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x244c3b48; BYTE $0x58 // cmp rcx, qword ptr [rsp + 88]
JB LBB5_13
LBB5_9:
WORD $0x894d; BYTE $0xd7 // mov r15, r10
WORD $0x8949; BYTE $0xf2 // mov r10, rsi
LONG $0x244c8b48; BYTE $0x18 // mov rcx, qword ptr [rsp + 24]
LONG $0x0a348d48 // lea rsi, [rdx + rcx]
WORD $0xc931 // xor ecx, ecx
LBB5_10:
LONG $0x0410fcc5; BYTE $0xce // vmovups ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0455fcc5; BYTE $0xc8 // vandnps ymm0, ymm0, ymmword ptr [rax + 8*rcx]
LONG $0x0411fcc5; BYTE $0xc8 // vmovups ymmword ptr [rax + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3949; BYTE $0xcb // cmp r11, rcx
JNE LBB5_10
LONG $0x246c8b4c; BYTE $0x40 // mov r13, qword ptr [rsp + 64]
LONG $0x24443b4c; BYTE $0x48 // cmp r8, qword ptr [rsp + 72]
WORD $0x894c; BYTE $0xd6 // mov rsi, r10
WORD $0x894d; BYTE $0xfa // mov r10, r15
LONG $0x247c8b4c; BYTE $0x50 // mov r15, qword ptr [rsp + 80]
JE LBB5_12
LBB5_13:
LONG $0xea0c8b4a // mov rcx, qword ptr [rdx + 8*r13]
WORD $0xf748; BYTE $0xd1 // not rcx
LONG $0xef0c214a // and qword ptr [rdi + 8*r13], rcx
WORD $0xff49; BYTE $0xc5 // inc r13
WORD $0x3949; BYTE $0xdd // cmp r13, rbx
JB LBB5_13
JMP LBB5_12
LBB5_14:
LONG $0xd8658d48 // lea rsp, [rbp - 40]
BYTE $0x5b // pop rbx
WORD $0x5c41 // pop r12
WORD $0x5d41 // pop r13
WORD $0x5e41 // pop r14
WORD $0x5f41 // pop r15
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_or_many(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ dims+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
WORD $0x5741 // push r15
WORD $0x5641 // push r14
WORD $0x5541 // push r13
WORD $0x5441 // push r12
BYTE $0x53 // push rbx
LONG $0xf8e48348 // and rsp, -8
LONG $0x68ec8348 // sub rsp, 104
LONG $0xffffffbb; BYTE $0xff // mov ebx, 4294967295
WORD $0x2148; BYTE $0xd3 // and rbx, rdx
JE LBB6_14
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0x20e8c148 // shr rax, 32
LONG $0x02f88348 // cmp rax, 2
LONG $0x0001bc41; WORD $0x0000 // mov r12d, 1
LONG $0x24448948; BYTE $0x28 // mov qword ptr [rsp + 40], rax
LONG $0xe0430f4c // cmovae r12, rax
LONG $0x000200b9; BYTE $0x00 // mov ecx, 512
WORD $0xc031 // xor eax, eax
LONG $0x24448948; BYTE $0x18 // mov qword ptr [rsp + 24], rax
WORD $0x8948; BYTE $0xf8 // mov rax, rdi
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x10 // mov qword ptr [rsp + 16], rdx
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x08 // mov qword ptr [rsp + 8], rdx
WORD $0x3145; BYTE $0xc9 // xor r9d, r9d
LONG $0x245c8948; BYTE $0x20 // mov qword ptr [rsp + 32], rbx
JMP LBB6_3
LBB6_2:
LONG $0x2444ff48; BYTE $0x08 // inc qword ptr [rsp + 8]
LONG $0x244c8b48; BYTE $0x38 // mov rcx, qword ptr [rsp + 56]
LONG $0x00c18148; WORD $0x0002; BYTE $0x00 // add rcx, 512
QUAD $0xfffe001024448148; BYTE $0xff // add qword ptr [rsp + 16], -512
QUAD $0x0010001824448148; BYTE $0x00 // add qword ptr [rsp + 24], 4096
LONG $0x10000548; WORD $0x0000 // add rax, 4096
LONG $0x245c8b48; BYTE $0x20 // mov rbx, qword ptr [rsp + 32]
LONG $0x244c8b4c; BYTE $0x30 // mov r9, qword ptr [rsp + 48]
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB6_14
LBB6_3:
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
WORD $0x8949; BYTE $0xda // mov r10, rbx
LONG $0x244c8948; BYTE $0x38 // mov qword ptr [rsp + 56], rcx
LONG $0xd1420f4c // cmovb r10, rcx
LONG $0x00898d49; WORD $0x0002; BYTE $0x00 // lea rcx, [r9 + 512]
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
LONG $0x244c8948; BYTE $0x30 // mov qword ptr [rsp + 48], rcx
LONG $0xd9420f48 // cmovb rbx, rcx
LONG $0x247c8348; WORD $0x0028 // cmp qword ptr [rsp + 40], 0
JE LBB6_2
LONG $0x2454034c; BYTE $0x10 // add r10, qword ptr [rsp + 16]
LONG $0xfce28349 // and r10, -4
LONG $0x247c8b4c; BYTE $0x08 // mov r15, qword ptr [rsp + 8]
WORD $0x894c; BYTE $0xf9 // mov rcx, r15
LONG $0x09e1c148 // shl rcx, 9
WORD $0x8949; BYTE $0xd8 // mov r8, rbx
WORD $0x2949; BYTE $0xc8 // sub r8, rcx
LONG $0x0ce7c149 // shl r15, 12
LONG $0x3f1c8d4e // lea r11, [rdi + r15]
LONG $0x247c894c; BYTE $0x60 // mov qword ptr [rsp + 96], r15
LONG $0xc73c8d4f // lea r15, [r15 + 8*r8]
LONG $0x3f0c8d49 // lea rcx, [r15 + rdi]
LONG $0x244c8948; BYTE $0x58 // mov qword ptr [rsp + 88], rcx
WORD $0x894c; BYTE $0xc1 // mov rcx, r8
LONG $0xfce18348 // and rcx, -4
LONG $0x244c8948; BYTE $0x48 // mov qword ptr [rsp + 72], rcx
WORD $0x014c; BYTE $0xc9 // add rcx, r9
LONG $0x244c8948; BYTE $0x40 // mov qword ptr [rsp + 64], rcx
WORD $0x3145; BYTE $0xf6 // xor r14d, r14d
LONG $0x247c894c; BYTE $0x50 // mov qword ptr [rsp + 80], r15
JMP LBB6_5
LBB6_12:
WORD $0xff49; BYTE $0xc6 // inc r14
WORD $0x394d; BYTE $0xe6 // cmp r14, r12
JE LBB6_2
LBB6_5:
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB6_12
LONG $0xf6148b4a // mov rdx, qword ptr [rsi + 8*r14]
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x04f88349 // cmp r8, 4
JB LBB6_13
LONG $0x3a0c8d4a // lea rcx, [rdx + r15]
WORD $0x3949; BYTE $0xcb // cmp r11, rcx
JAE LBB6_9
LONG $0x244c8b48; BYTE $0x60 // mov rcx, qword ptr [rsp + 96]
WORD $0x0148; BYTE $0xd1 // add rcx, rdx
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x244c3b48; BYTE $0x58 // cmp rcx, qword ptr [rsp + 88]
JB LBB6_13
LBB6_9:
WORD $0x894d; BYTE $0xdf // mov r15, r11
WORD $0x8949; BYTE $0xf3 // mov r11, rsi
LONG $0x244c8b48; BYTE $0x18 // mov rcx, qword ptr [rsp + 24]
LONG $0x0a348d48 // lea rsi, [rdx + rcx]
WORD $0xc931 // xor ecx, ecx
LBB6_10:
LONG $0x0410fcc5; BYTE $0xc8 // vmovups ymm0, ymmword ptr [rax + 8*rcx]
LONG $0x0456fcc5; BYTE $0xce // vorps ymm0, ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0411fcc5; BYTE $0xc8 // vmovups ymmword ptr [rax + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3949; BYTE $0xca // cmp r10, rcx
JNE LBB6_10
LONG $0x246c8b4c; BYTE $0x40 // mov r13, qword ptr [rsp + 64]
LONG $0x24443b4c; BYTE $0x48 // cmp r8, qword ptr [rsp + 72]
WORD $0x894c; BYTE $0xde // mov rsi, r11
WORD $0x894d; BYTE $0xfb // mov r11, r15
LONG $0x247c8b4c; BYTE $0x50 // mov r15, qword ptr [rsp + 80]
JE LBB6_12
LBB6_13:
LONG $0xea0c8b4a // mov rcx, qword ptr [rdx + 8*r13]
LONG $0xef0c094a // or qword ptr [rdi + 8*r13], rcx
WORD $0xff49; BYTE $0xc5 // inc r13
WORD $0x3949; BYTE $0xdd // cmp r13, rbx
JB LBB6_13
JMP LBB6_12
LBB6_14:
LONG $0xd8658d48 // lea rsp, [rbp - 40]
BYTE $0x5b // pop rbx
WORD $0x5c41 // pop r12
WORD $0x5d41 // pop r13
WORD $0x5e41 // pop r14
WORD $0x5f41 // pop r15
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_xor_many(SB), $0-32
MOVQ a+0(FP), DI
MOVQ b+8(FP), SI
MOVQ dims+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
WORD $0x5741 // push r15
WORD $0x5641 // push r14
WORD $0x5541 // push r13
WORD $0x5441 // push r12
BYTE $0x53 // push rbx
LONG $0xf8e48348 // and rsp, -8
LONG $0x68ec8348 // sub rsp, 104
LONG $0xffffffbb; BYTE $0xff // mov ebx, 4294967295
WORD $0x2148; BYTE $0xd3 // and rbx, rdx
JE LBB7_14
WORD $0x8948; BYTE $0xd0 // mov rax, rdx
LONG $0x20e8c148 // shr rax, 32
LONG $0x02f88348 // cmp rax, 2
LONG $0x0001bc41; WORD $0x0000 // mov r12d, 1
LONG $0x24448948; BYTE $0x28 // mov qword ptr [rsp + 40], rax
LONG $0xe0430f4c // cmovae r12, rax
LONG $0x000200b9; BYTE $0x00 // mov ecx, 512
WORD $0xc031 // xor eax, eax
LONG $0x24448948; BYTE $0x18 // mov qword ptr [rsp + 24], rax
WORD $0x8948; BYTE $0xf8 // mov rax, rdi
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x10 // mov qword ptr [rsp + 16], rdx
WORD $0xd231 // xor edx, edx
LONG $0x24548948; BYTE $0x08 // mov qword ptr [rsp + 8], rdx
WORD $0x3145; BYTE $0xc9 // xor r9d, r9d
LONG $0x245c8948; BYTE $0x20 // mov qword ptr [rsp + 32], rbx
JMP LBB7_3
LBB7_2:
LONG $0x2444ff48; BYTE $0x08 // inc qword ptr [rsp + 8]
LONG $0x244c8b48; BYTE $0x38 // mov rcx, qword ptr [rsp + 56]
LONG $0x00c18148; WORD $0x0002; BYTE $0x00 // add rcx, 512
QUAD $0xfffe001024448148; BYTE $0xff // add qword ptr [rsp + 16], -512
QUAD $0x0010001824448148; BYTE $0x00 // add qword ptr [rsp + 24], 4096
LONG $0x10000548; WORD $0x0000 // add rax, 4096
LONG $0x245c8b48; BYTE $0x20 // mov rbx, qword ptr [rsp + 32]
LONG $0x244c8b4c; BYTE $0x30 // mov r9, qword ptr [rsp + 48]
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB7_14
LBB7_3:
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
WORD $0x8949; BYTE $0xda // mov r10, rbx
LONG $0x244c8948; BYTE $0x38 // mov qword ptr [rsp + 56], rcx
LONG $0xd1420f4c // cmovb r10, rcx
LONG $0x00898d49; WORD $0x0002; BYTE $0x00 // lea rcx, [r9 + 512]
WORD $0x3948; BYTE $0xd9 // cmp rcx, rbx
LONG $0x244c8948; BYTE $0x30 // mov qword ptr [rsp + 48], rcx
LONG $0xd9420f48 // cmovb rbx, rcx
LONG $0x247c8348; WORD $0x0028 // cmp qword ptr [rsp + 40], 0
JE LBB7_2
LONG $0x2454034c; BYTE $0x10 // add r10, qword ptr [rsp + 16]
LONG $0xfce28349 // and r10, -4
LONG $0x247c8b4c; BYTE $0x08 // mov r15, qword ptr [rsp + 8]
WORD $0x894c; BYTE $0xf9 // mov rcx, r15
LONG $0x09e1c148 // shl rcx, 9
WORD $0x8949; BYTE $0xd8 // mov r8, rbx
WORD $0x2949; BYTE $0xc8 // sub r8, rcx
LONG $0x0ce7c149 // shl r15, 12
LONG $0x3f1c8d4e // lea r11, [rdi + r15]
LONG $0x247c894c; BYTE $0x60 // mov qword ptr [rsp + 96], r15
LONG $0xc73c8d4f // lea r15, [r15 + 8*r8]
LONG $0x3f0c8d49 // lea rcx, [r15 + rdi]
LONG $0x244c8948; BYTE $0x58 // mov qword ptr [rsp + 88], rcx
WORD $0x894c; BYTE $0xc1 // mov rcx, r8
LONG $0xfce18348 // and rcx, -4
LONG $0x244c8948; BYTE $0x48 // mov qword ptr [rsp + 72], rcx
WORD $0x014c; BYTE $0xc9 // add rcx, r9
LONG $0x244c8948; BYTE $0x40 // mov qword ptr [rsp + 64], rcx
WORD $0x3145; BYTE $0xf6 // xor r14d, r14d
LONG $0x247c894c; BYTE $0x50 // mov qword ptr [rsp + 80], r15
JMP LBB7_5
LBB7_12:
WORD $0xff49; BYTE $0xc6 // inc r14
WORD $0x394d; BYTE $0xe6 // cmp r14, r12
JE LBB7_2
LBB7_5:
WORD $0x3949; BYTE $0xd9 // cmp r9, rbx
JAE LBB7_12
LONG $0xf6148b4a // mov rdx, qword ptr [rsi + 8*r14]
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x04f88349 // cmp r8, 4
JB LBB7_13
LONG $0x3a0c8d4a // lea rcx, [rdx + r15]
WORD $0x3949; BYTE $0xcb // cmp r11, rcx
JAE LBB7_9
LONG $0x244c8b48; BYTE $0x60 // mov rcx, qword ptr [rsp + 96]
WORD $0x0148; BYTE $0xd1 // add rcx, rdx
WORD $0x894d; BYTE $0xcd // mov r13, r9
LONG $0x244c3b48; BYTE $0x58 // cmp rcx, qword ptr [rsp + 88]
JB LBB7_13
LBB7_9:
WORD $0x894d; BYTE $0xdf // mov r15, r11
WORD $0x8949; BYTE $0xf3 // mov r11, rsi
LONG $0x244c8b48; BYTE $0x18 // mov rcx, qword ptr [rsp + 24]
LONG $0x0a348d48 // lea rsi, [rdx + rcx]
WORD $0xc931 // xor ecx, ecx
LBB7_10:
LONG $0x0410fcc5; BYTE $0xc8 // vmovups ymm0, ymmword ptr [rax + 8*rcx]
LONG $0x0457fcc5; BYTE $0xce // vxorps ymm0, ymm0, ymmword ptr [rsi + 8*rcx]
LONG $0x0411fcc5; BYTE $0xc8 // vmovups ymmword ptr [rax + 8*rcx], ymm0
LONG $0x04c18348 // add rcx, 4
WORD $0x3949; BYTE $0xca // cmp r10, rcx
JNE LBB7_10
LONG $0x246c8b4c; BYTE $0x40 // mov r13, qword ptr [rsp + 64]
LONG $0x24443b4c; BYTE $0x48 // cmp r8, qword ptr [rsp + 72]
WORD $0x894c; BYTE $0xde // mov rsi, r11
WORD $0x894d; BYTE $0xfb // mov r11, r15
LONG $0x247c8b4c; BYTE $0x50 // mov r15, qword ptr [rsp + 80]
JE LBB7_12
LBB7_13:
LONG $0xea0c8b4a // mov rcx, qword ptr [rdx + 8*r13]
LONG $0xef0c314a // xor qword ptr [rdi + 8*r13], rcx
WORD $0xff49; BYTE $0xc5 // inc r13
WORD $0x3949; BYTE $0xdd // cmp r13, rbx
JB LBB7_13
JMP LBB7_12
LBB7_14:
LONG $0xd8658d48 // lea rsp, [rbp - 40]
BYTE $0x5b // pop rbx
WORD $0x5c41 // pop r12
WORD $0x5d41 // pop r13
WORD $0x5e41 // pop r14
WORD $0x5f41 // pop r15
BYTE $0x5d // pop rbp
WORD $0xf8c5; BYTE $0x77 // vzeroupper
BYTE $0xc3 // ret
TEXT ·_count(SB), $0-32
MOVQ a+0(FP), DI
MOVQ size+8(FP), SI
MOVQ result+16(FP), DX
BYTE $0x55 // push rbp
WORD $0x8948; BYTE $0xe5 // mov rbp, rsp
LONG $0xf8e48348 // and rsp, -8
WORD $0x8548; BYTE $0xf6 // test rsi, rsi
JE LBB8_1
WORD $0xc931 // xor ecx, ecx
WORD $0x3145; BYTE $0xc0 // xor r8d, r8d
LBB8_4:
LONG $0xb80f48f3; WORD $0xcf04 // popcnt rax, qword ptr [rdi + 8*rcx]
WORD $0x0149; BYTE $0xc0 // add r8, rax
WORD $0xff48; BYTE $0xc1 // inc rcx
WORD $0x3948; BYTE $0xce // cmp rsi, rcx
JNE LBB8_4
JMP LBB8_2
LBB8_1:
WORD $0x3145; BYTE $0xc0 // xor r8d, r8d
LBB8_2:
WORD $0x894c; BYTE $0x02 // mov qword ptr [rdx], r8
WORD $0x8948; BYTE $0xec // mov rsp, rbp
BYTE $0x5d // pop rbp
BYTE $0xc3 // ret