[kaffe] CVS kaffe (guilhem): More fixes for Irix/MIPS.
Kaffe CVS
cvs-commits at kaffe.org
Tue Jun 21 06:01:46 PDT 2005
PatchSet 6651
Date: 2005/06/21 12:56:30
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
More fixes for Irix/MIPS.
2005-06-21 Guilhem Lavaux <guilhem at kaffe.org>
Riccardo Mottola <rmottola at users.sf.net>
* config/mips/atomic.h: Rearranged the inlined assembly to make it
compile on Irix.
* config/mips/common.h: Enabled full atomic operations.
* configure.ac: Add '-mips2' to the command line if we are on
Irix/MIPS.
* configure: Regenerated.
Members:
ChangeLog:1.4177->1.4178
configure:1.460->1.461
configure.ac:1.145->1.146
config/mips/atomic.h:1.2->1.3
config/mips/common.h:1.17->1.18
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4177 kaffe/ChangeLog:1.4178
--- kaffe/ChangeLog:1.4177 Tue Jun 21 08:13:12 2005
+++ kaffe/ChangeLog Tue Jun 21 12:56:30 2005
@@ -1,7 +1,20 @@
+2005-06-21 Guilhem Lavaux <guilhem at kaffe.org>
+ Riccardo Mottola <rmottola at users.sf.net>
+
+ * config/mips/atomic.h: Rearranged the inlined assembly to make it
+ compile on Irix.
+
+ * config/mips/common.h: Enabled full atomic operations.
+
+ * configure.ac: Add '-mips2' to the command line if we are on
+ Irix/MIPS.
+
+ * configure: Regenerated.
+
2005-06-20 Riccardo Mottola <rmottola at users.sf.net>
- * config/mips/atomic.h: patched to use internal config-int.h header and
-not c99 stdint.h
+ * config/mips/atomic.h: patched to use internal config-int.h header
+ and not c99 stdint.h
2005-06-19 Guilhem Lavaux <guilhem at kaffe.org>
Index: kaffe/configure
diff -u kaffe/configure:1.460 kaffe/configure:1.461
--- kaffe/configure:1.460 Sun Jun 19 13:47:19 2005
+++ kaffe/configure Tue Jun 21 12:56:32 2005
@@ -33096,6 +33096,11 @@
_ACEOF
enable_mips2=yes
+ case "$Khost_os" in
+ linux*)
+ CFLAGS="$CFLAGS -mips2"
+ ;;
+ esac
fi
echo "$as_me:$LINENO: result: $enable_mips2" >&5
echo "${ECHO_T}$enable_mips2" >&6
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.145 kaffe/configure.ac:1.146
--- kaffe/configure.ac:1.145 Wed Jun 15 09:56:28 2005
+++ kaffe/configure.ac Tue Jun 21 12:56:38 2005
@@ -1238,6 +1238,11 @@
if test x"$enable_mips2" != x"no"; then
AC_DEFINE([HAVE_MIPSII_INSTRUCTIONS], 1, [Enable MIPS II instructions])
enable_mips2=yes
+ case "$Khost_os" in
+ linux*)
+ CFLAGS="$CFLAGS -mips2"
+ ;;
+ esac
fi
AC_MSG_RESULT($enable_mips2)
Index: kaffe/config/mips/atomic.h
diff -u kaffe/config/mips/atomic.h:1.2 kaffe/config/mips/atomic.h:1.3
--- kaffe/config/mips/atomic.h:1.2 Tue Jun 21 08:13:11 2005
+++ kaffe/config/mips/atomic.h Tue Jun 21 12:56:41 2005
@@ -6,7 +6,6 @@
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. */
-/* Modified to get it work on all kaffe's platforms. */
#include "config-int.h"
#include <sgidefs.h>
@@ -25,6 +24,10 @@
typedef intmax_t atomic_max_t;
typedef uintmax_t uatomic_max_t;
+#if !defined(__GNUC__) || (__GNUC__ <= 2 && __GNUC_MINOR__ <= 95)
+#define __builtin_trap abort
+#endif
+
/*
* MIPS does not have byte and halfword forms of load linked and store
* conditional. So for MIPS we stub out the 8- and 16-bit forms.
@@ -57,50 +60,46 @@
#define __arch_compare_and_exchange_xxx_32_int(mem, new, old, mb1, mb2) \
({ \
__asm__ __volatile__ ( \
- " .set push\n" \
- " .set mips2\n" \
" .set noreorder\n" \
mb1 \
- "1: ll %[__prev],%[__mem]\n" \
- " bne %[__prev],%[__old],2f\n" \
- " li %[__cmp],0\n" \
- " move %[__cmp],%[__new]\n" \
- " sc %[__cmp],%[__mem]\n" \
- " beqz %[__cmp],1b\n" \
+ "1: ll %0,%2\n" \
+ " li %1,0\n" \
+ " bne %0,%3,2f\n" \
+ " move %1,%4\n" \
+ " sc %1,%2\n" \
+ " beqz %1,1b\n" \
" nop\n" \
mb2 \
"2:\n" \
- " .set pop" \
- : [__prev] "=&r" (__prev), \
- [__cmp] "=&r" (__cmp) \
- : [__mem] "R" (*(volatile atomic32_t *)(mem)), \
- [__old] "r" ((atomic32_t)(old)), \
- [__new] "r" ((atomic32_t)(new)) \
+ " .set reorder\n" \
+ : "=&r" (__prev), \
+ "=&r" (__cmp) \
+ : "R" (*(volatile atomic32_t *)(mem)), \
+ "r" ((atomic32_t)(old)), \
+ "r" ((atomic32_t)(new)) \
: "memory"); \
})
#define __arch_compare_and_exchange_xxx_64_int(mem, new, old, mb1, mb2) \
({ \
__asm__ __volatile__ ( \
- " .set push\n" \
- " .set mips3\n" \
" .set noreorder\n" \
mb1 \
- "1: lld %[__prev],%[__mem]\n" \
- " bne %[__prev],%[__old],2f\n" \
- " li %[__cmp],0\n" \
- " move %[__cmp],%[__new]\n" \
- " scd %[__cmp],%[__mem]\n" \
- " beqz %[__cmp],1b\n" \
+ "1: lld %0,%2\n" \
+ " li %1,0\n" \
+ " bne %0,%3,2f\n" \
+ " move %1,%4\n" \
+ " scd %1,%2\n" \
+ " beqz %1,1b\n" \
" nop\n" \
mb2 \
"2:\n" \
- " .set pop" \
- : [__prev] "=&r" (__prev), \
- [__cmp] "=&r" (__cmp) \
- : [__mem] "R" (*(volatile atomic32_t *)(mem)), \
- [__old] "r" ((atomic64_t)(old)), \
- [__new] "r" ((atomic64_t)(new)) \
+ " .set reorder" \
+ : "=&r" (__prev), \
+ "=&r" (__cmp) \
+ : "R" (*(volatile atomic32_t *)(mem)), \
+ "r" ((atomic64_t)(old)), \
+ "r" ((atomic64_t)(new)) \
: "memory"); \
})
Index: kaffe/config/mips/common.h
diff -u kaffe/config/mips/common.h:1.17 kaffe/config/mips/common.h:1.18
--- kaffe/config/mips/common.h:1.17 Sun Apr 17 20:36:41 2005
+++ kaffe/config/mips/common.h Tue Jun 21 12:56:41 2005
@@ -37,7 +37,7 @@
/* Atomicity is temporarily disabled because the compare_and_swap function
* do not return the right value. Use the generic one instead.
*/
-#if defined(HAVE_MIPSII_INSTRUCTIONS) && 0
+#if defined(HAVE_MIPSII_INSTRUCTIONS)
#include "atomic.h"
#else
More information about the kaffe
mailing list