Extract the code to emit a memory barrier. Add a memory_barrier_kind field to MonoIns...
[mono.git] / mono / mini / cfold.c
index ab343a50b174f68b3dba1c6b640ddbb665928bdc..d9e35d4702ed2ccd72b686482737bd05be03f6d3 100644 (file)
@@ -137,7 +137,7 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns
                                FOLD_BINOPC2_IMM (OP_ISHL_IMM, <<, gint32);
                                FOLD_BINOPC2_IMM (OP_ISHR_IMM, >>, gint32);
                                FOLD_BINOPC2_IMM (OP_ISHR_UN_IMM, >>, guint32);
-                               FOLD_BINOPC2_IMM (OP_SHL_IMM, <<, gint32);
+                               FOLD_BINOP2_IMM (OP_SHL_IMM, <<);
                        }
                        dest->opcode = OP_ICONST;
                        MONO_INST_NULLIFY_SREGS (dest);
@@ -202,8 +202,10 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns
        case OP_INEG:
                if (arg1->opcode == OP_ICONST) {
                        /* INEG sets cflags on x86, and the LNEG decomposition depends on that */
-                       if ((ins->opcode == OP_INEG) && ins->next && (ins->next->opcode == OP_ADC_IMM))
+#if SIZEOF_REGISTER == 4
+                       if (ins->opcode == OP_INEG)
                                return NULL;
+#endif
                        ALLOC_DEST (cfg, dest, ins);
                        switch (ins->opcode) {
                                FOLD_UNOP (OP_INEG,-);