"beqz	%0,1b\n\t"
".set	push\n\t" ".set	noreorder\n\t" "beqzl	%0,1b\n\t" " ll	%0,%2\n\t" ".set	pop\n\t"
atomic_add (volatile uint32_t *mem, int val){  int result;  __asm__ __volatile__    ("/* Inline atomic add */\n\t"     "1:\n\t"     "ll	%0,%2\n\t"     "addu	%0,%3,%0\n\t"     "sc	%0,%1\n\t"     "beqz	%0,1b\n\t"     "/* End atomic add */"     : "=&r"(result), "=m"(*mem)     : "m" (*mem), "r"(val)     : "memory");}