Use __cpuid_count for gnu C to avoid gitian build fail.
(cherry picked from commit bitcoin/bitcoin@63c16ed507)
This commit is contained in:
parent
ece6a37698
commit
dccce97efc
|
@ -11,7 +11,7 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__amd64__)
|
#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
|
||||||
#if defined(USE_ASM)
|
#if defined(USE_ASM)
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
namespace sha256_sse4
|
namespace sha256_sse4
|
||||||
|
@ -554,7 +554,11 @@ bool SelfTest() {
|
||||||
// We can't use cpuid.h's __get_cpuid as it does not support subleafs.
|
// 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)
|
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));
|
__asm__ ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(leaf), "2"(subleaf));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check whether the OS has enabled AVX registers. */
|
/** Check whether the OS has enabled AVX registers. */
|
||||||
|
|
Loading…
Reference in New Issue