Fix compile using SunCC 5.9

pull/737/head
Jeffrey Walton 2018-11-08 15:08:30 -05:00
parent 4ddaa9d01d
commit cc5eb3919f
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 3 additions and 1 deletions

View File

@ -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;