summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2007-04-16 05:40:37 +0000
committerweidai <weidai11@users.noreply.github.com>2007-04-16 05:40:37 +0000
commit3a3fef7436c4093908dee7a03bfcae6366f5ba95 (patch)
tree60a4e53f174eb18d85511f007d44f312368a52f9 /cpu.h
parent68a38c0b9aa572407ff9e9c0a1de79a79f6363f3 (diff)
downloadcryptopp-git-3a3fef7436c4093908dee7a03bfcae6366f5ba95.tar.gz
fix compile on Sun CC
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 d8a5a1f7..6a212345 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 ";"