Skip to content

Commit

Permalink
Fix CPU check on Windows (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asherda committed Dec 14, 2019
1 parent 07b1d6d commit 66183ce
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
@@ -1,7 +1,7 @@
stages:
- build
variables:
VERSION: 0.7.2
VERSION: 0.8.0
POST_MESSAGE: "Pipeline Trigger: ${CI_PIPELINE_SOURCE}\n
Branch: ${CI_COMMIT_REF_NAME}\n
Commit: ${CI_COMMIT_SHA}\n
Expand Down
2 changes: 1 addition & 1 deletion doc/Linux/Readme.txt
@@ -1,4 +1,4 @@
VerusCoin nheqminer v0.7.2
VerusCoin nheqminer v0.8.0
Using VerusHash v2.0

This software needs to be run on a terminal.
Expand Down
2 changes: 1 addition & 1 deletion doc/Mac/Readme.txt
@@ -1,4 +1,4 @@
VerusCoin nheqminer v0.7.2
VerusCoin nheqminer v0.8.0
Using VerusHash v2.0

This software needs to be run on a terminal. To find it, open the Applications folder, then open the Utilities folder and finally open the Terminal application. The terminal can also be found using spotlight and searching for “terminal”.
Expand Down
2 changes: 1 addition & 1 deletion doc/Windows/Readme.txt
@@ -1,4 +1,4 @@
VerusCoin nheqminer v0.7.2
VerusCoin nheqminer v0.8.0
Using VerusHash v2.0

This software needs to be run on a terminal. From the start menu, type cmd and press enter to open a command prompt.
Expand Down
16 changes: 9 additions & 7 deletions nheqminer/crypto/verus_clhash.h
Expand Up @@ -120,13 +120,15 @@ inline bool IsCPUVerusOptimized()
if (__cpuverusoptimized & 0x80)
{
#ifdef _MSC_VER
int bit_AVX = 0x10000000;
int bit_AES = 0x02000000;
int bit_PCLMUL = 0x00000002;

int cpu_info[4]; // Value of the four registers EAX, EBX, ECX, and EDX, each 32-bit integers
__cpuid(cpu_info, 0);
__cpuverusoptimized = ((cpu_info[3] & (bit_AVX | bit_AES | bit_PCLMUL)) == (bit_AVX | bit_AES | bit_PCLMUL));
#define bit_AVX (1 << 28)
#define bit_AES (1 << 25)
#define bit_PCLMUL (1 << 1)
// https://insufficientlycomplicated.wordpress.com/2011/11/07/detecting-intel-advanced-vector-extensions-avx-in-visual-studio/
// bool cpuAVXSuport = cpuInfo[2] & (1 << 28) || false;

int cpuInfo[4];
__cpuid(cpuInfo, 1);
__cpuverusoptimized = ((cpuInfo[2] & (bit_AVX | bit_AES | bit_PCLMUL)) == (bit_AVX | bit_AES | bit_PCLMUL));

#else
unsigned int eax,ebx,ecx,edx;
Expand Down
2 changes: 1 addition & 1 deletion nheqminer/version.h
Expand Up @@ -34,7 +34,7 @@ static const int BIP0031_VERSION = 60000;
//! "mempool" command, enhanced "getdata" behavior starts with this version
static const int MEMPOOL_GD_VERSION = 60002;

#define STANDALONE_MINER_VERSION "0.7.2"
#define STANDALONE_MINER_VERSION "0.8.0"

// uncomment to use with ZCash address
//#define ZCASH_POOL
Expand Down

0 comments on commit 66183ce

Please sign in to comment.