From 701daa5298b3befe2aff05ce590533165abb9ba4 Mon Sep 17 00:00:00 2001 From: Rafael Folco Date: Mon, 10 Apr 2017 12:39:38 +0000 Subject: [PATCH] Port CPU_SPINWAIT to __powerpc64__ Hyper-threaded CPUs may need a special instruction inside spin loops in order to yield to another virtual CPU. The 'pause' instruction that is available for x86 is not supported on Power. Apparently the extended mnemonics like yield, mdoio, and mdoom are not actually implemented on POWER8, although mentioned in the ISA 2.07 document. The recommended magic bits are an 'or 31,31,31'. --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 37745c40..894e72d0 100644 --- a/configure.ac +++ b/configure.ac @@ -398,8 +398,9 @@ case "${host_cpu}" in fi fi ;; - powerpc) + powerpc*) AC_DEFINE_UNQUOTED([HAVE_ALTIVEC], [ ]) + CPU_SPINWAIT='__asm__ volatile("or 31,31,31")' ;; *) ;;