On Tuesday 05 July 2011 17:57:40 Jason wrote: > On Tuesday 05 July 2011 17:14:41 Cactus wrote: > > Are you using the AMD code on the Intel Architectures? > > > > Brian > > Yep > K8 version on K8,core2,atom,netburst > K10 version on nehalem,sandybridge,bobcat > > and I'll tweek the core2 version to use pop/push rather than the redzone , > but that wont affect windows > > I'll copy your windows versions to the relevant dirs for mingw64 > > Thinking of writing the whole mpn_kara_mul_n in asm , be pretty easy to do > , and we would save a little bit. Perhaps also consider an unequal size > toom22. Have to look at toom33 also although what % is in the linear part > may be quite small. Also the mul_basecase's etc > > Jason
Just been looking at toom23 which is the next logical step for asm, I'm not sure if we have anything for unequal sizes yet in C even. The poly is (ax^2+bx+c)(dx+e)=adx^3+(ae+bd)x^2+(be+cd)x+ce which we eval at 0,inf,1,-1 so the muls are eval 0 A=ce=ce eval inf B=ad=ad eval -1 C=(a-b+c)(e-d)=-ad+ae+bd-be-cd+ce eval 1 D=(a+b+c)(e+d)=ad+ae+bd+be+cd+ce and we combine these to get the wanted coeffs of ad=B ae+bd=(D+C)/2-A be+cd=(D-C)/2-B cd=A Assuming we can get the theoretical best and using K102 timings of cycles per word of sub or add 1.5 inplace half 1.0 (must post this one) copy 1.0 we get 6*1.5+4*2*1.5+4*1+7*1.5+1*1.0=36.5 cycles now using the existing addadd 2.0 addsub 2.0 sumdiff 2.75 before the muls we get 2*2.0+1*2.75+4*2*1.5+4*1.0+7*1.5+1*1.0=34.25 and using it after the muls we get 2*2.0+1*2.75+2*2.75+2*2*1.0+2*2*1.5+7*1.5+1*1.0=33.75 this is what we get with current code which saves about 8% percent on the linear portion however using the same tricks as karaadd and assuming the best we get 2*2.0+2*2.75+1*2.0+1*1.5+2*2.0+1*1.0+2*2.5+2*1.5=26 this I imagine would give us 1-2% in the toom range , there may better ways , it just needs some more thinking/coding Jason -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to mpir-devel@googlegroups.com. To unsubscribe from this group, send email to mpir-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.