MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / cpuid

Function cpuid

src/crypto/sha256.cpp:553–560  ·  view source on GitHub ↗

We can't use cpuid.h's __get_cpuid as it does not support subleafs.

Source from the content-addressed store, hash-verified

551#if defined(USE_ASM) && (defined(__x86_64__) || defined(__amd64__) || defined(__i386__))
552// We can't use cpuid.h's __get_cpuid as it does not support subleafs.
553void inline cpuid(uint32_t leaf, uint32_t subleaf, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d)
554{
555#ifdef __GNUC__
556 __cpuid_count(leaf, subleaf, a, b, c, d);
557#else
558 __asm__ ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(leaf), "2"(subleaf));
559#endif
560}
561
562/** Check whether the OS has enabled AVX registers. */
563bool AVXEnabled()

Callers 1

SHA256AutoDetectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected