Skip to content

Commit

Permalink
Implementation of opcode OP_GC_SAFE_POINT for ppc64le (dotnet#72997)
Browse files Browse the repository at this point in the history
* Avoid transformation from multiplication to left shift in case of 64 bit value

* Fixed System.Collections.Concurrent.Tests timeout issue
  • Loading branch information
alhad-deshpande authored Jul 29, 2022
1 parent 1c055bb commit cc7edab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mono/mono/mini/cpu-ppc.mdesc
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,4 @@ atomic_cas_i4: src1:b src2:i src3:i dest:i len:38

liverange_start: len:0
liverange_end: len:0
gc_safe_point: len:0
gc_safe_point: clob:c src1:i len:40
2 changes: 1 addition & 1 deletion src/mono/mono/mini/cpu-ppc64.mdesc
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,4 @@ atomic_cas_i8: src1:b src2:i src3:i dest:i len:38

liverange_start: len:0
liverange_end: len:0
gc_safe_point: len:0
gc_safe_point: clob:c src1:i len:40
19 changes: 17 additions & 2 deletions src/mono/mono/mini/mini-ppc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4574,9 +4574,24 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
MONO_VARINFO (cfg, ins->inst_c0)->live_range_end = code - cfg->native_code;
break;
}
case OP_GC_SAFE_POINT:
case OP_GC_SAFE_POINT: {
guint8 *br;
ppc_ldr (code, ppc_r0, 0, ins->sreg1);
ppc_cmpi (code, 0, 0, ppc_r0, 0);
br = code;
ppc_bc (code, PPC_BR_TRUE, PPC_BR_EQ, 0);
mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_JIT_ICALL_ID,
GUINT_TO_POINTER (MONO_JIT_ICALL_mono_threads_state_poll));
if ((FORCE_INDIR_CALL || cfg->method->dynamic) && !cfg->compile_aot) {
ppc_load_func (code, PPC_CALL_REG, 0);
ppc_mtlr (code, PPC_CALL_REG);
ppc_blrl (code);
} else {
ppc_bl (code, 0);
}
ppc_patch (br, code);
break;

}
default:
g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
g_assert_not_reached ();
Expand Down

0 comments on commit cc7edab

Please sign in to comment.