Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ppc64le] Bug fixes - Backport #77202

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/mono/mono/mini/mini-ppc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3782,23 +3782,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
ppc_addis (code, ppc_r12, cfg->frame_reg, ppc_ha(cfg->stack_usage));
ppc_addi (code, ppc_r12, ppc_r12, cfg->stack_usage);
}
if (!cfg->method->save_lmf) {
pos = 0;
for (i = 31; i >= 13; --i) {
if (cfg->used_int_regs & (1 << i)) {
pos += sizeof (target_mgreg_t);
ppc_ldptr (code, i, -pos, ppc_r12);
}
}
} else {
/* FIXME restore from MonoLMF: though this can't happen yet */
}

/* Copy arguments on the stack to our argument area */
if (call->stack_usage) {
code = emit_memcpy (code, call->stack_usage, ppc_r12, PPC_STACK_PARAM_OFFSET, ppc_sp, PPC_STACK_PARAM_OFFSET);
/* r12 was clobbered */
g_assert (cfg->frame_reg == ppc_sp);
if (ppc_is_imm16 (cfg->stack_usage)) {
ppc_addi (code, ppc_r12, cfg->frame_reg, cfg->stack_usage);
} else {
Expand All @@ -3809,6 +3797,18 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
}
}

if (!cfg->method->save_lmf) {
pos = 0;
for (i = 31; i >= 13; --i) {
if (cfg->used_int_regs & (1 << i)) {
pos += sizeof (target_mgreg_t);
ppc_ldptr (code, i, -pos, ppc_r12);
}
}
} else {
/* FIXME restore from MonoLMF: though this can't happen yet */
}

ppc_mr (code, ppc_sp, ppc_r12);
mono_add_patch_info (cfg, (guint8*) code - cfg->native_code, MONO_PATCH_INFO_METHOD_JUMP, call->method);
cfg->thunk_area += THUNK_SIZE;
Expand Down Expand Up @@ -3837,7 +3837,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
}
case OP_CHECK_THIS:
/* ensure ins->sreg1 is not NULL */
ppc_ldptr (code, ppc_r0, 0, ins->sreg1);
ppc_lbz (code, ppc_r0, 0, ins->sreg1);
break;
case OP_ARGLIST: {
long cookie_offset = cfg->sig_cookie + cfg->stack_usage;
Expand Down