dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and to


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. fd654f829263072bd547a3c8fcf457adfe850310
Date: Fri, 02 Apr 2010 15:34:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".

The branch, master has been updated
       via  fd654f829263072bd547a3c8fcf457adfe850310 (commit)
      from  f339bfb01915e953ddb43978ebd49095759f55d3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=fd654f829263072bd547a3c8fcf457adfe850310

commit fd654f829263072bd547a3c8fcf457adfe850310
Author: Klaus Treichel <address@hidden>
Date:   Fri Apr 2 17:34:09 2010 +0200

    Fix the ILInterlockedCompareAndExchange functions for arm.

diff --git a/ChangeLog b/ChangeLog
index 7f34a3d..52d405d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-04-02  Klaus Treichel  <address@hidden>
+
+       * support/interlocked_arm.h (ILInterlockedCompareAndExchangeI4): Use a
+       branch out of the ldrex/strex block if the loaded value doesn't match
+       the comparand because strexeq doesn't set state to successfull if the
+       condition doesn't match on real hardware.
+       (ILInterlockedCompareAndExchangeI4_Acquire): likewise
+       (ILInterlockedCompareAndExchangeI4_Release): likewise
+       (ILInterlockedCompareAndExchangeI4_Full): likewise
+       (ILInterlockedCompareAndExchangeP): likewise
+       (ILInterlockedCompareAndExchangeP_Acquire): likewise
+       (ILInterlockedCompareAndExchangeP_Release): likewise
+       (ILInterlockedCompareAndExchangeP_Full): likewise
+
 2010-03-27  Klaus Treichel  <address@hidden>
 
        * support/interlocked_arm.h: Disable the InterlockedExchange functions
diff --git a/support/interlocked_arm.h b/support/interlocked_arm.h
index 604ac0f..03a3f3e 100644
--- a/support/interlocked_arm.h
+++ b/support/interlocked_arm.h
@@ -264,9 +264,11 @@ static IL_INLINE ILInt32 
ILInterlockedCompareAndExchangeI4(volatile ILInt32 *des
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)
                : "cc"
@@ -288,9 +290,11 @@ static IL_INLINE ILInt32 
ILInterlockedCompareAndExchangeI4_Acquire(volatile ILIn
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                _IL_INTERLOCKED_ARM_MEMORYBARRIER
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)
@@ -314,9 +318,11 @@ static IL_INLINE ILInt32 
ILInterlockedCompareAndExchangeI4_Release(volatile ILIn
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)
                : "memory", "cc"
@@ -339,9 +345,11 @@ static IL_INLINE ILInt32 
ILInterlockedCompareAndExchangeI4_Full(volatile ILInt32
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                _IL_INTERLOCKED_ARM_MEMORYBARRIER
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)
@@ -367,9 +375,11 @@ static IL_INLINE void 
*ILInterlockedCompareAndExchangeP(void * volatile *dest,
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)
                : "cc"
@@ -391,9 +401,11 @@ static IL_INLINE void 
*ILInterlockedCompareAndExchangeP_Acquire(void * volatile
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                _IL_INTERLOCKED_ARM_MEMORYBARRIER
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)
@@ -417,9 +429,11 @@ static IL_INLINE void 
*ILInterlockedCompareAndExchangeP_Release(void * volatile
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)
                : "memory", "cc"
@@ -442,9 +456,11 @@ static IL_INLINE void 
*ILInterlockedCompareAndExchangeP_Full(void * volatile *de
                "1:"
                "ldrex                  %0, [%3];"
                "teq                    %0, %5;"
-               "strexeq        %1, %4, [%3];"
+               "bne                    2f;"
+               "strex          %1, %4, [%3];"
                "teq                    %1, #0;"
                "bne                    1b;"
+               "2:"
                _IL_INTERLOCKED_ARM_MEMORYBARRIER
                : "=&r" (retval), "=&r" (state), "+m" (*dest)
                : "r" (dest), "r" (value), "Jr" (comparand)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |   14 ++++++++++++++
 support/interlocked_arm.h |   32 ++++++++++++++++++++++++--------
 2 files changed, 38 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET engine, compilers and tools (pnet)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]