[llvm-commits] CVS: llvm-gcc/libstdc++-v3/config/cpu/alpha/atomicity.h

Andrew Lenharth alenhar2 at cs.uiuc.edu
Thu Feb 24 13:50:45 PST 2005



Changes in directory llvm-gcc/libstdc++-v3/config/cpu/alpha:

atomicity.h updated: 1.1.1.1 -> 1.2
---
Log message:

make the alpha skip asm, and do the ops like the other archs do, rather than using ../generic

---
Diffs of the changes:  (+8 -3)

 atomicity.h |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)


Index: llvm-gcc/libstdc++-v3/config/cpu/alpha/atomicity.h
diff -u llvm-gcc/libstdc++-v3/config/cpu/alpha/atomicity.h:1.1.1.1 llvm-gcc/libstdc++-v3/config/cpu/alpha/atomicity.h:1.2
--- llvm-gcc/libstdc++-v3/config/cpu/alpha/atomicity.h:1.1.1.1	Thu Jan  8 15:59:29 2004
+++ llvm-gcc/libstdc++-v3/config/cpu/alpha/atomicity.h	Thu Feb 24 15:50:32 2005
@@ -42,7 +42,10 @@
 __exchange_and_add (volatile _Atomic_word* __mem, int __val)
 {
   register int __result, __tmp;
-
+#ifdef __llvm__
+  __result = *__mem;
+  *__mem += __val;
+#else
   __asm__ __volatile__ (
       "\n$Lxadd_%=:\n\t"
       "ldl_l  %0,%3\n\t"
@@ -52,7 +55,7 @@
       "mb"
       : "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
       : "m" (*__mem), "r"(__val));
-
+#endif
   return __result;
 }
 
@@ -61,7 +64,9 @@
 __atomic_add (volatile _Atomic_word* __mem, int __val)
 {
   register _Atomic_word __result;
-
+#ifdef __llvm__
+  *__mem += __val;
+#else
   __asm__ __volatile__ (
       "\n$Ladd_%=:\n\t"
       "ldl_l  %0,%2\n\t"






More information about the llvm-commits mailing list