1

I am using the following code to perform multiplication using DS5 ARM C Compiler 5. The compiler throws build errors stating expected a ")"

static __inline int32_t multiply(int32_t x, int32_t y)
{
    __asm volatile(
            "mul %0, %1, %2\n\t"
            : "=a"(y)                   // error pointed to this line
            : "r"(x), "a"(y));


    return y;
}

Note: target --cpu is armV7a. Is there any way to overcome this error?

Oak Bytes
  • 4,649
  • 4
  • 36
  • 53
SarC
  • 118
  • 1
  • 7
  • Compiles fine here using gcc. Is the compiler you use really gcc? – Jester Jun 05 '15 at 10:16
  • 5
    armcc is not GCC. It may support [_some_ GNU features](http://infocenter.arm.com/help/topic/com.arm.doc.dui0472k/chr1359124965274.html), but GCC's extended asm is not one of them. – Notlikethat Jun 05 '15 at 10:48
  • 3
    I think armcc doesn't support extended assembly http://ds.arm.com/developer-resources/tutorials/using-inline-assembly-code-to-improve-code-efficiency/ – phuclv Jun 05 '15 at 12:46

0 Answers0