From 5daa168a939780b9051aaee071182cf06302fbcf Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 23 Jul 2015 03:29:21 -0400 Subject: [PATCH] Cleaned up CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER and WORKAROUND_LLVM_BUG_18916 defines --- config.h | 8 ++++---- cpu.h | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config.h b/config.h index 0a6495df..b153995d 100644 --- a/config.h +++ b/config.h @@ -69,8 +69,8 @@ // Defining this will cause Crypto++ to make only one call to CryptAcquireContext. #define WORKAROUND_MS_BUG_Q258000 -// Define this if you are working around Clang's integrated assembler bug by -// disabling the assembler (https://llvm.org/bugs/show_bug.cgi?id=18916). +// Define this if you are working around Clang's integrated assembler bug +// and issues with {prefix|noprefix} (https://llvm.org/bugs/show_bug.cgi?id=18916). // When the LLVM project fixes it, then we turn it on/off automatically. #define WORKAROUND_LLVM_BUG_18916 @@ -78,7 +78,7 @@ // the only way to tell is `$(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1`. The // integrated assembler will return `clang: error: unsupported argument '-v' option`. #if defined(__clang__) -#define CRYPTOPP_USING_CLANG_INTEGRATED_ASSEMBLER +#define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER #endif #ifdef CRYPTOPP_DOXYGEN_PROCESSING @@ -299,7 +299,7 @@ NAMESPACE_END #define CRYPTOPP_X64_MASM_AVAILABLE #endif -#if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) +#if !defined(CRYPTOPP_DISABLE_ASM) &&!defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) && defined(__GNUC__) && defined(__x86_64__) #define CRYPTOPP_X64_ASM_AVAILABLE #endif diff --git a/cpu.h b/cpu.h index 4c4a9d57..aaa0aea3 100644 --- a/cpu.h +++ b/cpu.h @@ -209,7 +209,7 @@ inline int GetCacheLineSize() #define ASC(x, y) __asm {x label##y} #define CRYPTOPP_NAKED __declspec(naked) #define AS_HEX(y) 0x##y -#elif defined(__clang__) && defined(CRYPTOPP_USING_CLANG_INTEGRATED_ASSEMBLER) +#elif defined(__clang__) && defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) #define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY // define these in two steps to allow arguments to be expanded #define GNU_AS1(x) "\n\t" #x ";" @@ -287,6 +287,7 @@ inline int GetCacheLineSize() #define AS_REG_7d ebp #define WORD_SZ 4 #define WORD_REG(x) e##x + #define WORD_REG32(x) e##x #define WORD_PTR DWORD PTR #define AS_PUSH_IF86(x) AS1(push e##x) #define AS_POP_IF86(x) AS1(pop e##x) @@ -325,6 +326,7 @@ inline int GetCacheLineSize() #endif #define WORD_SZ 8 #define WORD_REG(x) r##x + #define WORD_REG32(x) e##x #define WORD_PTR QWORD PTR #define AS_PUSH_IF86(x) #define AS_POP_IF86(x)