ARM Intrinsics Syntax

Parents
  • Note: This was originally posted on 13th July 2011 at http://forums.arm.com

    Presently we are using few intrinsics as below: (thou they are in macro form!)

    #define CP15_CONTROL_READ(x)    asm("mrc p15, 0, %0, c1, c0, 0":"=r"(x))
    #define CP15_CONTROL_WRITE(x)    asm("mcr p15, 0, %0, c1, c0, 0"::"r"(x))

    we do not know how to use 'x' type of variables in case of multiple operands in intructions like add as mentioned above.

    with some exploration in generic linux source code for arm, we derived below macro translation for ADD:

    #define ADD2(sum, input1, input2) asm("ADD %2, %0, %1" :"=r"(input1),"=r"(input2) : "r"(sum) : "cc");

    however, this does not translate to an 'add' instruction when objdump is generated. help!
Reply
  • Note: This was originally posted on 13th July 2011 at http://forums.arm.com

    Presently we are using few intrinsics as below: (thou they are in macro form!)

    #define CP15_CONTROL_READ(x)    asm("mrc p15, 0, %0, c1, c0, 0":"=r"(x))
    #define CP15_CONTROL_WRITE(x)    asm("mcr p15, 0, %0, c1, c0, 0"::"r"(x))

    we do not know how to use 'x' type of variables in case of multiple operands in intructions like add as mentioned above.

    with some exploration in generic linux source code for arm, we derived below macro translation for ADD:

    #define ADD2(sum, input1, input2) asm("ADD %2, %0, %1" :"=r"(input1),"=r"(input2) : "r"(sum) : "cc");

    however, this does not translate to an 'add' instruction when objdump is generated. help!
Children
No data
More questions in this forum