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 151151 red_256 \res
152152.endm
153153
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
154180
155181.LM:
156182 .quad 0x0000000000000000
@@ -258,8 +284,8 @@ _mod_mul_4w:
258284.global mod_mul_4w
259285mod_mul_4w:
260286#endif
261- // p1 = rdi
262- // p2 = rsi
287+ // x = rdi
288+ // y = rsi
263289 // result = rdx
264290 push %rbp
265291 push %rbx
@@ -269,11 +295,12 @@ mod_mul_4w:
269295 push %r15
270296 sub $8*65 , %rsp
271297 mov %rdx , %rcx // rcx = result
272- // p1 * p2
298+
299+ // x * y
273300 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+
277304 add $8*65 , %rsp
278305 pop %r15
279306 pop %r14
You can’t perform that action at this time.
0 commit comments