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. 8b5c977f1598c5effbe71a1ae0cb8b350414f9ab
Date: Fri, 02 Apr 2010 15:51:06 +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  8b5c977f1598c5effbe71a1ae0cb8b350414f9ab (commit)
      from  fd654f829263072bd547a3c8fcf457adfe850310 (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=8b5c977f1598c5effbe71a1ae0cb8b350414f9ab

commit 8b5c977f1598c5effbe71a1ae0cb8b350414f9ab
Author: Klaus Treichel <address@hidden>
Date:   Fri Apr 2 17:50:53 2010 +0200

    Add interlocked functions for mips tested on qemu.

diff --git a/ChangeLog b/ChangeLog
index 52d405d..b8b9c02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,12 @@
        (ILInterlockedCompareAndExchangeP_Release): likewise
        (ILInterlockedCompareAndExchangeP_Full): likewise
 
+       * support/interlocked.h: Include interlocked_mips.h.
+
+       * support/interlocked_mips.h: Add interlocked functions for mips.
+
+       * support/Makefile.am: Add interlocked_mips.h to the sources.
+
 2010-03-27  Klaus Treichel  <address@hidden>
 
        * support/interlocked_arm.h: Disable the InterlockedExchange functions
diff --git a/support/Makefile.am b/support/Makefile.am
index 76d3e07..cc99536 100644
--- a/support/Makefile.am
+++ b/support/Makefile.am
@@ -35,6 +35,7 @@ libILSupport_a_SOURCES = aes.c \
                                                 interlocked.h \
                                                 interlocked_any.h \
                                                 interlocked_arm.h \
+                                                interlocked_mips.h \
                                                 interlocked_ppc.h \
                                                 interlocked_x86.h \
                                                 interlocked_slist.c \
diff --git a/support/interlocked.h b/support/interlocked.h
index 1819090..b679390 100644
--- a/support/interlocked.h
+++ b/support/interlocked.h
@@ -343,6 +343,7 @@ void _ILInterlockedOrU8_Full(volatile ILUInt64 *dest, 
ILUInt64 value);
 #include "interlocked_x86.h"
 #include "interlocked_arm.h"
 #include "interlocked_ppc.h"
+#include "interlocked_mips.h"
 #include "interlocked_any.h"
 
 #endif /* _INTERLOCKED_H_ */
diff --git a/support/interlocked_mips.h b/support/interlocked_mips.h
new file mode 100644
index 0000000..936c05b
--- /dev/null
+++ b/support/interlocked_mips.h
@@ -0,0 +1,227 @@
+/*
+ * interlocked_mips.h - Implementation of interlocked functions for
+ * Mips processors.
+ *
+ * Copyright (C) 2010  Southern Storm Software, Pty Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#if defined(__mips) || defined(__mips__)
+
+#if defined(__GNUC__)
+
+/*
+ * Flush cache and set a memory barrier.
+ */
+static IL_INLINE void ILInterlockedMemoryBarrier()
+{
+       __asm__ __volatile__
+       (
+               "       .set push\n"
+               "       .set mips2\n"
+               "       .set noreorder\n"
+               "       .set nomacro\n"
+               "       sync\n"
+               "       .set pop\n"
+               :
+               :
+               : "memory"
+       );
+}
+#define IL_HAVE_INTERLOCKED_MEMORYBARRIER 1
+
+/*
+ * Exchange two 32 bit integers.
+ */
+static IL_INLINE ILInt32 ILInterlockedExchangeI4_Full(volatile ILInt32 *dest,
+                                                                               
                          ILInt32 value)
+{
+       ILInt32 retval;
+       ILInt32 temp;
+
+       __asm__ __volatile__
+       (
+               "       .set push\n"
+               "       .set mips2\n"
+               "       .set noreorder\n"
+               "       .set nomacro\n"
+               "1:     ll              %0, %1\n"
+               "       move    %2, %3\n"
+               "       sc              %2, %1\n"
+               "       .set pop\n"
+               "       beqz    %2, 1b\n"
+               : "=&r" (retval), "+R" (*dest), "=&r" (temp)
+               : "r" (value)
+               : "memory"
+       );
+       return retval;
+}
+#define IL_HAVE_INTERLOCKED_EXCHANGEI4_FULL 1
+
+/*
+ * Exchange pointers.
+ */
+static IL_INLINE void *ILInterlockedExchangeP_Full(void * volatile *dest,
+                                                                               
                   void *value)
+{
+       void *retval;
+       void *temp;
+
+       __asm__ __volatile__
+       (
+               "       .set push\n"
+               "       .set mips2\n"
+               "       .set noreorder\n"
+               "       .set nomacro\n"
+               "1:     ll              %0, %1\n"
+               "       move    %2, %3\n"
+               "       sc              %2, %1\n"
+               "       .set pop\n"
+               "       beqz    %2, 1b\n"
+               : "=&r" (retval), "+R" (*dest), "=&r" (temp)
+               : "r" (value)
+               : "memory"
+       );
+
+       return retval;
+}
+#define IL_HAVE_INTERLOCKED_EXCHANGEP_FULL 1
+
+/*
+ * Compare and exchange two 32bit integers.
+ */
+static IL_INLINE ILInt32 ILInterlockedCompareAndExchangeI4_Full(volatile 
ILInt32 *dest,
+                                                                               
                                                ILInt32 value,
+                                                                               
                                                ILInt32 comparand)
+{
+       ILInt32 retval;
+       ILInt32 temp;
+
+       __asm__ __volatile__
+       (
+               "       .set push\n"
+               "       .set mips2\n"
+               "       .set noreorder\n"
+               "       .set nomacro\n"
+               "1:     ll              %0, %1\n"
+               "       bne             %0, %4, 2f\n"
+               "       move    %2, %3\n"
+               "       sc              %2, %1\n"
+               "       .set pop\n"
+               "       beqz    %2, 1b\n"
+               "2:"
+               : "=&r" (retval), "+R" (*dest), "=&r" (temp)
+               : "r" (value), "r" (comparand)
+               : "cc"
+       );
+
+       return retval;
+}
+#define IL_HAVE_INTERLOCKED_COMPAREANDEXCHANGEI4_FULL 1
+
+/*
+ * Compare and exchange two pointers
+ */
+static IL_INLINE void *ILInterlockedCompareAndExchangeP_Full(void * volatile 
*dest,
+                                                                               
                                         void *value,
+                                                                               
                                         void *comparand)
+{
+       void *retval;
+       void *temp;
+
+       __asm__ __volatile__
+       (
+               "       .set push\n"
+               "       .set mips2\n"
+               "       .set noreorder\n"
+               "       .set nomacro\n"
+               "1:     ll              %0, %1\n"
+               "       bne             %0, %4, 2f\n"
+               "       move    %2, %3\n"
+               "       sc              %2, %1\n"
+               "       .set pop\n"
+               "       beqz    %2, 1b\n"
+               "2:"
+               : "=&r" (retval), "+R" (*dest), "=&r" (temp)
+               : "r" (value), "r" (comparand)
+               : "cc"
+       );
+
+       return retval;
+}
+#define IL_HAVE_INTERLOCKED_COMPAREANDEXCHANGEP_FULL 1
+
+/*
+ * Add two 32 bit integer values.
+ */
+static IL_INLINE ILInt32 ILInterlockedAddI4_Full(volatile ILInt32 *dest,
+                                                                               
                 ILInt32 value)
+{
+       ILInt32 retval;
+       ILInt32 temp;
+
+       __asm__ __volatile__
+       (
+               "       .set push\n"
+               "       .set mips2\n"
+               "       .set noreorder\n"
+               "       .set nomacro\n"
+               "1:     ll              %0, %1\n"
+               "       add             %2, %0, %3\n"
+               "       move    %0, %2\n"
+               "       sc              %2, %1\n"
+               "       .set pop\n"
+               "       beqz    %2, 1b\n"
+               : "=&r" (retval), "+R" (*dest), "=&r" (temp)
+               : "Ir" (value)
+               : "memory"
+       );
+       return retval;
+}
+#define IL_HAVE_INTERLOCKED_ADDI4_FULL 1
+
+/*
+ * Subtract two 32 bit integer values.
+ */
+static IL_INLINE ILInt32 ILInterlockedSubI4_Full(volatile ILInt32 *dest,
+                                                                               
                 ILInt32 value)
+{
+       ILInt32 retval;
+       ILInt32 temp;
+
+       __asm__ __volatile__
+       (
+               "       .set push\n"
+               "       .set mips2\n"
+               "       .set noreorder\n"
+               "       .set nomacro\n"
+               "1:     ll              %0, %1\n"
+               "       sub             %2, %0, %3\n"
+               "       move    %0, %2\n"
+               "       sc              %2, %1\n"
+               "       .set pop\n"
+               "       beqz    %2, 1b\n"
+               : "=&r" (retval), "+R" (*dest), "=&r" (temp)
+               : "Ir" (value)
+               : "memory"
+       );
+       return retval;
+}
+#define IL_HAVE_INTERLOCKED_SUBI4_FULL 1
+
+#endif /* defined(__GNUC__) */
+
+#endif /* defined(__mips) || defined(__mips__) */

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

Summary of changes:
 ChangeLog                  |    6 +
 support/Makefile.am        |    1 +
 support/interlocked.h      |    1 +
 support/interlocked_mips.h |  227 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 235 insertions(+), 0 deletions(-)
 create mode 100644 support/interlocked_mips.h


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




reply via email to

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