From c7c1f26676dc467e261b70fb85db4ea550f5bcc8 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 19 Apr 2021 13:58:29 -0400 Subject: Move GCC target attribute into config_misc.h --- lsh256.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'lsh256.cpp') diff --git a/lsh256.cpp b/lsh256.cpp index a3c5a8b4..98dad0ab 100644 --- a/lsh256.cpp +++ b/lsh256.cpp @@ -66,21 +66,6 @@ # define CONST_M256_CAST(x) ((const __m256i *)(const void *)(x)) #endif -// Should work for Clang 7 and above: https://stackoverflow.com/q/39958935. -// But Clang 10 is broke: https://bugs.llvm.org/show_bug.cgi?id=50025. -#if defined(__i386__) || defined(__i686__) || defined(__amd64__) -# if (CRYPTOPP_GCC_VERSION >= 40800) -# include -# define GCC_HAVE_TARGET 1 -# define GCC_TARGET_DEFAULT __attribute__ ((target ("default"))) -# define GCC_TARGET_SSSE3 __attribute__ ((target ("ssse3"))) -# endif -#endif - -#ifndef GCC_TARGET_DEFAULT -# define GCC_TARGET_DEFAULT -#endif - ANONYMOUS_NAMESPACE_BEGIN using CryptoPP::byte; @@ -654,8 +639,8 @@ inline void xor_with_const(lsh_u32* cv_l, const lsh_u32* const_v) #endif } -#if defined(GCC_HAVE_TARGET) -GCC_TARGET_SSSE3 +#if defined(CRYPTOPP_HAVE_ATTRIBUTE_TARGET) +CRYPTOPP_TARGET_SSSE3 inline void rotate_msg_gamma(lsh_u32* cv_r) { CRYPTOPP_ASSERT(cv_r != NULLPTR); @@ -670,7 +655,7 @@ inline void rotate_msg_gamma(lsh_u32* cv_r) } #endif -GCC_TARGET_DEFAULT +CRYPTOPP_TARGET_DEFAULT inline void rotate_msg_gamma(lsh_u32* cv_r) { CRYPTOPP_ASSERT(cv_r != NULLPTR); -- cgit v1.2.1