enable SSE2 intrinsics on GCC 3.3 or later
parent
25a333a832
commit
93d56c76c1
|
|
@ -9,6 +9,12 @@ CXXFLAGS = -g
|
|||
ARFLAGS = -cr # ar needs the dash on OpenBSD
|
||||
RANLIB = ranlib
|
||||
UNAME = $(shell uname)
|
||||
ISX86 = $(shell uname -m | grep -c "i.86")
|
||||
GCC33ORLATER = $(shell gcc -v 2>&1 | grep -c "gcc version \(3.[3-9]\|[4-9]\)")
|
||||
|
||||
ifeq ($(ISX86) $(GCC33ORLATER),1 1)
|
||||
CXXFLAGS += -msse2
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist
|
||||
CXXFLAGS += -mbnu210
|
||||
|
|
|
|||
1474
integer.cpp
1474
integer.cpp
File diff suppressed because it is too large
Load Diff
14
integer.h
14
integer.h
|
|
@ -21,10 +21,17 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
// SSE2 intrinsics work in GCC 3.3 or later
|
||||
#if defined(__SSE2__) && (__GNUC_MAJOR__ > 3 || __GNUC_MINOR__ > 2)
|
||||
#define SSE2_INTRINSICS_AVAILABLE
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
#if defined(SSE2_INTRINSICS_AVAILABLE) || defined(_MSC_VER)
|
||||
|
||||
// Defined this class for MSVC even if processor pack is not installed,
|
||||
// so that the library can be compiled with processor pack, and calling app
|
||||
// compiled without it.
|
||||
template <class T>
|
||||
class AlignedAllocator : public AllocatorBase<T>
|
||||
{
|
||||
|
|
@ -38,15 +45,16 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
return StandardReallocate(*this, p, oldSize, newSize, preserve);
|
||||
}
|
||||
};
|
||||
|
||||
template class CRYPTOPP_DLL AlignedAllocator<word>;
|
||||
typedef SecBlock<word, AlignedAllocator<word> > SecAlignedWordBlock;
|
||||
|
||||
void CRYPTOPP_DLL DisableSSE2();
|
||||
|
||||
#else
|
||||
typedef SecWordBlock SecAlignedWordBlock;
|
||||
#endif
|
||||
|
||||
void CRYPTOPP_DLL DisableSSE2();
|
||||
|
||||
//! multiple precision integer and basic arithmetics
|
||||
/*! This class can represent positive and negative integers
|
||||
with absolute value less than (256**sizeof(word)) ** (256**sizeof(int)).
|
||||
|
|
|
|||
Loading…
Reference in New Issue