aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/cpu
diff options
context:
space:
mode:
authorMichael Eager <eager@mvista.com>2004-03-19 23:12:10 +0000
committerPhil Edwards <pme@gcc.gnu.org>2004-03-19 23:12:10 +0000
commit1b1a632b4dd80cc7c688bab50c38c66632f8d636 (patch)
tree591c1089cf1b5ffd761d1b3b15fb7d9ca5da1492 /libstdc++-v3/config/cpu
parent24d82bce7ab29c1616b961d79f676bb08d339719 (diff)
downloadgcc-1b1a632b4dd80cc7c688bab50c38c66632f8d636.zip
gcc-1b1a632b4dd80cc7c688bab50c38c66632f8d636.tar.gz
gcc-1b1a632b4dd80cc7c688bab50c38c66632f8d636.tar.bz2
atomicity.h: Prevent reg loads between LL and SC instructions.
2004-03-19 Michael Eager <eager@mvista.com> * config/cpu/mips/atomicity.h: Prevent reg loads between LL and SC instructions. From-SVN: r79711
Diffstat (limited to 'libstdc++-v3/config/cpu')
-rw-r--r--libstdc++-v3/config/cpu/mips/atomicity.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/libstdc++-v3/config/cpu/mips/atomicity.h b/libstdc++-v3/config/cpu/mips/atomicity.h
index 0871342..ecfb696 100644
--- a/libstdc++-v3/config/cpu/mips/atomicity.h
+++ b/libstdc++-v3/config/cpu/mips/atomicity.h
@@ -44,14 +44,15 @@ namespace __gnu_cxx
#if _MIPS_SIM == _ABIO32
".set mips2\n\t"
#endif
- "ll %0,%3\n\t"
- "addu %1,%4,%0\n\t"
- "sc %1,%2\n\t"
+ "ll %0,0(%2)\n\t"
+ "addu %1,%3,%0\n\t"
+ "sc %1,0(%2)\n\t"
".set pop\n\t"
"beqz %1,1b\n\t"
"/* End exchange & add */"
- : "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
- : "m" (*__mem), "r"(__val));
+ : "=&r"(__result), "=&r"(__tmp)
+ : "r"(__mem), "r"(__val)
+ : "memory" );
return __result;
}
@@ -69,13 +70,14 @@ namespace __gnu_cxx
#if _MIPS_SIM == _ABIO32
".set mips2\n\t"
#endif
- "ll %0,%2\n\t"
- "addu %0,%3,%0\n\t"
- "sc %0,%1\n\t"
+ "ll %0,0(%1)\n\t"
+ "addu %0,%2,%0\n\t"
+ "sc %0,0(%1)\n\t"
".set pop\n\t"
"beqz %0,1b\n\t"
"/* End atomic add */"
- : "=&r"(__result), "=m"(*__mem)
- : "m" (*__mem), "r"(__val));
+ : "=&r"(__result)
+ : "r"(__mem), "r"(__val)
+ : "memory" );
}
} // namespace __gnu_cxx