diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-11-08 15:08:30 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-11-08 15:08:30 -0500 |
commit | cc5eb3919f7f197f1fe5b0e62228542f69b1a9eb (patch) | |
tree | 12782acccf4e17c31406ee178c802830bee244a8 | |
parent | 4ddaa9d01dae87a274d5667d4a5e708bf3bf1b0f (diff) | |
download | cryptopp-git-cc5eb3919f7f197f1fe5b0e62228542f69b1a9eb.tar.gz |
Fix compile using SunCC 5.9
-rw-r--r-- | cpu.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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;
|