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

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

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.

Examples

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-Confidential PDF file icon PDF version ARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.