"bne	%0,%2,2f\n\t" "move	%0,%3\n\t" ".set	pop\n\t" "sc	%0,%1\n\t" "beqz	%0,1b\n"
"bne	%1,%3,2f\n\t" " move	%0,$0\n\t" "move	%0,%4\n\t" "sc	%0,%2\n\t" "beqzl	%0,1b\n\t" " ll	%1,%5\n\t" ".set	pop\n"
compare_and_swap (volatile long int *p, long int oldval, long int newval){  long int ret;  __asm__ __volatile__    ("/* Inline compare & swap */\n\t"     "1:\n\t"     "ll	%0,%4\n\t"     ".set	push\n"     ".set	noreorder\n\t"     "bne	%0,%2,2f\n\t"     "move	%0,%3\n\t"     ".set	pop\n\t"     "sc	%0,%1\n\t"     "beqz	%0,1b\n"     "2:\n\t"     "/* End compare & swap */"     : "=&r" (ret), "=m" (*p)     : "r" (oldval), "r" (newval), "m" (*p)     : "memory");  return ret;}