nil::crypto3::cpuid Class Referencefinal
#include <cpuid.hpp>
Collaboration diagram for nil::crypto3::cpuid:
Public Types | |
enum | CPUID_bits : uint64_t { CPUID_INITIALIZED_BIT = (1ULL << 63) } |
Static Public Member Functions | |
static std::vector< cpuid::CPUID_bits > | bit_from_string (const std::string &tok) |
static size_t | cache_line_size () |
static void | clear_cpuid_bit (CPUID_bits bit) |
static bool | has_cpuid_bit (CPUID_bits elem) |
static bool | has_simd_32 () |
static void | initialize () |
static bool | is_big_endian () |
static bool | is_little_endian () |
static std::string | to_string () |
Detailed Description
A class handling runtime CPU feature detection. It is limited to just the features necessary to implement CPU specific code in library, rather than being a general purpose utility.
This class supports:
- x86 features using CPUID. x86 is also the only processor with accurate cache line detection currently.
- PowerPC AltiVec detection on Linux, NetBSD, OpenBSD, and Darwin
- ARM NEON and crypto extensions detection. On Linux and Android systems which support getauxval, that is used to access CPU feature information. Otherwise a relatively portable but thread-unsafe mechanism involving executing probe functions which catching SIGILL signal is used.
Member Enumeration Documentation
◆ CPUID_bits
enum nil::crypto3::cpuid::CPUID_bits : uint64_t |
Member Function Documentation
◆ bit_from_string()
|
inlinestatic |
◆ cache_line_size()
|
inlinestatic |
Return a best guess of the cache line size
◆ clear_cpuid_bit()
|
inlinestatic |
◆ has_cpuid_bit()
|
inlinestatic |
◆ has_simd_32()
|
inlinestatic |
◆ initialize()
|
inlinestatic |
Probe the CPU and see what extensions are supported
◆ is_big_endian()
|
inlinestatic |
◆ is_little_endian()
|
inlinestatic |
◆ to_string()
|
inlinestatic |
Return a possibly empty string containing list of known CPU extensions. Each name will be seperated by a space, and the ordering will be arbitrary. This list only contains values that are useful for the library (for example FMA instructions are not checked).
Example outputs "sse2 ssse3 rdtsc", "neon arm_aes", "altivec"
The documentation for this class was generated from the following file: