From ebb56f57edd46175798c2a70b6dd88bd6ce7f877 Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 13 Aug 2007 23:53:09 +0000 Subject: 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 --- cpu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cpu.h') 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 -- cgit v1.2.1