summaryrefslogtreecommitdiff
path: root/validat1.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-06-18 18:33:17 -0400
committerJeffrey Walton <noloader@gmail.com>2018-06-18 18:33:17 -0400
commit0ccdc197b7ec6b5a60726f0a49bd4f02efaac258 (patch)
treefad32f1c871c76d496760346e1b9ed4f75080592 /validat1.cpp
parent207c6fcb1a01a1b7676e794b4ac2fa7b29d06689 (diff)
downloadcryptopp-git-0ccdc197b7ec6b5a60726f0a49bd4f02efaac258.tar.gz
Add AVX and AVX2 runtime feature detection (GH #671)
There are no corresponding defines in config.h at the moment. Programs will have to use the preprocessor macros __AVX__ and __AVX2__ to determine when they are available.
Diffstat (limited to 'validat1.cpp')
-rw-r--r--validat1.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/validat1.cpp b/validat1.cpp
index 02e5ef95..c8d58255 100644
--- a/validat1.cpp
+++ b/validat1.cpp
@@ -369,11 +369,20 @@ bool TestSettings()
bool hasSSSE3 = HasSSSE3();
bool hasSSE41 = HasSSE41();
bool hasSSE42 = HasSSE42();
+ bool hasAVX = HasAVX();
+ bool hasAVX2 = HasAVX2();
+ bool hasAESNI = HasAESNI();
+ bool hasCLMUL = HasCLMUL();
+ bool hasRDRAND = HasRDRAND();
+ bool hasRDSEED = HasRDSEED();
+ bool hasSHA = HasSHA();
bool isP4 = IsP4();
- std::cout << "hasSSE2 == " << hasSSE2 << ", hasSSSE3 == " << hasSSSE3 << ", hasSSE4.1 == " << hasSSE41 << ", hasSSE4.2 == " << hasSSE42;
- std::cout << ", hasAESNI == " << HasAESNI() << ", hasCLMUL == " << HasCLMUL() << ", hasRDRAND == " << HasRDRAND() << ", hasRDSEED == " << HasRDSEED();
- std::cout << ", hasSHA == " << HasSHA() << ", isP4 == " << isP4 << "\n";
+ std::cout << "hasSSE2 == " << hasSSE2 << ", hasSSSE3 == " << hasSSSE3 << ", hasSSE4.1 == " << hasSSE41;
+ std::cout << ", hasSSE4.2 == " << hasSSE42 << ", hasAVX == " << hasAVX << ", hasAVX2 == " << hasAVX2;
+ std::cout << ", hasAESNI == " << hasAESNI << ", hasCLMUL == " << hasCLMUL << ", hasRDRAND == " << HasRDRAND;
+ std::cout << ", hasRDSEED == " << HasRDSEED << ", hasSHA == " << HasSHA() << ", isP4 == " << isP4;
+ std::cout << "\n";
#elif (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64)
bool hasNEON = HasNEON();