Equivalent to x86 PAUSE instruction for PPC

Is there an equivalent to the x86 PAUSE statement that fits inside wait wait loops to improve performance, especially on SMT machines, on PowerPC?

+6
powerpc spinlock ppc
source share
3 answers

In the Linux kernel, we have this in arch / powerpc / include / asm / processor.h

/* Macros for adjusting thread priority (hardware multi-threading) */ #define HMT_very_low() asm volatile("or 31,31,31 # very low priority") #define HMT_low() asm volatile("or 1,1,1 # low priority") #define HMT_medium_low() asm volatile("or 6,6,6 # medium low priority") #define HMT_medium() asm volatile("or 2,2,2 # medium priority") #define HMT_medium_high() asm volatile("or 5,5,5 # medium high priority") #define HMT_high() asm volatile("or 3,3,3 # high priority") 

I am not familiar with x86 PAUSE, but it sounds like β€œor 31.31.31” - this is what you want.

What powerpc processor are you doing? For SMT, should it be POWER5, 6 or 7?

+10
source share

The PowerPC inside the Cell recognizes certain NOP encodings as an indication for setting the relative priority of two physical threads in the core. The documentation lists the extended mnemonics cctpl , cctpm and cctph for these special NOPs.

From the point of view of other Google results, it looks like there might have been similar NOP special instructions in the IBM RS64 line, so this functionality was probably in the β€œBook IV” of various IBM PowerPC chips for some time.

The Power ISA 2.06 document contains additional special NOP definitions in Chapter 3 with extended mnemonics such as yield , mdoio and mdoom . It also defines the same NOPs as cctpl and cctpm from Cell.

+4
source share

enter image description here

+4
source share

All Articles