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