diff options
| author | Chun Kuan Lee <[email protected]> | 2018-07-07 15:26:16 +0000 |
|---|---|---|
| committer | Chun Kuan Lee <[email protected]> | 2018-07-07 16:01:43 +0000 |
| commit | 63c16ed50770bc3d4f0ecd2ffa971fcfa0688494 (patch) | |
| tree | f86a09b3fec56f61468d3a1edfde008804ac48e7 /src/crypto | |
| parent | Merge #13598: bench: fix incorrect behaviour in prevector.cpp (diff) | |
| download | discoin-63c16ed50770bc3d4f0ecd2ffa971fcfa0688494.tar.xz discoin-63c16ed50770bc3d4f0ecd2ffa971fcfa0688494.zip | |
Use __cpuid_count for gnu C to avoid gitian build fail.
Diffstat (limited to 'src/crypto')
| -rw-r--r-- | src/crypto/sha256.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index e62ddc125..3f02a05aa 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -9,7 +9,7 @@ #include <string.h> #include <atomic> -#if defined(__x86_64__) || defined(__amd64__) +#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) #if defined(USE_ASM) #include <cpuid.h> namespace sha256_sse4 @@ -534,7 +534,11 @@ bool SelfTest() { // We can't use cpuid.h's __get_cpuid as it does not support subleafs. void inline cpuid(uint32_t leaf, uint32_t subleaf, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d) { +#ifdef __GNUC__ + __cpuid_count(leaf, subleaf, a, b, c, d); +#else __asm__ ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(leaf), "2"(subleaf)); +#endif } /** Check whether the OS has enabled AVX registers. */ |