File tree Expand file tree Collapse file tree 1 file changed +33
-6
lines changed Expand file tree Collapse file tree 1 file changed +33
-6
lines changed Original file line number Diff line number Diff line change 151
151
red_256 \res
152
152
.endm
153
153
154
+ .macro red_below_m a name
155
+ mov 0x18 \a, %r12
156
+ shr $0x38 , %r12
157
+ and $0xC0 , %r12
158
+ mov 0x00 \a, %r8
159
+ sub 0x200 (%rdx ,%r12 ,1 ), %r8
160
+ mov 0x08 \a, %r9
161
+ sbb 0x208 (%rdx ,%r12 ,1 ), %r9
162
+ mov 0x10 \a, %r10
163
+ sbb 0x210 (%rdx ,%r12 ,1 ), %r10
164
+ mov 0x18 \a, %r11
165
+ sbb 0x218 (%rdx ,%r12 ,1 ), %r11
166
+
167
+ jnc .Lred_done\name
168
+
169
+ add 0x240 (%rdx ), %r8
170
+ adc 0x248 (%rdx ), %r9
171
+ adc 0x250 (%rdx ), %r10
172
+ adc 0x258 (%rdx ), %r11
173
+
174
+ .Lred_done\name:
175
+ mov %r8 , 0x00 \a
176
+ mov %r9 , 0x08 \a
177
+ mov %r10 , 0x10 \a
178
+ mov %r11 , 0x18 \a
179
+ .endm
154
180
155
181
.LM:
156
182
.quad 0x0000000000000000
@@ -258,8 +284,8 @@ _mod_mul_4w:
258
284
.global mod_mul_4w
259
285
mod_mul_4w:
260
286
#endif
261
- // p1 = rdi
262
- // p2 = rsi
287
+ // x = rdi
288
+ // y = rsi
263
289
// result = rdx
264
290
push %rbp
265
291
push %rbx
@@ -269,11 +295,12 @@ mod_mul_4w:
269
295
push %r15
270
296
sub $8*65 , %rsp
271
297
mov %rdx , %rcx // rcx = result
272
- // p1 * p2
298
+
299
+ // x * y
273
300
mod_mul_256 (%rdi ), (%rsi ), (%rcx )
274
- //mov (%rcx), %rdx
275
- //add $100, %rdx
276
- //mov %rdx, (%rcx)
301
+ lea .LM( %rip ), %rdx
302
+ red_below_m ( %rcx ), mm
303
+
277
304
add $8*65 , %rsp
278
305
pop %r15
279
306
pop %r14
You can’t perform that action at this time.
0 commit comments