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.

Long Long Integer Math library

Is there a math library that supports 64 bit integers?  I am using TMS320VC5509 and the standard math.c.  It permits Long Long types and will attempt math.  However, it appears to be limited to the 40bit ALU. 

  • Matt, you are right
    The C compiler for C55X (www.ti.com/.../spru281g.pdf table 5-1) defines long long as 40 bits. The reason becomes obvious when you look at the accumulator registers (section 2.3 of www.ti.com/.../swpu073e.pdf) and they have only 40 bits.

    If 40 bits arithmetic is not enough for you, you can emulate 64-bit arithmetic in software. It will take many cycles to do add (have two 32-bit words for each variable and look for the carry bit) and even more cycles to perform multiplication (I assume you have to break any 32-bit words into 2 16-bit and do the multiplication)

    Does it answer your question? If so, please close the thread

    Ran
  • Yes, I agree with the processor hardware limitations.  I suspect (hoped) that an assembly based library routine can handle 64 bit integer math on  a DSP reasonably and is preferred over floating point arithmetic.