Author: zoltan
Date: 2007-10-18 17:10:39 -0400 (Thu, 18 Oct 2007)
New Revision: 87800
Modified:
trunk/mono/mono/io-layer/ChangeLog
trunk/mono/mono/io-layer/atomic.h
Log:
2007-10-18 Zoltan Varga <[EMAIL PROTECTED]>
* atomic.h (InterlockedCompareExchange): Fix the ia64 version so it
works for
negative values too. Hopefully fixes #332700.
Modified: trunk/mono/mono/io-layer/ChangeLog
===================================================================
--- trunk/mono/mono/io-layer/ChangeLog 2007-10-18 20:55:18 UTC (rev 87799)
+++ trunk/mono/mono/io-layer/ChangeLog 2007-10-18 21:10:39 UTC (rev 87800)
@@ -1,3 +1,8 @@
+2007-10-18 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * atomic.h (InterlockedCompareExchange): Fix the ia64 version so it
works for
+ negative values too. Hopefully fixes #332700.
+
2007-09-26 Dick Porter <[EMAIL PROTECTED]>
* io-portability.c (_wapi_io_scandir): Only update the error
Modified: trunk/mono/mono/io-layer/atomic.h
===================================================================
--- trunk/mono/mono/io-layer/atomic.h 2007-10-18 20:55:18 UTC (rev 87799)
+++ trunk/mono/mono/io-layer/atomic.h 2007-10-18 21:10:39 UTC (rev 87800)
@@ -710,13 +710,16 @@
gint32 exch, gint32 comp)
{
gint32 old;
+ guint64 real_comp;
#ifdef __INTEL_COMPILER
old = _InterlockedCompareExchange (dest, exch, comp);
#else
+ /* cmpxchg4 zero extends the value read from memory */
+ real_comp = (guint64)(guint32)comp;
asm volatile ("mov ar.ccv = %2 ;;\n\t"
"cmpxchg4.acq %0 = [%1], %3, ar.ccv\n\t"
- : "=r" (old) : "r" (dest), "r" (comp), "r"
(exch));
+ : "=r" (old) : "r" (dest), "r" (real_comp),
"r" (exch));
#endif
return(old);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches