Skip to content

Commit

Permalink
Fixing #3121
Browse files Browse the repository at this point in the history
This patch fixes #3121 by adding the proper instructions for SMT_PAUSE for the "big three", for everything else, the fence instruction is used.
  • Loading branch information
sithhell committed Jan 23, 2018
1 parent 29da281 commit 4c7c746
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hpx/config/compiler_fence.hpp
Expand Up @@ -26,7 +26,17 @@ extern "C" void _mm_pause();
#elif defined(__GNUC__)

#define HPX_COMPILER_FENCE __asm__ __volatile__( "" : : : "memory" )

#if defined(__i386__) || defined(__x86_64__)
#define HPX_SMT_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" )
#elif defined(__ppc__)
// According to: https://stackoverflow.com/questions/5425506/equivalent-of-x86-pause-instruction-for-ppc
#define HPX_SMT_PAUSE __asm__ __volatile__("or 27,27,27")
#elif defined(__arm__)
#define HPX_SMT_PAUSE __asm__ __volatile__("yield")
#else
#define HPX_SMT_PAUSE HPX_COMPILER_FENCE
#endif

#else

Expand Down

0 comments on commit 4c7c746

Please sign in to comment.