Debian Codegraph @

crypto_nPbatch/montgomery25519/amd64-avx2-4x1-9l-maa5/fe25519_mul.S

raw
1 #include "crypto_asm_property.h"
2 #include "crypto_asm_hidden.h"
3 // linker define fe25519_mul
4 // linker use mask51
5
6 /* Assembly for field multiplication. */
7
8 #define mask51 CRYPTO_SHARED_NAMESPACE(mask51)
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 $64,%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 movq %rbx,40(%rsp)
28 movq %rbp,48(%rsp)
29 movq %rdi,56(%rsp)
30
31 movq %rdx,%rcx
32
33 movq 0(%rsi),%rax
34 mulq 0(%rcx)
35 movq %rax,%r8
36 movq %rdx,%r9
37
38 movq 0(%rsi),%rax
39 mulq 8(%rcx)
40 movq %rax,%r10
41 movq %rdx,%r11
42
43 movq 8(%rsi),%rax
44 mulq 0(%rcx)
45 addq %rax,%r10
46 adcq %rdx,%r11
47
48 movq 0(%rsi),%rax
49 mulq 16(%rcx)
50 movq %rax,%r12
51 movq %rdx,%r13
52
53 movq 8(%rsi),%rax
54 mulq 8(%rcx)
55 addq %rax,%r12
56 adcq %rdx,%r13
57
58 movq 16(%rsi),%rax
59 mulq 0(%rcx)
60 addq %rax,%r12
61 adcq %rdx,%r13
62
63 movq 0(%rsi),%rax
64 mulq 24(%rcx)
65 movq %rax,%r14
66 movq %rdx,%r15
67
68 movq 8(%rsi),%rax
69 mulq 16(%rcx)
70 addq %rax,%r14
71 adcq %rdx,%r15
72
73 movq 16(%rsi),%rax
74 mulq 8(%rcx)
75 addq %rax,%r14
76 adcq %rdx,%r15
77
78 movq 24(%rsi),%rax
79 mulq 0(%rcx)
80 addq %rax,%r14
81 adcq %rdx,%r15
82
83 movq 0(%rsi),%rax
84 mulq 32(%rcx)
85 movq %rax,%rbx
86 movq %rdx,%rbp
87
88 movq 8(%rsi),%rax
89 mulq 24(%rcx)
90 addq %rax,%rbx
91 adcq %rdx,%rbp
92
93 movq 16(%rsi),%rax
94 mulq 16(%rcx)
95 addq %rax,%rbx
96 adcq %rdx,%rbp
97
98 movq 24(%rsi),%rax
99 mulq 8(%rcx)
100 addq %rax,%rbx
101 adcq %rdx,%rbp
102
103 movq 32(%rsi),%rax
104 mulq 0(%rcx)
105 addq %rax,%rbx
106 adcq %rdx,%rbp
107
108 shld $13,%rbx,%rbp
109
110 imul $19,8(%rsi),%rax
111 mulq 32(%rcx)
112 addq %rax,%r8
113 adcq %rdx,%r9
114
115 imul $19,16(%rsi),%rax
116 mulq 24(%rcx)
117 addq %rax,%r8
118 adcq %rdx,%r9
119
120 imul $19,24(%rsi),%rax
121 mulq 16(%rcx)
122 addq %rax,%r8
123 adcq %rdx,%r9
124
125 imul $19,32(%rsi),%rax
126 mulq 8(%rcx)
127 addq %rax,%r8
128 adcq %rdx,%r9
129
130 shld $13,%r8,%r9
131
132 imul $19,16(%rsi),%rax
133 mulq 32(%rcx)
134 addq %rax,%r10
135 adcq %rdx,%r11
136
137 imul $19,24(%rsi),%rax
138 mulq 24(%rcx)
139 addq %rax,%r10
140 adcq %rdx,%r11
141
142 imul $19,32(%rsi),%rax
143 mulq 16(%rcx)
144 addq %rax,%r10
145 adcq %rdx,%r11
146
147 shld $13,%r10,%r11
148
149 imul $19,24(%rsi),%rax
150 mulq 32(%rcx)
151 addq %rax,%r12
152 adcq %rdx,%r13
153
154 imul $19,32(%rsi),%rax
155 mulq 24(%rcx)
156 addq %rax,%r12
157 adcq %rdx,%r13
158
159 shld $13,%r12,%r13
160
161 imul $19,32(%rsi),%rax
162 mulq 32(%rcx)
163 addq %rax,%r14
164 adcq %rdx,%r15
165
166 shld $13,%r14,%r15
167
168 imul $19,%rbp,%rbp
169
170 movq mask51(%rip),%rdx
171
172 andq %rdx,%r8
173 andq %rdx,%r10
174 andq %rdx,%r12
175 andq %rdx,%r14
176 andq %rdx,%rbx
177
178 addq %r9,%r10
179 addq %r11,%r12
180 addq %r13,%r14
181 addq %r15,%rbx
182 addq %rbp,%r8
183
184 movq %r8,%rax
185 shrq $51,%rax
186 addq %r10,%rax
187 andq %rdx,%r8
188
189 movq %rax,%r9
190 shrq $51,%rax
191 addq %r12,%rax
192 andq %rdx,%r9
193
194 movq %rax,%r11
195 shrq $51,%rax
196 addq %r14,%rax
197 andq %rdx,%r11
198
199 movq %rax,%r13
200 shrq $51,%rax
201 addq %rbx,%rax
202 andq %rdx,%r13
203
204 movq %rax,%r15
205 shrq $51,%rax
206 imul $19,%rax ,%rax
207 addq %r8,%rax
208 andq %rdx,%r15
209
210 movq %rax,0(%rdi)
211 movq %r9,8(%rdi)
212 movq %r11,16(%rdi)
213 movq %r13,24(%rdi)
214 movq %r15,32(%rdi)
215
216 movq 0(%rsp),%r11
217 movq 8(%rsp),%r12
218 movq 16(%rsp),%r13
219 movq 24(%rsp),%r14
220 movq 32(%rsp),%r15
221 movq 40(%rsp),%rbx
222 movq 48(%rsp),%rbp
223
224 movq %r11,%rsp
225
226 ret
227 .section .note.GNU-stack,"",@progbits