Merge branch 'master' into hmqv
commit
8d7ba8dde9
|
|
@ -176,6 +176,7 @@ endif
|
|||
endif
|
||||
|
||||
# Tell MacPorts GCC to use Clang integrated assembler
|
||||
# http://github.com/weidai11/cryptopp/issues/190
|
||||
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER),11)
|
||||
ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-Wa,-q)
|
||||
CXXFLAGS += -Wa,-q
|
||||
|
|
@ -185,6 +186,12 @@ CXXFLAGS += -DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER=1
|
|||
endif
|
||||
endif
|
||||
|
||||
# GCC on Solaris needs -m64. Otherwise, i386 is default
|
||||
# http://github.com/weidai11/cryptopp/issues/230
|
||||
ifeq ($(IS_SUN)$(GCC_COMPILER)$(IS_X64),111)
|
||||
CXXFLAGS += -m64
|
||||
endif
|
||||
|
||||
# Allow use of "/" operator for GNU Assembler.
|
||||
# http://sourceware.org/bugzilla/show_bug.cgi?id=4572
|
||||
ifeq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CXXFLAGS)),)
|
||||
|
|
|
|||
4
misc.h
4
misc.h
|
|
@ -702,7 +702,7 @@ inline unsigned int TrailingZeros(word64 v)
|
|||
// We don't enable for Microsoft because it requires a runtime check.
|
||||
// http://msdn.microsoft.com/en-us/library/hh977023%28v=vs.110%29.aspx
|
||||
assert(v != 0);
|
||||
#if defined(__GNUC__) && defined(__BMI__)
|
||||
#if defined(__GNUC__) && defined(__BMI__) && defined(__x86_64__)
|
||||
return (unsigned int)_tzcnt_u64(v);
|
||||
#elif defined(__GNUC__) && (CRYPTOPP_GCC_VERSION >= 30400)
|
||||
return (unsigned int)__builtin_ctzll(v);
|
||||
|
|
@ -815,12 +815,14 @@ inline bool IsPowerOf2<word32>(const word32 &value)
|
|||
return value > 0 && _blsr_u32(value) == 0;
|
||||
}
|
||||
|
||||
# if defined(__x86_64__)
|
||||
template <>
|
||||
inline bool IsPowerOf2<word64>(const word64 &value)
|
||||
{
|
||||
return value > 0 && _blsr_u64(value) == 0;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//! \brief Tests whether the residue of a value is a power of 2
|
||||
//! \param a the value to test
|
||||
|
|
|
|||
Loading…
Reference in New Issue