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.

Where can I find the C intrinsic function list?

I found all the instructions for C64x/C64x+ are listed in "TMS320C64xC64x+ DSP CPU and Instruction Set Reference Guide (spru732g)", but in DSP code we need to use C intrinsic. e.g., instruction DOTP2 will be converted to _dotp2() in DSP code.  I found some of the instruction has not corresponding C intrinsic, e.g., SWAP2, actually it is substituted by _packlh2().   It is not convenient to find out which has corresponding C intrinsic or not.  That is why I would like to have the complete list for all the correspondence. 

  • thank you for your quick reply, the information is very helpful.  I found the C intrinsic is only part of the instructions from "TMS320C64xC64x+ DSP CPU and Instruction Set Reference Guide (spru732g)".  How about those C intrinsic not showing in "TMS320C6000 Optimizing Compiler v 6.1 User's Guide".  For example, SWAP2,  there is no intrinsic associated with it from "TMS320C6000 Optimizing Compiler v 6.1 User's Guide", actually I found it is substituted by _packlh2() by googling it, which is not convenient.  Any suggestions?

  • I don't know how you are getting a SWAP2 instruction while using a _packlh2 intrinsic.  When I try, I get a PACKLH2 instruction, which is what I expect.  An intrinsic has the same name as the instruction used to implement it, with a few exceptions (like the interrupt intrinsics).  Not every instruction on the device has an associated intrinsic.  It is limited to those operations which are difficult or impossible to express in C.

    Thanks and regards,

    -George

     

  • SWAP2 is a pseudo-operation for PACKLH2.  The _packlh2() intrinsic should be used instead as there are no associated intrinsics for pseudo-ops and therefore no intrinsic for SWAP2.  Arguably, the C6000 compiler should have intrinsics for all pseudo-operations, but this is generally not the current practice.  (If an instruction says it is a pseudo operation in the CPU and Instruction Set Guide, you'll need to use the intrinsic for the actual instruction.  See description of the SWAP2 instruction in TI document sprufe8 or spru732.)

     

    If you'd like a _swap2 intrinsic, you could simply define a macro:

    #define _swap2(a, b) _packlh2(a, b)