MIPS32 ISA defines the following format for the sync instruction:
SYNC (stype = 0 implied)
SYNC stype
here, stype may be SYNC_WMB (SYNC 4), SYNC_MB (SYNC 16), etc.
In inline assembler, I may use default sync: __asm__ volatile ("sync" ::);
.
But, if I write something like __asm__ volatile ("sync 0x10" ::)
, it doesn't compile:
Error: illegal operands 'sync 0x10'
Same if pass -mips32r2
option to gcc.
So, the question is: how to use SYNC_* (WYNC_WMB, SYNC_MB, SYNC_ACQUIRE, ...) instructions from GCC inlined assembly?