Skip to content

Commit

Permalink
Add ifdefs for non x86_64 platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
Optiminer committed Aug 10, 2016
1 parent bbb30fe commit 2b19cf5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/patternsearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#include "main.h"
#include <openssl/evp.h>
#include <boost/thread.hpp>
#if (__x86_64__ || __i386__)
#include <cpuid.h>
#endif
#include "util.h"
#include "sha512.h"
#include "aes.h"
Expand Down Expand Up @@ -187,13 +189,16 @@ namespace patternsearch
boost::this_thread::disable_interruption di;
std::vector< std::pair<uint32_t,uint32_t> > results;


bool aes_ni_supported = false;
bool avx2_supported = false;
#if (__x86_64__ || __i386__)
uint32_t eax, ebx, ecx, edx;
eax = ebx = ecx = edx = 0;
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
bool aes_ni_supported = (ecx & bit_AES) > 0;
bool avx2_supported = __builtin_cpu_supports("avx2");
aes_ni_supported = (ecx & bit_AES) > 0;
avx2_supported = __builtin_cpu_supports("avx2");
LogPrintf("CPU support: AES-NI = %b, AVX2 = %b\n", aes_ni_supported, avx2_supported);
#endif
clock_t t1 = clock();
boost::thread_group* sha512Threads = new boost::thread_group();
for (int i = 0; i < totalThreads; i++) {
Expand Down

0 comments on commit 2b19cf5

Please sign in to comment.