a question

Timothee Ewart Timothee.Ewart at unige.ch
Wed Feb 20 18:05:14 CET 2013


Hello GMP team,

I am working on a tiny integer arithmetic lib, based on full inline ASM mode, stack allocation, no checking. So really less possibility than GMP but sometimes a little speed up.
My lib works well, but I have something really bad, the signed determination of a signed extended multiplication (n bit * n bit = 2n bit).

So simply,

What is your method to calculate an extended signed multiplication for integer represented by the  two complement method ? But maybe you do not use the two complement representation.

I know the following method :
 
     1) convert to positive and adjust the sign (what I do)
     2) left/right binary shift add multiplier ( I try to combine this method with schoolbook method without success
                I posted on stack overflow, it does not really help : http://stackoverflow.com/questions/14946756/mix-left-add-multiplier-school-book-algo-for-signed-multiplication)
  
     3) booth encoding ? It seems a lot of software work

     4) Extended inputs (n bit to 2n bit) and calculate the result, nice but so much more work.
     5) mysterious method ?

Best,

t.
     
  



More information about the gmp-discuss mailing list