From 9ddd6dc93c4f3e0cfe290b33b5af3d544971fe6f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 27 Nov 2018 04:46:51 -0500 Subject: [PATCH] Fix CPU_ProbeDARN test The DARN probe used 64-bit version of the instruction. I think it would have been OK 32-bit binaries, but the 32-bit version is always safe. --- ppc_power9.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ppc_power9.cpp b/ppc_power9.cpp index 970cc19b..38c231f5 100644 --- a/ppc_power9.cpp +++ b/ppc_power9.cpp @@ -107,13 +107,13 @@ bool CPU_ProbeDARN() result = false; else { - // "darn r3, 1" in big- and little-endian + // This is "darn r3, 0". It provides a conditioned 32-bit + // word. It is available on both 32-bit and 64-bit. #if CRYPTOPP_BIG_ENDIAN - __asm__ __volatile__ (".byte 0x7c, 0x61, 0x05, 0xe6 \n" : : : "r3"); + __asm__ __volatile__ (".byte 0x7c, 0x60, 0x05, 0xe6 \n" : : : "r3"); #else - __asm__ __volatile__ (".byte 0xe6, 0x05, 0x61, 0x7c \n" : : : "r3"); + __asm__ __volatile__ (".byte 0xe6, 0x05, 0x60, 0x7c \n" : : : "r3"); #endif - // If we got here without SIGILL then success result = true; }