************************ mulredc1 x, y, z, m : taille 1 tmp: taille 2 u = x*y*invm tmp[0..2[ = x*y + u*m -> carry cy retournée z = tmp[1] ************************ mulredc2 u0 = x[0]*y[0]*invm tmp[0..3[ = x[0]*y tmp[0..3[ += u0*m -> carry in tmp[3] u1 = x[1]*y[0]*invm + tmp[1] tmp[1..4[ += x[1]*y -> carry??? tmp[1..4[ += u1*m -> carry cy retournée z[0..1[ = tmp[0..1[ ######################################################### z0:z1:z2:.... x0:x1:x2:.... y0:y1:y2:.... z +:= u*x + v*y Pour x: pour y: cy.hi dy.lo cy.lo dy.hi z[i] z[i+1] z[i+2] z[i+3] dy.lo dy.hi dy.HI y[i+3]*v rax rdx cy.lo cy.hi cy.HI x[i+1]*u rax rdx MOV x[i+1] -> rax MUL u -> rax:rdx ADD cy.lo -> z[i] ADC rax -> cy.hi MOV rdx -> cy.HI ### ADC 0 -> cy.HI MOV y[i+3] -> rax MUL v -> rax:rdx ADC dy.lo -> z[i+2] ADC rax -> dy.hi MOV rdx -> dy.HI ADC 0 -> dy.HI Etat initial: rsp: &z[0] rsi: &x[0] r8: u r10: &y[0] r9: v registres libres: rax, rdx rbx: cy.lo rcx: cy.hi r11: dy.lo r12: dy.hi