Skip to content
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,12 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
ctx.builder.CreateCall(pauseinst);
JL_GC_POP();
return ghostValue(ctx, jl_nothing_type);
} else if (ctx.emission_context.TargetTriple.isPPC64()) {
auto hintinst = InlineAsm::get(FunctionType::get(getVoidTy(ctx.builder.getContext()), false), "or 27,27,27",
"~{memory}", true);
ctx.builder.CreateCall(hintinst);
JL_GC_POP();
return ghostValue(ctx, jl_nothing_type);
} else if (ctx.emission_context.TargetTriple.isAArch64()
|| (ctx.emission_context.TargetTriple.isARM()
&& ctx.emission_context.TargetTriple.getSubArch() != Triple::SubArchType::NoSubArch
Expand Down
4 changes: 4 additions & 0 deletions src/julia_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ JL_DLLEXPORT void *jl_get_ptls_states(void);
# define jl_cpu_pause() __asm__ volatile ("wfe" ::: "memory")
# define jl_cpu_wake() __asm__ volatile ("sev" ::: "memory")
# define JL_CPU_WAKE_NOOP 0
#elif defined(_CPU_PPC64_)
# define jl_cpu_pause() __asm__ volatile ("or 27,27,27" ::: "memory")
# define jl_cpu_wake() ((void)0)
# define JL_CPU_WAKE_NOOP 1
#else
# define jl_cpu_pause() ((void)0)
# define jl_cpu_wake() ((void)0)
Expand Down