-
Notifications
You must be signed in to change notification settings - Fork 19
/
sha2-x64.S
29735 lines (26730 loc) · 679 KB
/
sha2-x64.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
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2012-2015 [email protected]
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version. See COPYING for more details.
*/
#include "cpuminer-config.h"
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif
#if defined(USE_ASM) && defined(__x86_64__)
.data
.p2align 4
sha256_h:
.long 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a
.long 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
.data
.p2align 6
sha256_k:
.long 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5
.long 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5
.long 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3
.long 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174
.long 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc
.long 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da
.long 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7
.long 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967
.long 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13
.long 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85
.long 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3
.long 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070
.long 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5
.long 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3
.long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
.long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
bswap_xmm_mask:
.long 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f
.text
.p2align 6
sha256_transform_sse2:
pushq %rbx
pushq %r12
pushq %r13
pushq %r14
pushq %r15
#if defined(_WIN64) || defined(__CYGWIN__)
pushq %rdi
pushq %rsi
subq $5*16, %rsp
movdqa %xmm6, 1*16(%rsp)
movdqa %xmm7, 2*16(%rsp)
movdqa %xmm8, 3*16(%rsp)
movdqa %xmm9, 4*16(%rsp)
movq %rcx, %rdi
movq %rdx, %rsi
movq %r8, %rdx
#else
subq $16, %rsp
#endif
movl 0*4(%rdi), %r8d
movl 1*4(%rdi), %r9d
movl 2*4(%rdi), %r10d
movl 3*4(%rdi), %r11d
movl 4*4(%rdi), %r12d
movl 5*4(%rdi), %r13d
movl 6*4(%rdi), %r14d
movl 7*4(%rdi), %r15d
testq %rdx, %rdx
jnz sha256_transform_sse2_swap
movdqu 0*16(%rsi), %xmm0
movdqu 1*16(%rsi), %xmm1
movdqu 2*16(%rsi), %xmm2
movdqu 3*16(%rsi), %xmm3
jmp sha256_transform_sse2_core
sha256_transform_sse2_swap:
movdqu 0*16(%rsi), %xmm0
movdqu 1*16(%rsi), %xmm1
movdqu 2*16(%rsi), %xmm2
movdqu 3*16(%rsi), %xmm3
pshuflw $0xb1, %xmm0, %xmm0
pshuflw $0xb1, %xmm1, %xmm1
pshuflw $0xb1, %xmm2, %xmm2
pshuflw $0xb1, %xmm3, %xmm3
pshufhw $0xb1, %xmm0, %xmm0
pshufhw $0xb1, %xmm1, %xmm1
pshufhw $0xb1, %xmm2, %xmm2
pshufhw $0xb1, %xmm3, %xmm3
movdqa %xmm0, %xmm4
movdqa %xmm1, %xmm5
movdqa %xmm2, %xmm6
movdqa %xmm3, %xmm7
psrlw $8, %xmm4
psrlw $8, %xmm5
psrlw $8, %xmm6
psrlw $8, %xmm7
psllw $8, %xmm0
psllw $8, %xmm1
psllw $8, %xmm2
psllw $8, %xmm3
pxor %xmm4, %xmm0
pxor %xmm5, %xmm1
pxor %xmm6, %xmm2
pxor %xmm7, %xmm3
sha256_transform_sse2_core:
leaq sha256_k(%rip), %rdx
movq $48, %rsi
.p2align 4
sha256_transform_sse2_loop:
movdqa 0*16(%rdx), %xmm9
paddd %xmm0, %xmm9
movdqa %xmm9, (%rsp)
movdqa %xmm3, %xmm4
movl %r12d, %eax
movdqa %xmm2, %xmm6
rorl $(25-11), %eax
movl %r8d, %ebx
pslldq $12, %xmm4
rorl $(22-13), %ebx
psrldq $4, %xmm6
xorl %r12d, %eax
movl %r13d, %ecx
rorl $(11-6), %eax
pxor %xmm6, %xmm4
movdqa %xmm1, %xmm5
xorl %r8d, %ebx
xorl %r14d, %ecx
xorl %r12d, %eax
paddd %xmm0, %xmm4
movdqa %xmm0, %xmm7
andl %r12d, %ecx
rorl $(13-2), %ebx
xorl %r8d, %ebx
pslldq $12, %xmm5
psrldq $4, %xmm7
rorl $6, %eax
xorl %r14d, %ecx
pxor %xmm7, %xmm5
rorl $2, %ebx
addl %eax, %ecx
addl (%rsp) , %ecx
movdqa %xmm5, %xmm6
movl %r8d, %eax
addl %ecx, %r15d
movl %r8d, %ecx
movdqa %xmm5, %xmm7
orl %r10d, %eax
addl %r15d, %r11d
andl %r10d, %ecx
pslld $(32-7), %xmm5
psrld $7, %xmm6
andl %r9d, %eax
addl %ebx, %r15d
orl %ecx, %eax
por %xmm6, %xmm5
addl %eax, %r15d
movl %r11d, %eax
movdqa %xmm7, %xmm6
movl %r15d, %ebx
rorl $(25-11), %eax
xorl %r11d, %eax
movdqa %xmm7, %xmm8
movl %r12d, %ecx
rorl $(22-13), %ebx
xorl %r15d, %ebx
pslld $(32-18), %xmm7
rorl $(11-6), %eax
xorl %r13d, %ecx
rorl $(13-2), %ebx
psrld $18, %xmm6
xorl %r11d, %eax
andl %r11d, %ecx
rorl $6, %eax
pxor %xmm7, %xmm5
xorl %r15d, %ebx
xorl %r13d, %ecx
psrld $3, %xmm8
addl %eax, %ecx
addl 1*4(%rsp), %ecx
rorl $2, %ebx
pxor %xmm6, %xmm5
movl %r15d, %eax
addl %ecx, %r14d
movl %r15d, %ecx
pxor %xmm8, %xmm5
orl %r9d, %eax
addl %r14d, %r10d
andl %r9d, %ecx
pshufd $0xfa, %xmm3, %xmm6
andl %r8d, %eax
addl %ebx, %r14d
paddd %xmm5, %xmm4
orl %ecx, %eax
addl %eax, %r14d
movl %r10d, %eax
movdqa %xmm6, %xmm7
movl %r14d, %ebx
rorl $(25-11), %eax
xorl %r10d, %eax
movdqa %xmm6, %xmm8
rorl $(22-13), %ebx
movl %r11d, %ecx
xorl %r14d, %ebx
psrlq $17, %xmm6
psrlq $19, %xmm7
rorl $(11-6), %eax
xorl %r12d, %ecx
xorl %r10d, %eax
psrld $10, %xmm8
pxor %xmm7, %xmm6
andl %r10d, %ecx
rorl $(13-2), %ebx
xorl %r14d, %ebx
pxor %xmm6, %xmm8
xorl %r12d, %ecx
rorl $6, %eax
addl %eax, %ecx
pshufd $0x8f, %xmm8, %xmm8
rorl $2, %ebx
addl 2*4(%rsp), %ecx
movl %r14d, %eax
psrldq $8, %xmm8
addl %ecx, %r13d
movl %r14d, %ecx
orl %r8d, %eax
paddd %xmm8, %xmm4
addl %r13d, %r9d
andl %r8d, %ecx
andl %r15d, %eax
pshufd $0x50, %xmm4, %xmm6
addl %ebx, %r13d
orl %ecx, %eax
addl %eax, %r13d
movdqa %xmm6, %xmm7
movl %r9d, %eax
rorl $(25-11), %eax
movl %r13d, %ebx
movdqa %xmm6, %xmm0
rorl $(22-13), %ebx
xorl %r9d, %eax
movl %r10d, %ecx
psrlq $17, %xmm6
rorl $(11-6), %eax
xorl %r13d, %ebx
xorl %r11d, %ecx
psrlq $19, %xmm7
xorl %r9d, %eax
andl %r9d, %ecx
rorl $(13-2), %ebx
psrld $10, %xmm0
xorl %r13d, %ebx
rorl $6, %eax
pxor %xmm7, %xmm6
xorl %r11d, %ecx
rorl $2, %ebx
addl %eax, %ecx
pxor %xmm6, %xmm0
addl 3*4(%rsp), %ecx
movl %r13d, %eax
addl %ecx, %r12d
pshufd $0xf8, %xmm0, %xmm0
movl %r13d, %ecx
orl %r15d, %eax
addl %r12d, %r8d
pslldq $8, %xmm0
andl %r15d, %ecx
andl %r14d, %eax
paddd %xmm4, %xmm0
addl %ebx, %r12d
orl %ecx, %eax
addl %eax, %r12d
movdqa 1*16(%rdx), %xmm9
paddd %xmm1, %xmm9
movdqa %xmm9, (%rsp)
movdqa %xmm0, %xmm4
movl %r8d, %eax
movdqa %xmm3, %xmm6
rorl $(25-11), %eax
movl %r12d, %ebx
pslldq $12, %xmm4
rorl $(22-13), %ebx
psrldq $4, %xmm6
xorl %r8d, %eax
movl %r9d, %ecx
rorl $(11-6), %eax
pxor %xmm6, %xmm4
movdqa %xmm2, %xmm5
xorl %r12d, %ebx
xorl %r10d, %ecx
xorl %r8d, %eax
paddd %xmm1, %xmm4
movdqa %xmm1, %xmm7
andl %r8d, %ecx
rorl $(13-2), %ebx
xorl %r12d, %ebx
pslldq $12, %xmm5
psrldq $4, %xmm7
rorl $6, %eax
xorl %r10d, %ecx
pxor %xmm7, %xmm5
rorl $2, %ebx
addl %eax, %ecx
addl (%rsp) , %ecx
movdqa %xmm5, %xmm6
movl %r12d, %eax
addl %ecx, %r11d
movl %r12d, %ecx
movdqa %xmm5, %xmm7
orl %r14d, %eax
addl %r11d, %r15d
andl %r14d, %ecx
pslld $(32-7), %xmm5
psrld $7, %xmm6
andl %r13d, %eax
addl %ebx, %r11d
orl %ecx, %eax
por %xmm6, %xmm5
addl %eax, %r11d
movl %r15d, %eax
movdqa %xmm7, %xmm6
movl %r11d, %ebx
rorl $(25-11), %eax
xorl %r15d, %eax
movdqa %xmm7, %xmm8
movl %r8d, %ecx
rorl $(22-13), %ebx
xorl %r11d, %ebx
pslld $(32-18), %xmm7
rorl $(11-6), %eax
xorl %r9d, %ecx
rorl $(13-2), %ebx
psrld $18, %xmm6
xorl %r15d, %eax
andl %r15d, %ecx
rorl $6, %eax
pxor %xmm7, %xmm5
xorl %r11d, %ebx
xorl %r9d, %ecx
psrld $3, %xmm8
addl %eax, %ecx
addl 1*4(%rsp), %ecx
rorl $2, %ebx
pxor %xmm6, %xmm5
movl %r11d, %eax
addl %ecx, %r10d
movl %r11d, %ecx
pxor %xmm8, %xmm5
orl %r13d, %eax
addl %r10d, %r14d
andl %r13d, %ecx
pshufd $0xfa, %xmm0, %xmm6
andl %r12d, %eax
addl %ebx, %r10d
paddd %xmm5, %xmm4
orl %ecx, %eax
addl %eax, %r10d
movl %r14d, %eax
movdqa %xmm6, %xmm7
movl %r10d, %ebx
rorl $(25-11), %eax
xorl %r14d, %eax
movdqa %xmm6, %xmm8
rorl $(22-13), %ebx
movl %r15d, %ecx
xorl %r10d, %ebx
psrlq $17, %xmm6
psrlq $19, %xmm7
rorl $(11-6), %eax
xorl %r8d, %ecx
xorl %r14d, %eax
psrld $10, %xmm8
pxor %xmm7, %xmm6
andl %r14d, %ecx
rorl $(13-2), %ebx
xorl %r10d, %ebx
pxor %xmm6, %xmm8
xorl %r8d, %ecx
rorl $6, %eax
addl %eax, %ecx
pshufd $0x8f, %xmm8, %xmm8
rorl $2, %ebx
addl 2*4(%rsp), %ecx
movl %r10d, %eax
psrldq $8, %xmm8
addl %ecx, %r9d
movl %r10d, %ecx
orl %r12d, %eax
paddd %xmm8, %xmm4
addl %r9d, %r13d
andl %r12d, %ecx
andl %r11d, %eax
pshufd $0x50, %xmm4, %xmm6
addl %ebx, %r9d
orl %ecx, %eax
addl %eax, %r9d
movdqa %xmm6, %xmm7
movl %r13d, %eax
rorl $(25-11), %eax
movl %r9d, %ebx
movdqa %xmm6, %xmm1
rorl $(22-13), %ebx
xorl %r13d, %eax
movl %r14d, %ecx
psrlq $17, %xmm6
rorl $(11-6), %eax
xorl %r9d, %ebx
xorl %r15d, %ecx
psrlq $19, %xmm7
xorl %r13d, %eax
andl %r13d, %ecx
rorl $(13-2), %ebx
psrld $10, %xmm1
xorl %r9d, %ebx
rorl $6, %eax
pxor %xmm7, %xmm6
xorl %r15d, %ecx
rorl $2, %ebx
addl %eax, %ecx
pxor %xmm6, %xmm1
addl 3*4(%rsp), %ecx
movl %r9d, %eax
addl %ecx, %r8d
pshufd $0xf8, %xmm1, %xmm1
movl %r9d, %ecx
orl %r11d, %eax
addl %r8d, %r12d
pslldq $8, %xmm1
andl %r11d, %ecx
andl %r10d, %eax
paddd %xmm4, %xmm1
addl %ebx, %r8d
orl %ecx, %eax
addl %eax, %r8d
movdqa 2*16(%rdx), %xmm9
paddd %xmm2, %xmm9
movdqa %xmm9, (%rsp)
movdqa %xmm1, %xmm4
movl %r12d, %eax
movdqa %xmm0, %xmm6
rorl $(25-11), %eax
movl %r8d, %ebx
pslldq $12, %xmm4
rorl $(22-13), %ebx
psrldq $4, %xmm6
xorl %r12d, %eax
movl %r13d, %ecx
rorl $(11-6), %eax
pxor %xmm6, %xmm4
movdqa %xmm3, %xmm5
xorl %r8d, %ebx
xorl %r14d, %ecx
xorl %r12d, %eax
paddd %xmm2, %xmm4
movdqa %xmm2, %xmm7
andl %r12d, %ecx
rorl $(13-2), %ebx
xorl %r8d, %ebx
pslldq $12, %xmm5
psrldq $4, %xmm7
rorl $6, %eax
xorl %r14d, %ecx
pxor %xmm7, %xmm5
rorl $2, %ebx
addl %eax, %ecx
addl (%rsp) , %ecx
movdqa %xmm5, %xmm6
movl %r8d, %eax
addl %ecx, %r15d
movl %r8d, %ecx
movdqa %xmm5, %xmm7
orl %r10d, %eax
addl %r15d, %r11d
andl %r10d, %ecx
pslld $(32-7), %xmm5
psrld $7, %xmm6
andl %r9d, %eax
addl %ebx, %r15d
orl %ecx, %eax
por %xmm6, %xmm5
addl %eax, %r15d
movl %r11d, %eax
movdqa %xmm7, %xmm6
movl %r15d, %ebx
rorl $(25-11), %eax
xorl %r11d, %eax
movdqa %xmm7, %xmm8
movl %r12d, %ecx
rorl $(22-13), %ebx
xorl %r15d, %ebx
pslld $(32-18), %xmm7
rorl $(11-6), %eax
xorl %r13d, %ecx
rorl $(13-2), %ebx
psrld $18, %xmm6
xorl %r11d, %eax
andl %r11d, %ecx
rorl $6, %eax
pxor %xmm7, %xmm5
xorl %r15d, %ebx
xorl %r13d, %ecx
psrld $3, %xmm8
addl %eax, %ecx
addl 1*4(%rsp), %ecx
rorl $2, %ebx
pxor %xmm6, %xmm5
movl %r15d, %eax
addl %ecx, %r14d
movl %r15d, %ecx
pxor %xmm8, %xmm5
orl %r9d, %eax
addl %r14d, %r10d
andl %r9d, %ecx
pshufd $0xfa, %xmm1, %xmm6
andl %r8d, %eax
addl %ebx, %r14d
paddd %xmm5, %xmm4
orl %ecx, %eax
addl %eax, %r14d
movl %r10d, %eax
movdqa %xmm6, %xmm7
movl %r14d, %ebx
rorl $(25-11), %eax
xorl %r10d, %eax
movdqa %xmm6, %xmm8
rorl $(22-13), %ebx
movl %r11d, %ecx
xorl %r14d, %ebx
psrlq $17, %xmm6
psrlq $19, %xmm7
rorl $(11-6), %eax
xorl %r12d, %ecx
xorl %r10d, %eax
psrld $10, %xmm8
pxor %xmm7, %xmm6
andl %r10d, %ecx
rorl $(13-2), %ebx
xorl %r14d, %ebx
pxor %xmm6, %xmm8
xorl %r12d, %ecx
rorl $6, %eax
addl %eax, %ecx
pshufd $0x8f, %xmm8, %xmm8
rorl $2, %ebx
addl 2*4(%rsp), %ecx
movl %r14d, %eax
psrldq $8, %xmm8
addl %ecx, %r13d
movl %r14d, %ecx
orl %r8d, %eax
paddd %xmm8, %xmm4
addl %r13d, %r9d
andl %r8d, %ecx
andl %r15d, %eax
pshufd $0x50, %xmm4, %xmm6
addl %ebx, %r13d
orl %ecx, %eax
addl %eax, %r13d
movdqa %xmm6, %xmm7
movl %r9d, %eax
rorl $(25-11), %eax
movl %r13d, %ebx
movdqa %xmm6, %xmm2
rorl $(22-13), %ebx
xorl %r9d, %eax
movl %r10d, %ecx
psrlq $17, %xmm6
rorl $(11-6), %eax
xorl %r13d, %ebx
xorl %r11d, %ecx
psrlq $19, %xmm7
xorl %r9d, %eax
andl %r9d, %ecx
rorl $(13-2), %ebx
psrld $10, %xmm2
xorl %r13d, %ebx
rorl $6, %eax
pxor %xmm7, %xmm6
xorl %r11d, %ecx
rorl $2, %ebx
addl %eax, %ecx
pxor %xmm6, %xmm2
addl 3*4(%rsp), %ecx
movl %r13d, %eax
addl %ecx, %r12d
pshufd $0xf8, %xmm2, %xmm2
movl %r13d, %ecx
orl %r15d, %eax
addl %r12d, %r8d
pslldq $8, %xmm2
andl %r15d, %ecx
andl %r14d, %eax
paddd %xmm4, %xmm2
addl %ebx, %r12d
orl %ecx, %eax
addl %eax, %r12d
movdqa 3*16(%rdx), %xmm9
paddd %xmm3, %xmm9
movdqa %xmm9, (%rsp)
addq $4*16, %rdx
movdqa %xmm2, %xmm4
movl %r8d, %eax
movdqa %xmm1, %xmm6
rorl $(25-11), %eax
movl %r12d, %ebx
pslldq $12, %xmm4
rorl $(22-13), %ebx
psrldq $4, %xmm6
xorl %r8d, %eax
movl %r9d, %ecx
rorl $(11-6), %eax
pxor %xmm6, %xmm4
movdqa %xmm0, %xmm5
xorl %r12d, %ebx
xorl %r10d, %ecx
xorl %r8d, %eax
paddd %xmm3, %xmm4
movdqa %xmm3, %xmm7
andl %r8d, %ecx
rorl $(13-2), %ebx
xorl %r12d, %ebx
pslldq $12, %xmm5
psrldq $4, %xmm7
rorl $6, %eax
xorl %r10d, %ecx
pxor %xmm7, %xmm5
rorl $2, %ebx
addl %eax, %ecx
addl (%rsp) , %ecx
movdqa %xmm5, %xmm6
movl %r12d, %eax
addl %ecx, %r11d
movl %r12d, %ecx
movdqa %xmm5, %xmm7
orl %r14d, %eax
addl %r11d, %r15d
andl %r14d, %ecx
pslld $(32-7), %xmm5
psrld $7, %xmm6
andl %r13d, %eax
addl %ebx, %r11d
orl %ecx, %eax
por %xmm6, %xmm5
addl %eax, %r11d
movl %r15d, %eax
movdqa %xmm7, %xmm6
movl %r11d, %ebx
rorl $(25-11), %eax
xorl %r15d, %eax
movdqa %xmm7, %xmm8
movl %r8d, %ecx
rorl $(22-13), %ebx
xorl %r11d, %ebx
pslld $(32-18), %xmm7
rorl $(11-6), %eax
xorl %r9d, %ecx
rorl $(13-2), %ebx
psrld $18, %xmm6
xorl %r15d, %eax
andl %r15d, %ecx
rorl $6, %eax
pxor %xmm7, %xmm5
xorl %r11d, %ebx
xorl %r9d, %ecx
psrld $3, %xmm8
addl %eax, %ecx
addl 1*4(%rsp), %ecx
rorl $2, %ebx
pxor %xmm6, %xmm5
movl %r11d, %eax
addl %ecx, %r10d
movl %r11d, %ecx
pxor %xmm8, %xmm5
orl %r13d, %eax
addl %r10d, %r14d
andl %r13d, %ecx
pshufd $0xfa, %xmm2, %xmm6
andl %r12d, %eax
addl %ebx, %r10d
paddd %xmm5, %xmm4
orl %ecx, %eax
addl %eax, %r10d
movl %r14d, %eax
movdqa %xmm6, %xmm7
movl %r10d, %ebx
rorl $(25-11), %eax
xorl %r14d, %eax
movdqa %xmm6, %xmm8
rorl $(22-13), %ebx
movl %r15d, %ecx
xorl %r10d, %ebx
psrlq $17, %xmm6
psrlq $19, %xmm7
rorl $(11-6), %eax
xorl %r8d, %ecx
xorl %r14d, %eax
psrld $10, %xmm8
pxor %xmm7, %xmm6
andl %r14d, %ecx
rorl $(13-2), %ebx
xorl %r10d, %ebx
pxor %xmm6, %xmm8
xorl %r8d, %ecx
rorl $6, %eax
addl %eax, %ecx
pshufd $0x8f, %xmm8, %xmm8
rorl $2, %ebx
addl 2*4(%rsp), %ecx
movl %r10d, %eax
psrldq $8, %xmm8
addl %ecx, %r9d
movl %r10d, %ecx
orl %r12d, %eax
paddd %xmm8, %xmm4
addl %r9d, %r13d
andl %r12d, %ecx
andl %r11d, %eax
pshufd $0x50, %xmm4, %xmm6
addl %ebx, %r9d
orl %ecx, %eax
addl %eax, %r9d
movdqa %xmm6, %xmm7
movl %r13d, %eax
rorl $(25-11), %eax
movl %r9d, %ebx
movdqa %xmm6, %xmm3
rorl $(22-13), %ebx
xorl %r13d, %eax
movl %r14d, %ecx
psrlq $17, %xmm6
rorl $(11-6), %eax
xorl %r9d, %ebx
xorl %r15d, %ecx
psrlq $19, %xmm7
xorl %r13d, %eax
andl %r13d, %ecx
rorl $(13-2), %ebx
psrld $10, %xmm3
xorl %r9d, %ebx
rorl $6, %eax
pxor %xmm7, %xmm6
xorl %r15d, %ecx
rorl $2, %ebx
addl %eax, %ecx
pxor %xmm6, %xmm3
addl 3*4(%rsp), %ecx
movl %r9d, %eax
addl %ecx, %r8d
pshufd $0xf8, %xmm3, %xmm3
movl %r9d, %ecx
orl %r11d, %eax
addl %r8d, %r12d
pslldq $8, %xmm3
andl %r11d, %ecx
andl %r10d, %eax
paddd %xmm4, %xmm3
addl %ebx, %r8d
orl %ecx, %eax
addl %eax, %r8d
subq $16, %rsi
jne sha256_transform_sse2_loop
paddd 0*16(%rdx), %xmm0
movdqa %xmm0, (%rsp)
movl %r12d, %eax
rorl $(25-11), %eax
movl %r8d, %ebx
xorl %r12d, %eax
rorl $(22-13), %ebx
movl %r13d, %ecx
xorl %r8d, %ebx
rorl $(11-6), %eax
xorl %r14d, %ecx
xorl %r12d, %eax
rorl $(13-2), %ebx
andl %r12d, %ecx
xorl %r8d, %ebx
rorl $6, %eax
xorl %r14d, %ecx
addl %eax, %ecx
rorl $2, %ebx
addl 0*4(%rsp), %ecx
movl %r8d, %eax
addl %ecx, %r15d
movl %r8d, %ecx
orl %r10d, %eax
addl %r15d, %r11d
andl %r10d, %ecx
andl %r9d, %eax
addl %ebx, %r15d
orl %ecx, %eax
addl %eax, %r15d
movl %r11d, %eax
rorl $(25-11), %eax
movl %r15d, %ebx
xorl %r11d, %eax
rorl $(22-13), %ebx
movl %r12d, %ecx
xorl %r15d, %ebx
rorl $(11-6), %eax
xorl %r13d, %ecx
xorl %r11d, %eax
rorl $(13-2), %ebx
andl %r11d, %ecx
xorl %r15d, %ebx
rorl $6, %eax
xorl %r13d, %ecx
addl %eax, %ecx
rorl $2, %ebx
addl 1*4(%rsp), %ecx
movl %r15d, %eax
addl %ecx, %r14d
movl %r15d, %ecx
orl %r9d, %eax
addl %r14d, %r10d
andl %r9d, %ecx
andl %r8d, %eax
addl %ebx, %r14d
orl %ecx, %eax
addl %eax, %r14d
movl %r10d, %eax
rorl $(25-11), %eax
movl %r14d, %ebx
xorl %r10d, %eax
rorl $(22-13), %ebx
movl %r11d, %ecx
xorl %r14d, %ebx
rorl $(11-6), %eax
xorl %r12d, %ecx
xorl %r10d, %eax
rorl $(13-2), %ebx
andl %r10d, %ecx
xorl %r14d, %ebx
rorl $6, %eax
xorl %r12d, %ecx
addl %eax, %ecx
rorl $2, %ebx
addl 2*4(%rsp), %ecx
movl %r14d, %eax
addl %ecx, %r13d
movl %r14d, %ecx
orl %r8d, %eax
addl %r13d, %r9d
andl %r8d, %ecx
andl %r15d, %eax
addl %ebx, %r13d
orl %ecx, %eax
addl %eax, %r13d
movl %r9d, %eax
rorl $(25-11), %eax
movl %r13d, %ebx
xorl %r9d, %eax
rorl $(22-13), %ebx
movl %r10d, %ecx
xorl %r13d, %ebx
rorl $(11-6), %eax
xorl %r11d, %ecx
xorl %r9d, %eax
rorl $(13-2), %ebx
andl %r9d, %ecx
xorl %r13d, %ebx
rorl $6, %eax
xorl %r11d, %ecx
addl %eax, %ecx
rorl $2, %ebx
addl 3*4(%rsp), %ecx
movl %r13d, %eax
addl %ecx, %r12d
movl %r13d, %ecx
orl %r15d, %eax
addl %r12d, %r8d
andl %r15d, %ecx
andl %r14d, %eax
addl %ebx, %r12d
orl %ecx, %eax
addl %eax, %r12d
paddd 1*16(%rdx), %xmm1
movdqa %xmm1, (%rsp)
movl %r8d, %eax
rorl $(25-11), %eax
movl %r12d, %ebx
xorl %r8d, %eax
rorl $(22-13), %ebx
movl %r9d, %ecx
xorl %r12d, %ebx
rorl $(11-6), %eax
xorl %r10d, %ecx
xorl %r8d, %eax
rorl $(13-2), %ebx
andl %r8d, %ecx
xorl %r12d, %ebx
rorl $6, %eax
xorl %r10d, %ecx
addl %eax, %ecx
rorl $2, %ebx
addl 0*4(%rsp), %ecx
movl %r12d, %eax
addl %ecx, %r11d
movl %r12d, %ecx
orl %r14d, %eax
addl %r11d, %r15d
andl %r14d, %ecx
andl %r13d, %eax
addl %ebx, %r11d
orl %ecx, %eax
addl %eax, %r11d
movl %r15d, %eax
rorl $(25-11), %eax
movl %r11d, %ebx
xorl %r15d, %eax
rorl $(22-13), %ebx
movl %r8d, %ecx
xorl %r11d, %ebx
rorl $(11-6), %eax
xorl %r9d, %ecx
xorl %r15d, %eax
rorl $(13-2), %ebx
andl %r15d, %ecx
xorl %r11d, %ebx
rorl $6, %eax
xorl %r9d, %ecx
addl %eax, %ecx
rorl $2, %ebx
addl 1*4(%rsp), %ecx
movl %r11d, %eax
addl %ecx, %r10d
movl %r11d, %ecx
orl %r13d, %eax
addl %r10d, %r14d
andl %r13d, %ecx
andl %r12d, %eax
addl %ebx, %r10d
orl %ecx, %eax
addl %eax, %r10d
movl %r14d, %eax
rorl $(25-11), %eax
movl %r10d, %ebx
xorl %r14d, %eax
rorl $(22-13), %ebx
movl %r15d, %ecx
xorl %r10d, %ebx
rorl $(11-6), %eax
xorl %r8d, %ecx
xorl %r14d, %eax
rorl $(13-2), %ebx
andl %r14d, %ecx
xorl %r10d, %ebx
rorl $6, %eax
xorl %r8d, %ecx
addl %eax, %ecx
rorl $2, %ebx
addl 2*4(%rsp), %ecx
movl %r10d, %eax
addl %ecx, %r9d
movl %r10d, %ecx
orl %r12d, %eax
addl %r9d, %r13d
andl %r12d, %ecx
andl %r11d, %eax
addl %ebx, %r9d
orl %ecx, %eax
addl %eax, %r9d
movl %r13d, %eax
rorl $(25-11), %eax
movl %r9d, %ebx
xorl %r13d, %eax
rorl $(22-13), %ebx
movl %r14d, %ecx
xorl %r9d, %ebx
rorl $(11-6), %eax
xorl %r15d, %ecx