This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

64 bit multiplication in F2812

Can somebody help me with 64 bit multiplication in assembly code for 32 bit F2812 DSC. I want to know total number of cycles required for a 64 bit multiplication.

  • Karthik,

    I assume you need a 64-bit fixed point multiplication.  On F2812 there is no 64-bit multiply instruction, nor any 128-bit registers to store the intermediate result.

    There is a function call in the RTS library which supports this in C.  For example:

    long long a64, b64, c64;

    c64 = a64 * b64;

    If break on the code line and view the disassembly, the multiply is a function call to LL$$MPY which takes 30 CPU cycles.  I believe the lower 64-bits of the result are returned.  It may help to step through that function.

    Regards,

    Richard

  • Hi Richard,

       Thanks a lot for the reply. So even if I code in 320F2xx assembly it will take 30 CPU cycles.? I have seen some intel assembly code where the 64 bit multiplication is done using 32 bit multipliers in less than 20 cycles. Please share your opinion on it.

         Regards

            Karthik R

  • Hi Karthik,

    Possibly the Intel machine has hardware support for 64-bit fixed-point multiplication which results in 20 cycle performance.  I don't know.  

    On the C28x CPU, the only example I can point you towards is the RTS code in my previous post.  

    Regards,

    Richard