X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mono%2Fmini%2Fmini-codegen.c;h=6e5bf2f8586b331670c76f02325d0cb7585f3d95;hb=46cccd7feb93e124594e2b225dbca2b3ab0164ea;hp=83057869f3adda11ee34298ea1d3793c30f066ce;hpb=89d5527369717465b43e3145cbecdca3a8601ec4;p=mono.git diff --git a/mono/mini/mini-codegen.c b/mono/mini/mini-codegen.c index 83057869f3a..6e5bf2f8586 100644 --- a/mono/mini/mini-codegen.c +++ b/mono/mini/mini-codegen.c @@ -101,6 +101,7 @@ static const int regbank_move_ops [] = { #define regmask(reg) (((regmask_t)1) << (reg)) +#ifdef MONO_ARCH_USE_SHARED_FP_SIMD_BANK static const regmask_t regbank_callee_saved_regs [] = { MONO_ARCH_CALLEE_SAVED_REGS, MONO_ARCH_CALLEE_SAVED_FREGS, @@ -108,6 +109,7 @@ static const regmask_t regbank_callee_saved_regs [] = { MONO_ARCH_CALLEE_SAVED_REGS, MONO_ARCH_CALLEE_SAVED_XREGS, }; +#endif static const regmask_t regbank_callee_regs [] = { MONO_ARCH_CALLEE_REGS, @@ -409,7 +411,7 @@ typedef struct { regmask_t preferred_mask; /* the hreg where the register should be allocated, or 0 */ } RegTrack; -#ifndef DISABLE_LOGGING +#if !defined(DISABLE_LOGGING) && !defined(DISABLE_JIT) static const char* const patch_info_str[] = { #define PATCH_INFO(a,b) "" #a, @@ -453,9 +455,22 @@ mono_print_ins_index (int i, MonoInst *ins) else printf (" %s", mono_inst_name (ins->opcode)); if (spec == MONO_ARCH_CPU_SPEC) { + gboolean dest_base = FALSE; + switch (ins->opcode) { + case OP_STOREV_MEMBASE: + dest_base = TRUE; + break; + default: + break; + } + /* This is a lowered opcode */ - if (ins->dreg != -1) - printf (" R%d <-", ins->dreg); + if (ins->dreg != -1) { + if (dest_base) + printf (" [R%d + 0x%lx] <-", ins->dreg, (long)ins->inst_offset); + else + printf (" R%d <-", ins->dreg); + } if (ins->sreg1 != -1) printf (" R%d", ins->sreg1); if (ins->sreg2 != -1) @@ -584,11 +599,8 @@ mono_print_ins_index (int i, MonoInst *ins) case OP_CALL_MEMBASE: case OP_CALL_REG: case OP_FCALL: - case OP_FCALLVIRT: case OP_LCALL: - case OP_LCALLVIRT: case OP_VCALL: - case OP_VCALLVIRT: case OP_VCALL_REG: case OP_VCALL_MEMBASE: case OP_VCALL2: @@ -596,7 +608,6 @@ mono_print_ins_index (int i, MonoInst *ins) case OP_VCALL2_MEMBASE: case OP_VOIDCALL: case OP_VOIDCALL_MEMBASE: - case OP_VOIDCALLVIRT: case OP_TAILCALL: { MonoCallInst *call = (MonoCallInst*)ins; GSList *list; @@ -716,7 +727,7 @@ void mono_print_ins_index (int i, MonoInst *ins) { } -#endif /* DISABLE_LOGGING */ +#endif /* !defined(DISABLE_LOGGING) && !defined(DISABLE_JIT) */ void mono_print_ins (MonoInst *ins) @@ -1054,8 +1065,9 @@ assign_reg (MonoCompile *cfg, MonoRegState *rs, int reg, int hreg, int bank) else { g_assert (reg >= MONO_MAX_IREGS); g_assert (hreg < MONO_MAX_IREGS); -#ifndef TARGET_ARM +#if !defined(TARGET_ARM) && !defined(TARGET_ARM64) /* this seems to trigger a gcc compilation bug sometime (hreg is 0) */ + /* On arm64, rgctx_reg is a global hreg, and it is used to pass an argument */ g_assert (! is_global_ireg (hreg)); #endif @@ -1113,7 +1125,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) desc_to_fixed_reg_inited = TRUE; /* Validate the cpu description against the info in mini-ops.h */ -#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM) +#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM) || defined(TARGET_ARM64) for (i = OP_LOAD; i < OP_LAST; ++i) { const char *ispec; @@ -1790,7 +1802,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) continue; s = regmask (j); - if ((clob_mask & s) && !(rs->free_mask [cur_bank] & s) && (j != ins->sreg1)) { + if ((clob_mask & s) && !(rs->free_mask [cur_bank] & s)) { if (j != dreg) free_up_hreg (cfg, bb, tmp, ins, j, cur_bank); else if (rs->symbolic [cur_bank] [j]) @@ -2341,6 +2353,8 @@ mono_opcode_to_cond (int opcode) case OP_CMOV_IEQ: case OP_CMOV_LEQ: return CMP_EQ; + case OP_FCNEQ: + case OP_ICNEQ: case OP_IBNE_UN: case OP_LBNE_UN: case OP_FBNE_UN: @@ -2349,12 +2363,16 @@ mono_opcode_to_cond (int opcode) case OP_CMOV_INE_UN: case OP_CMOV_LNE_UN: return CMP_NE; + case OP_FCLE: + case OP_ICLE: case OP_IBLE: case OP_LBLE: case OP_FBLE: case OP_CMOV_ILE: case OP_CMOV_LLE: return CMP_LE; + case OP_FCGE: + case OP_ICGE: case OP_IBGE: case OP_LBGE: case OP_FBGE: @@ -2386,6 +2404,7 @@ mono_opcode_to_cond (int opcode) case OP_CMOV_LGT: return CMP_GT; + case OP_ICLE_UN: case OP_IBLE_UN: case OP_LBLE_UN: case OP_FBLE_UN: @@ -2394,6 +2413,8 @@ mono_opcode_to_cond (int opcode) case OP_CMOV_ILE_UN: case OP_CMOV_LLE_UN: return CMP_LE_UN; + + case OP_ICGE_UN: case OP_IBGE_UN: case OP_LBGE_UN: case OP_FBGE_UN: @@ -2697,4 +2718,27 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) } } +int +mini_exception_id_by_name (const char *name) +{ + if (strcmp (name, "IndexOutOfRangeException") == 0) + return MONO_EXC_INDEX_OUT_OF_RANGE; + if (strcmp (name, "OverflowException") == 0) + return MONO_EXC_OVERFLOW; + if (strcmp (name, "ArithmeticException") == 0) + return MONO_EXC_ARITHMETIC; + if (strcmp (name, "DivideByZeroException") == 0) + return MONO_EXC_DIVIDE_BY_ZERO; + if (strcmp (name, "InvalidCastException") == 0) + return MONO_EXC_INVALID_CAST; + if (strcmp (name, "NullReferenceException") == 0) + return MONO_EXC_NULL_REF; + if (strcmp (name, "ArrayTypeMismatchException") == 0) + return MONO_EXC_ARRAY_TYPE_MISMATCH; + if (strcmp (name, "ArgumentException") == 0) + return MONO_EXC_ARGUMENT; + g_error ("Unknown intrinsic exception %s\n", name); + return -1; +} + #endif /* DISABLE_JIT */