Merge branch 'master' into hmqv

pull/263/head
Jeffrey Walton 2016-07-10 16:24:05 -04:00
commit 8ceba46e49
5 changed files with 61 additions and 31 deletions

View File

@ -22,9 +22,14 @@ NAMESPACE_BEGIN(CryptoPP)
# undef CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
#endif
// Testing shows Sun CC needs 12.4 for _mm_set_epi64x
#if (__SUNPRO_CC <= 0x5130)
// SunCC needs 12.4 for _mm_set_epi64x, _mm_blend_epi16, _mm_shuffle_epi16, etc
#if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5130)
# undef CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
#elif (__SUNPRO_CC >= 0x5130)
# include <emmintrin.h> // _mm_set_epi64x
# include <smmintrin.h> // _mm_blend_epi16
# include <tmmintrin.h> // _mm_shuffle_epi16
#endif
// Visual Studio needs VS2008 (1500); no dependency on _mm_set_epi64x()

View File

@ -13,6 +13,11 @@ NAMESPACE_BEGIN(CryptoPP)
# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
#endif
// SunCC 12.4 and above
#if defined(CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE) && (__SUNPRO_CC >= 0x5130)
# include <nmmintrin.h>
#endif
/* Table of CRC-32's of all single byte values (made by makecrc.c) */
const word32 CRC32::m_tab[] = {
#ifdef IS_LITTLE_ENDIAN

View File

@ -22,6 +22,8 @@
# The fastest results (in running time) will most likely use:
# HAVE_VALGRIND=0 WANT_BENCHMARKS=0 ./cryptest.sh
# Using 'fast' is shorthand for it:
# ./cryptest.sh fast
############################################
# Set to suite your taste
@ -343,6 +345,12 @@ else
fi
fi
# Fixup... SunCC appears to botch the code generation
if [[ ("$SUN_COMPILER" -ne "0" )]];then
HAVE_O5=0
OPT_O5=
fi
# Hit or miss, mostly hit
HAVE_OS=0
OPT_OS=
@ -500,7 +508,7 @@ HAVE_X86_AES=0
HAVE_X86_RDRAND=0
HAVE_X86_RDSEED=0
HAVE_X86_PCLMUL=0
if [[ (("$IS_X86" -ne "0") || ("$IS_X64" -ne "0")) ]]; then
if [[ (("$IS_X86" -ne "0") || ("$IS_X64" -ne "0")) && ("$SUN_COMPILER" -eq "0") ]]; then
rm -f "$TMP/adhoc.exe" > /dev/null 2>&1
"$CXX" -DCRYPTOPP_ADHOC_MAIN -maes adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
@ -529,8 +537,9 @@ fi
# ld-gold linker testing
if [[ (-z "$HAVE_LDGOLD") ]]; then
HAVE_LDGOLD=0
LD_GOLD=$(which ld.gold 2>/dev/null | "$GREP" -v "no ld.gold" | head -1)
if [[ (! -z "$LD_GOLD") ]]; then
LD_GOLD=$(which ld.gold 2>&1 | "$GREP" -v "no ld.gold" | head -1)
ELF_FILE=$(which file 2>&1 | "$GREP" -v "no file" | head -1)
if [[ (! -z "$LD_GOLD") && (! -z "$ELF_FILE") ]]; then
HAVE_LDGOLD=$(file "$LD_GOLD" | cut -d":" -f 2 | "$EGREP" -i -c "elf")
fi
fi

View File

@ -68,7 +68,7 @@
#if defined(CRYPTOPP_CPUID_AVAILABLE)
# define MSC_INTRIN_COMPILER ((CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210))
# define GCC_INTRIN_COMPILER ((CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210))
# define GCC_INTRIN_COMPILER ((CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) || (__SUNPRO_CC >= 0x5130)
#else
# define MSC_INTRIN_COMPILER 0
# define GCC_INTRIN_COMPILER 0
@ -99,6 +99,17 @@
# elif CRYPTOPP_BOOL_RDSEED_ASM
# define GCC_RDSEED_ASM_AVAILABLE 1
# endif
#elif defined(CRYPTOPP_CPUID_AVAILABLE) && (__SUNPRO_CC >= 0x5100)
# if GCC_INTRIN_COMPILER && defined(__RDRND__) && (__SUNPRO_CC >= 0x5130)
# define ALL_RDRAND_INTRIN_AVAILABLE 1
# elif CRYPTOPP_BOOL_RDRAND_ASM
# define GCC_RDRAND_ASM_AVAILABLE 1
# endif
# if GCC_INTRIN_COMPILER && defined(__RDSEED__) && (__SUNPRO_CC >= 0x5150)
# define ALL_RDSEED_INTRIN_AVAILABLE 1
# elif CRYPTOPP_BOOL_RDSEED_ASM
# define GCC_RDSEED_ASM_AVAILABLE 1
# endif
#endif
// Debug diagnostics
@ -131,7 +142,7 @@
/////////////////////////////////////////////////////////////////////
#if (ALL_RDRAND_INTRIN_AVAILABLE || ALL_RDSEED_INTRIN_AVAILABLE)
# include <immintrin.h> // rdrand, MSC, ICC, and GCC
# include <immintrin.h> // rdrand, MSC, ICC, GCC, and SunCC
# if defined(__GNUC__) && (CRYPTOPP_GCC_VERSION >= 40600)
# include <x86intrin.h> // rdseed for some compilers, like GCC
# endif