Merge pull request #1949 from lewurm/fixtype
[mono.git] / mono / mini / decompose.c
index a11ca3c103f38c8dc651d6dcd1555cf2b1408227..a9b7e0a68f1cfa9e8818da89606bb35c01894422 100644 (file)
@@ -299,7 +299,7 @@ decompose_long_opcode (MonoCompile *cfg, MonoInst *ins, MonoInst **repl_ins)
  * Sets the cfg exception if an opcode is not supported.
  */
 MonoInst*
-mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins, MonoBasicBlock **out_cbb)
+mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins)
 {
        MonoInst *repl = NULL;
        int type = ins->type;
@@ -307,10 +307,7 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins, MonoBasicBlock **out_cbb
        gboolean emulate = FALSE;
 
        /* FIXME: Instead of = NOP, don't emit the original ins at all */
-
-#ifdef MONO_ARCH_HAVE_DECOMPOSE_OPTS
        mono_arch_decompose_opts (cfg, ins);
-#endif
 
        /*
         * The code below assumes that we are called immediately after emitting 
@@ -446,7 +443,7 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins, MonoBasicBlock **out_cbb
                cfg->exception_message = g_strdup_printf ("float conv.ovf.un opcodes not supported.");
                break;
 
-#if defined(MONO_ARCH_EMULATE_DIV) && defined(MONO_ARCH_HAVE_OPCODE_NEEDS_EMULATION)
+#if defined(MONO_ARCH_EMULATE_DIV)
        case OP_IDIV:
        case OP_IREM:
        case OP_IDIV_UN:
@@ -466,7 +463,7 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins, MonoBasicBlock **out_cbb
                                MONO_EMIT_NEW_UNALU (cfg, OP_ICEQ, reg2, -1);
                                MONO_EMIT_NEW_BIALU (cfg, OP_IAND, reg1, reg1, reg2);
                                MONO_EMIT_NEW_ICOMPARE_IMM (cfg, reg1, 1);
-                               MONO_EMIT_NEW_COND_EXC (cfg, IEQ, "DivideByZeroException");
+                               MONO_EMIT_NEW_COND_EXC (cfg, IEQ, "OverflowException");
                        }
 #endif
                        MONO_EMIT_NEW_BIALU (cfg, ins->opcode, ins->dreg, ins->sreg1, ins->sreg2);
@@ -556,7 +553,7 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins, MonoBasicBlock **out_cbb
                                }
                        }
 
-                       call = mono_emit_jit_icall_by_info (cfg, info, args, out_cbb);
+                       call = mono_emit_jit_icall_by_info (cfg, info, args);
                        call->dreg = ins->dreg;
 
                        NULLIFY_INS (ins);
@@ -639,10 +636,7 @@ mono_decompose_long_opts (MonoCompile *cfg)
                cfg->cbb->code = cfg->cbb->last_ins = NULL;
 
                while (tree) {
-
-#ifdef MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS
                        mono_arch_decompose_long_opts (cfg, tree);
-#endif
 
                        switch (tree->opcode) {
                        case OP_I8CONST: