Cleanup comments and old code artifacts

pull/548/head
Jeffrey Walton 2017-11-15 21:11:42 -05:00
parent e8bed05b7d
commit c49b6d4d71
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 17 additions and 31 deletions

View File

@ -98,7 +98,7 @@ ifeq ($(IS_AIX),1)
endif endif
endif endif
# Newlib needs _XOPEN_SOURCE=700 for signals # Newlib needs _XOPEN_SOURCE=600 for signals
HAS_NEWLIB := $(shell $(CXX) -x c++ $(CXXFLAGS) -dM -E adhoc.cpp.proto 2>&1 | $(GREP) -i -c "__NEWLIB__") HAS_NEWLIB := $(shell $(CXX) -x c++ $(CXXFLAGS) -dM -E adhoc.cpp.proto 2>&1 | $(GREP) -i -c "__NEWLIB__")
########################################################### ###########################################################
@ -267,25 +267,25 @@ endif # -DCRYPTOPP_DISABLE_SSSE3
# Begin SunCC # Begin SunCC
ifeq ($(SUN_COMPILER),1) ifeq ($(SUN_COMPILER),1)
COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=ssse3 -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal value ignored") COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=ssse3 -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal")
ifeq ($(COUNT),0) ifeq ($(COUNT),0)
SSSE3_FLAG = -xarch=ssse3 -D__SSSE3__=1 SSSE3_FLAG = -xarch=ssse3 -D__SSSE3__=1
ARIA_FLAG = -xarch=ssse3 -D__SSSE3__=1 ARIA_FLAG = -xarch=ssse3 -D__SSSE3__=1
LDFLAGS += -xarch=ssse3 LDFLAGS += -xarch=ssse3
endif endif
COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=sse4_2 -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal value ignored") COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=sse4_2 -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal")
ifeq ($(COUNT),0) ifeq ($(COUNT),0)
BLAKE2_FLAG = -xarch=sse4_2 -D__SSE4_2__=1 BLAKE2_FLAG = -xarch=sse4_2 -D__SSE4_2__=1
CRC_FLAG = -xarch=sse4_2 -D__SSE4_2__=1 CRC_FLAG = -xarch=sse4_2 -D__SSE4_2__=1
LDFLAGS += -xarch=sse4_2 LDFLAGS += -xarch=sse4_2
endif endif
COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=aes -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal value ignored") COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=aes -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal")
ifeq ($(COUNT),0) ifeq ($(COUNT),0)
GCM_FLAG = -xarch=aes -D__PCLMUL__=1 GCM_FLAG = -xarch=aes -D__PCLMUL__=1
AES_FLAG = -xarch=aes -D__AES__=1 AES_FLAG = -xarch=aes -D__AES__=1
LDFLAGS += -xarch=aes LDFLAGS += -xarch=aes
endif endif
COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=sha -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal value ignored") COUNT := $(shell $(CXX) $(CXXFLAGS) -E -xarch=sha -xdumpmacros /dev/null 2>&1 | $(GREP) -i -c "illegal")
ifeq ($(COUNT),0) ifeq ($(COUNT),0)
SHA_FLAG = -xarch=sha -D__SHA__=1 SHA_FLAG = -xarch=sha -D__SHA__=1
LDFLAGS += -xarch=sha LDFLAGS += -xarch=sha

View File

@ -30,24 +30,16 @@
# include <arm_neon.h> # include <arm_neon.h>
#endif #endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
# include <signal.h>
# include <setjmp.h>
#endif
#ifndef EXCEPTION_EXECUTE_HANDLER
# define EXCEPTION_EXECUTE_HANDLER 1
#endif
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670 // Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670
#define M128_CAST(x) ((__m128i *)(void *)(x)) #define M128_CAST(x) ((__m128i *)(void *)(x))
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x)) #define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(CryptoPP)
// Sun Studio 12.3 and earlier lack SSE2's _mm_set_epi64x. Win32 lacks _mm_set_epi64x, Win64 supplies it except for VS2008. // Sun Studio 12.3 and earlier lack SSE2's _mm_set_epi64x. Win32 lacks _mm_set_epi64x,
// Also see http://stackoverflow.com/a/38547909/608639 // Win64 supplies it except for VS2008. See http://stackoverflow.com/a/38547909/608639
#if CRYPTOPP_SSE2_INTRIN_AVAILABLE && ((__SUNPRO_CC >= 0x5100 && __SUNPRO_CC < 0x5130) || (defined(_MSC_VER) && _MSC_VER < 1600) || (defined(_M_IX86) && _MSC_VER >= 1600)) #if CRYPTOPP_SSE2_INTRIN_AVAILABLE && ((__SUNPRO_CC >= 0x5100 && __SUNPRO_CC < 0x5130) || \
(defined(_MSC_VER) && _MSC_VER < 1600) || (defined(_M_IX86) && _MSC_VER >= 1600))
inline __m128i MM_SET_EPI64X(const word64 a, const word64 b) inline __m128i MM_SET_EPI64X(const word64 a, const word64 b)
{ {
const word64 t[2] = {b,a}; __m128i r; const word64 t[2] = {b,a}; __m128i r;

View File

@ -89,32 +89,26 @@ typedef void (*pfnCompress64)(const byte*, BLAKE2_State<word64, true>&);
pfnCompress64 InitializeCompress64Fn() pfnCompress64 InitializeCompress64Fn()
{ {
return
#if CRYPTOPP_SSE41_AVAILABLE #if CRYPTOPP_SSE41_AVAILABLE
if (HasSSE41()) HasSSE41() ? &BLAKE2_Compress64_SSE4 :
return &BLAKE2_Compress64_SSE4;
else
#endif #endif
#if CRYPTOPP_BOOL_ARM32 && CRYPTOPP_ARM_NEON_AVAILABLE #if CRYPTOPP_BOOL_ARM32 && CRYPTOPP_ARM_NEON_AVAILABLE
if (HasNEON()) HasNEON() ? &BLAKE2_Compress64_NEON :
return &BLAKE2_Compress64_NEON;
else
#endif #endif
return &BLAKE2_Compress64_CXX; &BLAKE2_Compress64_CXX;
} }
pfnCompress32 InitializeCompress32Fn() pfnCompress32 InitializeCompress32Fn()
{ {
return
#if CRYPTOPP_SSE41_AVAILABLE #if CRYPTOPP_SSE41_AVAILABLE
if (HasSSE41()) HasSSE41() ? &BLAKE2_Compress32_SSE4 :
return &BLAKE2_Compress32_SSE4;
else
#endif #endif
#if CRYPTOPP_BOOL_ARM32 && CRYPTOPP_ARM_NEON_AVAILABLE #if CRYPTOPP_BOOL_ARM32 && CRYPTOPP_ARM_NEON_AVAILABLE
if (HasNEON()) HasNEON() ? &BLAKE2_Compress32_NEON :
return &BLAKE2_Compress32_NEON;
else
#endif #endif
return &BLAKE2_Compress32_CXX; &BLAKE2_Compress32_CXX;
} }
ANONYMOUS_NAMESPACE_END ANONYMOUS_NAMESPACE_END