Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
tpruvot
GitHub Repository: tpruvot/cpuminer-multi
Path: blob/linux/asm/aesb-x64.S
1201 views
1
#include <cpuminer-config.h>
2
3
#if defined(__linux__) && defined(__ELF__)
4
.section .note.GNU-stack,"",%progbits
5
#endif
6
7
.text
8
.p2align 6
9
.globl fast_aesb_single_round
10
.globl _fast_aesb_single_round
11
fast_aesb_single_round:
12
_fast_aesb_single_round:
13
#if defined(_WIN64) || defined(__CYGWIN__)
14
movdqa (%rcx), %xmm1
15
aesenc (%r8), %xmm1
16
movdqa %xmm1, (%rdx)
17
#else
18
movdqa (%rdi), %xmm1
19
aesenc (%rdx), %xmm1
20
movdqa %xmm1, (%rsi)
21
#endif
22
ret
23
24
.text
25
.p2align 6
26
.globl fast_aesb_pseudo_round_mut
27
.globl _fast_aesb_pseudo_round_mut
28
fast_aesb_pseudo_round_mut:
29
_fast_aesb_pseudo_round_mut:
30
#if defined(_WIN64) || defined(__CYGWIN__)
31
mov %rdx, %r9
32
add $0xA0, %r9
33
movdqa (%rcx), %xmm1
34
35
.LOOP:
36
aesenc (%rdx), %xmm1
37
add $0x10, %rdx
38
cmp %r9, %rdx
39
jl .LOOP
40
41
movdqa %xmm1, (%rcx)
42
#else
43
mov %rsi, %r9
44
add $0xA0, %r9
45
movdqa (%rdi), %xmm1
46
47
.LOOP:
48
aesenc (%rsi), %xmm1
49
add $0x10, %rsi
50
cmp %r9, %rsi
51
jl .LOOP
52
53
movdqa %xmm1, (%rdi)
54
#endif
55
ret
56
57
.text
58
.globl mul128
59
.globl _mul128
60
mul128:
61
_mul128:
62
#if defined(_WIN64) || defined(__CYGWIN__)
63
mov %rcx, %rax
64
mul %rdx
65
mov %rdx, (%r8)
66
#else
67
mov %rdx, %r8
68
mov %rdi, %rax
69
mul %rsi
70
mov %rdx, (%r8)
71
#endif
72
ret
73
74