summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-08-13 23:53:09 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-08-13 23:53:09 +0000
commitebb56f57edd46175798c2a70b6dd88bd6ce7f877 (patch)
treef096ef9661b273e6059f26284dd133c439a528b4 /cpu.h
parent3d0cf61bb4132e0ade13f86a9af16b2702aab524 (diff)
downloadcryptopp-ebb56f57edd46175798c2a70b6dd88bd6ce7f877.tar.gz
fixed Whirlpool crash on Pentium 2 machines
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@385 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'cpu.h')
-rwxr-xr-xcpu.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpu.h b/cpu.h
index 6eae489..bec63fd 100755
--- a/cpu.h
+++ b/cpu.h
@@ -16,6 +16,7 @@ NAMESPACE_BEGIN(CryptoPP)
// these should not be used directly
extern CRYPTOPP_DLL bool g_x86DetectionDone;
extern CRYPTOPP_DLL bool g_hasSSE2;
+extern CRYPTOPP_DLL bool g_hasISSE;
extern CRYPTOPP_DLL bool g_hasMMX;
extern CRYPTOPP_DLL bool g_hasSSSE3;
extern CRYPTOPP_DLL bool g_isP4;
@@ -26,6 +27,7 @@ CRYPTOPP_DLL bool CpuId(word32 input, word32 *output);
#if CRYPTOPP_BOOL_X64
inline bool HasSSE2() {return true;}
+inline bool HasISSE() {return true;}
inline bool HasMMX() {return true;}
#else
@@ -36,6 +38,13 @@ inline bool HasSSE2()
return g_hasSSE2;
}
+inline bool HasISSE()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasISSE;
+}
+
inline bool HasMMX()
{
if (!g_x86DetectionDone)
@@ -79,9 +88,11 @@ inline bool IsP4() {return false;}
// assume MMX and SSE2 if intrinsics are enabled
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_X64
inline bool HasSSE2() {return true;}
+inline bool HasISSE() {return true;}
inline bool HasMMX() {return true;}
#else
inline bool HasSSE2() {return false;}
+inline bool HasISSE() {return false;}
inline bool HasMMX() {return false;}
#endif