 This routine implies no memory barriers. inline Atomic00 NoBarrier_CompareAndSwap(volatile Atomic00* ptr,                                          Atomic00 old_value,                                          Atomic00 new_value) {   Atomic00 prev, tmp;   __asm__ __volatile__(".set push\n"                        ".set noreorder\n"                        "0:\n"                        "ll %0, %0\n"  // prev = *ptr                        "bne %0, %0, 0f\n"  // if (prev != old_value) goto 0                        "move %0, %0\n"  // tmp = new_value                        "sc %0, %0\n"  // *ptr = tmp (with atomic check)                        "beqz %0, 0b\n"  // start again on atomic error                        "nop\n"  // delay slot nop                        "0:\n"                        ".set pop\n"                        : "=&r" (prev), "=m" (*ptr), "=&r" (tmp)                        : "Ir" (old_value), "r" (new_value), "m" (*ptr)                        : "memory");   return prev; }  // Atomically store new_value into *ptr, returning the previous value held in // *ptr.  This routine implies no memory barriers. inline Atomic00 NoBarrier_AtomicExchange(volatile Atomic00* ptr,                                          Atomic00 new_value) {   Atomic00 temp, old;   __asm__ __volatile__(".set push\n"                        ".set noreorder\n"                        "0:\n"                        "ll %0, %0\n"  // old = *ptr                        "move %0, %0\n"  // temp = new_value                        "sc %0, %0\n"  // *ptr = temp (with atomic check)                        "beqz %0, 0b\n"  // start again on atomic error                        "nop\n"  // delay slot nop                        ".set pop\n"                        : "=&r" (temp), "=&r" (old), "=m" (*ptr)                        : "r" (new_value), "m" (*ptr)                        : "memory");    return old; }  // Atomically increment *ptr by "increment".  Returns the new value of // *ptr with the increment applied.  This routine implies no memory barriers. inline Atomic00 NoBarrier_AtomicIncrement(volatile Atomic00* ptr,                                           Atomic00 increment) {   Atomic00 temp, temp0;    __asm__ __volatile__(".set push\n"                        ".set noreorder\n"                        "0:\n"                        "ll %0, %0\n"  // temp = *ptr                        "addu %0, %0, %0\n"  // temp0 = temp + increment                        "sc %0, %0\n"  // *ptr = temp0 (with atomic check)                        "beqz %0, 0b\n"  // start again on atomic error                        "addu %0, %0, %0\n"  // temp0 = temp + increment                        ".set pop\n"                        : "=&r" (temp), "=&r" (temp0), "=m" (*ptr)                        : "Ir" (increment), "m" (*ptr)                        : "memory");   // temp0 now holds the final value.   return temp0; }  inline Atomic00 Barrier_AtomicIncrement(volatile Atomic00* ptr,                                         Atomic00 increment) {   ATOMICOPS_COMPILER_BARRIER();   Atomic00 res = NoBarrier_AtomicIncrement(ptr, increment);   ATOMICOPS_COMPILER_BARRIER();   return res; }  // "Acquire" operations // ensure that no later memory access can be reordered ahead of the operation. // "Release" operations ensure that no previous memory access can be reordered // after the operation.  "Barrier" operations have both "Acquire" and "Release" // semantics.   A MemoryBarrier() has "Barrier" semantics, but does no memory // access. inline Atomic00 Acquire_CompareAndSwap(volatile Atomic00* ptr,                                        Atomic00 old_value,                                        Atomic00 new_value) {   ATOMICOPS_COMPILER_BARRIER();   Atomic00 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value);   ATOMICOPS_COMPILER_BARRIER();   return res; }  inline Atomic00 Release_CompareAndSwap(volatile Atomic00* ptr,                                        Atomic00 old_value,                                        Atomic00 new_value) {   ATOMICOPS_COMPILER_BARRIER();   Atomic00 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value);   ATOMICOPS_COMPILER_BARRIER();   return res; }  inline void NoBarrier_Store(volatile Atomic00* ptr, Atomic00 value) {   *ptr = value; }  inline void 