From cc5eb3919f7f197f1fe5b0e62228542f69b1a9eb Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 8 Nov 2018 15:08:30 -0500 Subject: Fix compile using SunCC 5.9 --- cpu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpu.cpp b/cpu.cpp index 0330451b..92d525da 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -315,7 +315,7 @@ void DetectX86Features() if ((cpuid1[2] & AVX_FLAG) == AVX_FLAG) { // GCC 4.1/Binutils 2.17 cannot consume xgetbv -#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__BORLANDC__) +#if defined(__GNUC__) || (__SUNPRO_CC >= 0x5100) || defined(__BORLANDC__) // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659 and // http://www.agner.org/optimize/vectorclass/read.php?i=65 word32 a=0, d=0; @@ -352,6 +352,8 @@ void DetectX86Features() #elif defined(_MSC_VER) && defined(_M_X64) word64 xcr0 = ExtendedControlRegister(0); g_hasAVX = (xcr0 & YMM_FLAG) == YMM_FLAG; +#elif defined(__SUNPRO_CC) // fall into + g_hasAVX = false; #else word64 xcr0 = _xgetbv(0); g_hasAVX = (xcr0 & YMM_FLAG) == YMM_FLAG; -- cgit v1.2.1