Look at Ch7 of slau049d from ti.com. The hw mult does 16x16 bit multiplies to yield a 32 bit result. So, you have to do 4 multiplies. Now, think of your 32 bit numbers as arrays of 2 16bit numbers, and your 64 bit result as an array of 4 16 bit numbers.
You have to multiply a[0]*b[0], a[0]*b[1] , a[1]*b[0] , a[1]*b[1]
It's just like 34x56 = 1904
[3][4]x[5][6] = [1][9][0][4]

Garst
Andre Sodermans wrote:

does anybody know if mspgcc can generate the
instruction stream for a multiply of two 32bit
operands into a 64bit result (using h/w mul) as in:

 unsigned long a,b;
 unsigned long long res;
res = (unsigned long long) a*b;

If I try the above code on my device (149) a
u32xu32->u32 using h/w mul gets generated.





Reply via email to