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.

Note

This intrinsic is intended for specialist expert use only.

Syntax

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

Where:

coproc

Identifies the coprocessor the instruction is for.

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

ops

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.

regs

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.

Usage

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

Example

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