Guard _blsr_u64 and _tzcnt_u64 on __x86_64__

pull/239/head
Jeffrey Walton 2016-07-21 18:04:05 -04:00
parent 29bd2bc95c
commit a327717618
1 changed files with 16 additions and 14 deletions

30
misc.h
View File

@ -63,20 +63,22 @@
#if defined(__GNUC__) && defined(__BMI__) #if defined(__GNUC__) && defined(__BMI__)
# include <immintrin.h> # include <immintrin.h>
# if defined(__clang__) # if defined(__clang__)
#ifndef _tzcnt_u32 # ifndef _tzcnt_u32
# define _tzcnt_u32(x) __tzcnt_u32(x) # define _tzcnt_u32(x) __tzcnt_u32(x)
#endif # endif
#ifndef _tzcnt_u64 # ifndef _blsr_u32
# define _tzcnt_u64(x) __tzcnt_u64(x) # define _blsr_u32(x) __blsr_u32(x)
#endif # endif
#ifndef _blsr_u32 # ifdef __x86_64__
# define _blsr_u32(x) __blsr_u32(x) # ifndef _tzcnt_u64
#endif # define _tzcnt_u64(x) __tzcnt_u64(x)
#ifndef _blsr_u64 # endif
# define _blsr_u64(x) __blsr_u64(x) # ifndef _blsr_u64
#endif # define _blsr_u64(x) __blsr_u64(x)
# endif # endif
#endif # endif // x86_64
# endif // Clang
#endif // GNUC and BMI
#endif // CRYPTOPP_DOXYGEN_PROCESSING #endif // CRYPTOPP_DOXYGEN_PROCESSING