You copied the Doc URL to your clipboard.

__cdp intrinsic

This intrinsic inserts a CDP or CDP2 instruction into the instruction stream generated by the compiler. It enables you to include coprocessor data operations in your C or C++ code.


This intrinsic is intended for specialist expert use only.


__cdp(unsigned int coproc, unsigned int ops, unsigned int regs)



Identifies the coprocessor the instruction is for.

coproc must be an integer in the range 0 to 15.


Is an encoding of the two opcodes for the CDP or CDP2 instruction, (opcode1<<3) | opcode2, where:

  • the first opcode, opcode1, is a 4-bit coprocessor-specific opcode

  • the second opcode, opcode2, is an optional 3-bit coprocessor-specific opcode.

Add 0x100 to ops to generate a CDP2 instruction.


Is an encoding of the coprocessor registers, (CRd<<8) | (CRn<<4) | CRm, where CRd, CRn and CRm are the coprocessor registers for the CDP or CDP2 instruction.


The use of these instructions depends on the coprocessor. See your coprocessor documentation for more information.


void copro_example()
    const unsigned int ops = 0xA3; // opcode1 = A, opcode2 = 3 
    const unsigned int regs = 0xCDE; // reg1 = C, reg2 = D, reg3 = E
    __cdp(4,ops,regs); // coprocessor number 4
    // This intrinsic produces the instruction CDP p4,#0xa,c12,c13,c14,#3

See also