0
votes

I'm trying to compile some assembly code using GNU assembler, with target as ARM platform. But some errors appear. I'm not familiar with the assembly grammar.

Anyone can tell me how to work around this error?

error: invalid operand in inline asm: 'str  ${2:Q}, $0  
str  ${2:R}, $1

The inline asm code which caused this compiling error is here:

static av_always_inline void AV_WN64(void *p, uint64_t v)
{
    __asm__ ("str  %Q2, %0  \n\t"
         "str  %R2, %1  \n\t"
         : "=m"(*(uint32_t*)p), "=m"(*((uint32_t*)p+1))
         : "r"(v));
}
1
please post the source line that it is complaining about as well.jcopenha
The inline asm code comes from ffmpeg, libavutil/arm/intreadwrite.h. I add the code above.ciphor

1 Answers

0
votes

Try:

__asm__ ("strd [%0], %1\n\t" : : "r"(p), "r"(v) : "memory");

The compiler should recognize that v as 64bit quantity requires a register pair.