9.103 __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.


__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<<4) | opcode2, where:
  • The first opcode, opcode1, occupies the 4-bit coprocessor-specific opcode field in the instruction.
  • The second opcode, opcode2, occupies the 3-bit coprocessor-specific opcode field in the instruction.
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 = 0xA, opcode2 = 0x3 
    const unsigned int regs = 0xCDE; // CRd = 0xC (12), CRn = 0xD (13), CRm = 0xE (14)
    __cdp(4,ops,regs); // coprocessor number 4
    // This intrinsic produces the instruction CDP p4,#0xa,c12,c13,c14,#3
Related information
CDP and CDP2
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.