summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-04-16 05:40:37 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-04-16 05:40:37 +0000
commitf97f957e48a69ca40674a05cd50ec66a6f3d8c18 (patch)
tree60a4e53f174eb18d85511f007d44f312368a52f9 /cpu.h
parentb5f625d875e79351237cea1d5aba865148c77911 (diff)
downloadcryptopp-f97f957e48a69ca40674a05cd50ec66a6f3d8c18.tar.gz
fix compile on Sun CC
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@325 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'cpu.h')
-rwxr-xr-xcpu.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/cpu.h b/cpu.h
index d8a5a1f..6a21234 100755
--- a/cpu.h
+++ b/cpu.h
@@ -5,7 +5,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || _MSC_VER >= 1400
+#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || (_MSC_VER >= 1400 && CRYPTOPP_BOOL_X64)
#define CRYPTOPP_CPUID_AVAILABLE
@@ -17,7 +17,10 @@ void DetectX86Features();
bool CpuId(word32 input, word32 *output);
-#if !CRYPTOPP_BOOL_X64
+#if CRYPTOPP_BOOL_X64
+inline bool HasSSE2() {return true;}
+inline bool HasMMX() {return true;}
+#else
inline bool HasSSE2()
{
@@ -63,22 +66,20 @@ inline int GetCacheLineSize()
return CRYPTOPP_L1_CACHE_LINE_SIZE;
}
-#endif // #ifdef CRYPTOPP_X86_ASM_AVAILABLE || _MSC_VER >= 1400
-
-#if CRYPTOPP_BOOL_X64
-
-inline bool HasSSE2()
-{
- return true;
-}
-
-inline bool HasMMX()
-{
- return true;
-}
+inline bool HasSSSE3() {return false;}
+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 HasMMX() {return true;}
+#else
+inline bool HasSSE2() {return false;}
+inline bool HasMMX() {return false;}
#endif
+#endif // #ifdef CRYPTOPP_X86_ASM_AVAILABLE || _MSC_VER >= 1400
+
#if defined(__GNUC__)
// define these in two steps to allow arguments to be expanded
#define GNU_AS1(x) #x ";"