Asm blocks such as the one blow have odd highlighting - see attached png
static inline uint32_t hevc_mem_bits32_arm(const void * p, const unsigned int bits)
{
unsigned int n;
__asm__ (
"rev %[n], %
: [n]"=r"(n)
:
- "r"(*(const uint32_t *)((const uint8_t *)p + (bits >> 3)))
:
);
return n << (bits & 7);
}
Life can be even more confused if you include comments in the asm lines:
tatic inline uint32_t get_cabac_by22_peek_arm(const CABACContext *const c)
{
uint32_t rv = c->low &~ 1, tmp;
__asm__ (
"cmp %[inv] , #0 \n\t"
"it ne \n\t"
// A comment (with brackets)
"umullne %[tmp] , %[rv] , %[inv], %[rv] \n\t"
: // Outputs
[rv]"+r"(rv),
[tmp]"=r"(tmp)
: // Inputs
[inv]"r"(c->range)
: // Clobbers
"cc"
);
return rv << 1;
}
Thanks
John Cox