Debian Codegraph @

crypto_nPbatch/montgomery25519/amd64-avx2-4x1-10l-maa4/fe25519_mul.S

raw
1 #include "crypto_asm_property.h"
2 #include "crypto_asm_hidden.h"
3 // linker define fe25519_mul
4 // linker use mask63
5
6 /* Assembly for field multiplication. */
7
8 #define mask63 CRYPTO_SHARED_NAMESPACE(mask63)
9
10 .p2align 5
11 ASM_HIDDEN _CRYPTO_SHARED_NAMESPACE(fe25519_mul)
12 .globl _CRYPTO_SHARED_NAMESPACE(fe25519_mul)
13 ASM_HIDDEN CRYPTO_SHARED_NAMESPACE(fe25519_mul)
14 .globl CRYPTO_SHARED_NAMESPACE(fe25519_mul)
15 _CRYPTO_SHARED_NAMESPACE(fe25519_mul):
16 CRYPTO_SHARED_NAMESPACE(fe25519_mul):
17
18 movq %rsp,%r11
19 andq $-32,%rsp
20 subq $40,%rsp
21
22 movq %r11,0(%rsp)
23 movq %r12,8(%rsp)
24 movq %r13,16(%rsp)
25 movq %r14,24(%rsp)
26 movq %r15,32(%rsp)
27
28 movq %rdx,%rcx
29
30 movq 8(%rsi),%rax
31 mulq 24(%rcx)
32 movq %rax,%r8
33 movq $0,%r9
34 movq %rdx,%r10
35 movq $0,%r11
36
37 movq 16(%rsi),%rax
38 mulq 16(%rcx)
39 addq %rax,%r8
40 adcq $0,%r9
41 addq %rdx,%r10
42 adcq $0,%r11
43
44 movq 24(%rsi),%rax
45 mulq 8(%rcx)
46 addq %rax,%r8
47 adcq $0,%r9
48 addq %rdx,%r10
49 adcq $0,%r11
50
51 movq 16(%rsi),%rax
52 mulq 24(%rcx)
53 addq %rax,%r10
54 adcq $0,%r11
55 movq %rdx,%r12
56 movq $0,%r13
57
58 movq 24(%rsi),%rax
59 mulq 16(%rcx)
60 addq %rax,%r10
61 adcq $0,%r11
62 addq %rdx,%r12
63 adcq $0,%r13
64
65 movq $38,%rax
66 mulq %r10
67 imul $38,%r11,%r11
68 movq %rax,%r10
69 addq %rdx,%r11
70
71 movq 24(%rsi),%rax
72 mulq 24(%rcx)
73 addq %rax,%r12
74 adcq $0,%r13
75
76 movq $38,%rax
77 mulq %rdx
78 movq %rax,%r14
79 movq %rdx,%r15
80
81 movq $38,%rax
82 mulq %r12
83 imul $38,%r13,%r13
84 movq %rax,%r12
85 addq %rdx,%r13
86
87 movq 0(%rsi),%rax
88 mulq 24(%rcx)
89 addq %rax,%r14
90 adcq $0,%r15
91 addq %rdx,%r8
92 adcq $0,%r9
93
94 movq 8(%rsi),%rax
95 mulq 16(%rcx)
96 addq %rax,%r14
97 adcq $0,%r15
98 addq %rdx,%r8
99 adcq $0,%r9
100
101 movq 16(%rsi),%rax
102 mulq 8(%rcx)
103 addq %rax,%r14
104 adcq $0,%r15
105 addq %rdx,%r8
106 adcq $0,%r9
107
108 movq 24(%rsi),%rax
109 mulq 0(%rcx)
110 addq %rax,%r14
111 adcq $0,%r15
112 addq %rdx,%r8
113 adcq $0,%r9
114
115 movq $38,%rax
116 mulq %r8
117 imul $38,%r9,%r9
118 movq %rax,%r8
119 addq %rdx,%r9
120
121 movq 0(%rsi),%rax
122 mulq 0(%rcx)
123 addq %rax,%r8
124 adcq $0,%r9
125 addq %rdx,%r10
126 adcq $0,%r11
127
128 movq 0(%rsi),%rax
129 mulq 8(%rcx)
130 addq %rax,%r10
131 adcq $0,%r11
132 addq %rdx,%r12
133 adcq $0,%r13
134
135 movq 8(%rsi),%rax
136 mulq 0(%rcx)
137 addq %rax,%r10
138 adcq $0,%r11
139 addq %rdx,%r12
140 adcq $0,%r13
141
142 movq 0(%rsi),%rax
143 mulq 16(%rcx)
144 addq %rax,%r12
145 adcq $0,%r13
146 addq %rdx,%r14
147 adcq $0,%r15
148
149 movq 8(%rsi),%rax
150 mulq 8(%rcx)
151 addq %rax,%r12
152 adcq $0,%r13
153 addq %rdx,%r14
154 adcq $0,%r15
155
156 movq 16(%rsi),%rax
157 mulq 0(%rcx)
158 addq %rax,%r12
159 adcq $0,%r13
160 addq %rdx,%r14
161 adcq $0,%r15
162
163 addq %r9,%r10
164 adcq $0,%r11
165
166 addq %r11,%r12
167 adcq $0,%r13
168
169 addq %r13,%r14
170 adcq $0,%r15
171
172 shld $1,%r14,%r15
173 andq mask63(%rip),%r14
174 imul $19,%r15,%r15
175
176 addq %r15,%r8
177 adcq $0,%r10
178 adcq $0,%r12
179 adcq $0,%r14
180
181 movq %r8,0(%rdi)
182 movq %r10,8(%rdi)
183 movq %r12,16(%rdi)
184 movq %r14,24(%rdi)
185
186 movq 0(%rsp),%r11
187 movq 8(%rsp),%r12
188 movq 16(%rsp),%r13
189 movq 24(%rsp),%r14
190 movq 32(%rsp),%r15
191
192 movq %r11,%rsp
193
194 ret
195 .section .note.GNU-stack,"",@progbits