Author: zoltan
Date: 2008-02-06 16:47:04 -0500 (Wed, 06 Feb 2008)
New Revision: 95083
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/mini-s390.c
trunk/mono/mono/mini/mini-s390.h
trunk/mono/mono/mini/mini-s390x.c
trunk/mono/mono/mini/mini-s390x.h
Log:
2008-02-06 Zoltan Varga <[EMAIL PROTECTED]>
* mini-s390.c (mono_arch_get_inst_for_method): Remove the Interlocked
cases
as they are handled in mini.c.
* mini-s390x.c (mono_arch_get_inst_for_method): Ditto.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2008-02-06 21:45:20 UTC (rev 95082)
+++ trunk/mono/mono/mini/ChangeLog 2008-02-06 21:47:04 UTC (rev 95083)
@@ -1,5 +1,10 @@
2008-02-06 Zoltan Varga <[EMAIL PROTECTED]>
+ * mini-s390.c (mono_arch_get_inst_for_method): Remove the Interlocked
cases
+ as they are handled in mini.c.
+
+ * mini-s390x.c (mono_arch_get_inst_for_method): Ditto.
+
* mini-<ARCH>.c (mono_arch_get_inst_for_method): Remove the
MemoryBarrier
case since it is handled in mini.c.
Modified: trunk/mono/mono/mini/mini-s390.c
===================================================================
--- trunk/mono/mono/mini/mini-s390.c 2008-02-06 21:45:20 UTC (rev 95082)
+++ trunk/mono/mono/mini/mini-s390.c 2008-02-06 21:47:04 UTC (rev 95083)
@@ -4776,44 +4776,8 @@
MONO_INST_NEW (cfg, ins, OP_SQRT);
ins->inst_i0 = args [0];
}
- } else if(cmethod->klass->image == mono_defaults.corlib &&
- (strcmp (cmethod->klass->name_space,
"System.Threading") == 0) &&
- (strcmp (cmethod->klass->name, "Interlocked") == 0))
{
-
- if (strcmp (cmethod->name, "Increment") == 0 &&
- fsig->params [0]->type == MONO_TYPE_I4) {
- MonoInst *ins_iconst;
-
- MONO_INST_NEW (cfg, ins, OP_ATOMIC_ADD_NEW_I4);
- MONO_INST_NEW (cfg, ins_iconst, OP_ICONST);
- ins_iconst->inst_c0 = 1;
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = ins_iconst;
- } else if (strcmp (cmethod->name, "Decrement") == 0 &&
- fsig->params [0]->type == MONO_TYPE_I4) {
- MonoInst *ins_iconst;
-
- MONO_INST_NEW (cfg, ins, OP_ATOMIC_ADD_NEW_I4);
- MONO_INST_NEW (cfg, ins_iconst, OP_ICONST);
- ins_iconst->inst_c0 = -1;
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = ins_iconst;
- } else if (strcmp (cmethod->name, "Exchange") == 0 &&
- fsig->params [0]->type == MONO_TYPE_I4) {
- MONO_INST_NEW (cfg, ins, OP_ATOMIC_EXCHANGE_I4);
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = args [1];
- } else if (strcmp (cmethod->name, "Add") == 0 &&
- fsig->params [0]->type == MONO_TYPE_I4) {
- MONO_INST_NEW (cfg, ins, OP_ATOMIC_ADD_I4);
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = args [1];
- }
}
+
return ins;
}
Modified: trunk/mono/mono/mini/mini-s390.h
===================================================================
--- trunk/mono/mono/mini/mini-s390.h 2008-02-06 21:45:20 UTC (rev 95082)
+++ trunk/mono/mono/mini/mini-s390.h 2008-02-06 21:47:04 UTC (rev 95083)
@@ -157,6 +157,8 @@
#define MONO_ARCH_EMULATE_LMUL 1
#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
#define MONO_ARCH_NEED_DIV_CHECK 1
+#define MONO_ARCH_HAVE_ATOMIC_ADD 1
+#define MONO_ARCH_HAVE_ATOMIC_EXCHANGE 1
// #define MONO_ARCH_SIGSEGV_ON_ALTSTACK 1
// #define MONO_ARCH_SIGNAL_STACK_SIZE 65536
// #define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1
Modified: trunk/mono/mono/mini/mini-s390x.c
===================================================================
--- trunk/mono/mono/mini/mini-s390x.c 2008-02-06 21:45:20 UTC (rev 95082)
+++ trunk/mono/mono/mini/mini-s390x.c 2008-02-06 21:47:04 UTC (rev 95083)
@@ -4947,80 +4947,8 @@
// MONO_INST_NEW (cfg, ins, OP_ABS);
// ins->inst_i0 = args [0];
// }
- } else if(cmethod->klass->image == mono_defaults.corlib &&
- (strcmp (cmethod->klass->name_space,
"System.Threading") == 0) &&
- (strcmp (cmethod->klass->name, "Interlocked") == 0))
{
-
- if (strcmp (cmethod->name, "Increment") == 0) {
- MonoInst *ins_iconst;
- guint32 opcode = 0;
-
- if (fsig->params [0]->type == MONO_TYPE_I4)
- opcode = OP_ATOMIC_ADD_NEW_I4;
- else if (fsig->params [0]->type == MONO_TYPE_I8)
- opcode = OP_ATOMIC_ADD_NEW_I8;
- else
- g_assert_not_reached ();
-
- MONO_INST_NEW (cfg, ins, opcode);
- MONO_INST_NEW (cfg, ins_iconst, OP_ICONST);
- ins_iconst->inst_c0 = 1;
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = ins_iconst;
- } else if (strcmp (cmethod->name, "Decrement") == 0) {
- MonoInst *ins_iconst;
- guint32 opcode = 0;
-
- if (fsig->params [0]->type == MONO_TYPE_I4)
- opcode = OP_ATOMIC_ADD_NEW_I4;
- else if (fsig->params [0]->type == MONO_TYPE_I8)
- opcode = OP_ATOMIC_ADD_NEW_I8;
- else
- g_assert_not_reached ();
- MONO_INST_NEW (cfg, ins, opcode);
- MONO_INST_NEW (cfg, ins_iconst, OP_ICONST);
- ins_iconst->inst_c0 = -1;
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = ins_iconst;
- /* FIXME: */
- } else if (strcmp (cmethod->name, "Exchange") == 0) {
- guint32 opcode = 0;
-
- if (fsig->params [0]->type == MONO_TYPE_I4)
- opcode = OP_ATOMIC_EXCHANGE_I4;
- else if ((fsig->params [0]->type == MONO_TYPE_I8) ||
- (fsig->params [0]->type ==
MONO_TYPE_I) ||
- (fsig->params [0]->type ==
MONO_TYPE_OBJECT))
- opcode = OP_ATOMIC_EXCHANGE_I8;
- else
- return NULL;
-
- MONO_INST_NEW (cfg, ins, opcode);
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = args [1];
- } else if (strcmp (cmethod->name, "Add") == 0) {
- guint32 opcode = 0;
-
- if (fsig->params [0]->type == MONO_TYPE_I4)
- opcode = OP_ATOMIC_ADD_I4;
- else if (fsig->params [0]->type == MONO_TYPE_I8)
- opcode = OP_ATOMIC_ADD_I8;
- else
- g_assert_not_reached ();
-
- MONO_INST_NEW (cfg, ins, opcode);
-
- ins->inst_i0 = args [0];
- ins->inst_i1 = args [1];
- } else if ((strcmp (cmethod->name, "Read") == 0 &&
- (fsig->params [0]->type == MONO_TYPE_I8))) {
- MONO_INST_NEW (cfg, ins, CEE_LDIND_I8);
- ins->inst_i0 = args [0];
- }
}
+
return ins;
}
Modified: trunk/mono/mono/mini/mini-s390x.h
===================================================================
--- trunk/mono/mono/mini/mini-s390x.h 2008-02-06 21:45:20 UTC (rev 95082)
+++ trunk/mono/mono/mini/mini-s390x.h 2008-02-06 21:47:04 UTC (rev 95083)
@@ -175,6 +175,8 @@
#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS 1
#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
#define MONO_ARCH_NEED_DIV_CHECK 1
+#define MONO_ARCH_HAVE_ATOMIC_ADD 1
+#define MONO_ARCH_HAVE_ATOMIC_EXCHANGE 1
#define MONO_ARCH_SIGNAL_STACK_SIZE 256*1024
// #define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches