summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-11-16 02:38:53 -0500
committerJeffrey Walton <noloader@gmail.com>2017-11-16 02:38:53 -0500
commit8b52a03d0873bf3f252c58c76df1e4167fc33fa6 (patch)
treeea88ce75a34bdf52450e0eb184408af8b8edc084 /cpu.h
parent6f83a4fb7dfbbd1652524be36e3b3261ba13bc33 (diff)
downloadcryptopp-git-8b52a03d0873bf3f252c58c76df1e4167fc33fa6.tar.gz
Fix SunCC 12.2 compiler crash with GCM_Xor16_SSE2
SunCC 12.3 through 12.5 still cannot handle CLMUL, though. It would be nice if Sun fixed the regression.
Diffstat (limited to 'cpu.h')
-rw-r--r--cpu.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpu.h b/cpu.h
index 5e2cca86..41892a7c 100644
--- a/cpu.h
+++ b/cpu.h
@@ -66,6 +66,7 @@ extern CRYPTOPP_DLL bool g_hasSSE42;
extern CRYPTOPP_DLL bool g_hasAESNI;
extern CRYPTOPP_DLL bool g_hasCLMUL;
extern CRYPTOPP_DLL bool g_hasSHA;
+extern CRYPTOPP_DLL bool g_hasADX;
extern CRYPTOPP_DLL bool g_isP4;
extern CRYPTOPP_DLL bool g_hasRDRAND;
extern CRYPTOPP_DLL bool g_hasRDSEED;
@@ -165,6 +166,17 @@ inline bool HasSHA()
return g_hasSHA;
}
+//! \brief Determines ADX availability
+//! \returns true if ADX is determined to be available, false otherwise
+//! \details HasADX() is a runtime check performed using CPUID
+//! \note This function is only available on Intel IA-32 platforms
+inline bool HasADX()
+{
+ if (!g_x86DetectionDone)
+ DetectX86Features();
+ return g_hasADX;
+}
+
//! \brief Determines if the CPU is an Intel P4
//! \returns true if the CPU is a P4, false otherwise
//! \details IsP4() is a runtime check performed using CPUID