mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Show blst hardware support in lighthouse --version (#6039)
* Show blst hardware support in lighthouse --version * fix: detect adx extension in runtime * fix * add arm detect
This commit is contained in:
@@ -26,12 +26,14 @@ lazy_static! {
|
|||||||
pub static ref LONG_VERSION: String = format!(
|
pub static ref LONG_VERSION: String = format!(
|
||||||
"{}\n\
|
"{}\n\
|
||||||
BLS library: {}\n\
|
BLS library: {}\n\
|
||||||
|
BLS hardware acceleration: {}\n\
|
||||||
SHA256 hardware acceleration: {}\n\
|
SHA256 hardware acceleration: {}\n\
|
||||||
Allocator: {}\n\
|
Allocator: {}\n\
|
||||||
Profile: {}\n\
|
Profile: {}\n\
|
||||||
Specs: mainnet (true), minimal ({}), gnosis ({})",
|
Specs: mainnet (true), minimal ({}), gnosis ({})",
|
||||||
SHORT_VERSION.as_str(),
|
SHORT_VERSION.as_str(),
|
||||||
bls_library_name(),
|
bls_library_name(),
|
||||||
|
bls_hardware_acceleration(),
|
||||||
have_sha_extensions(),
|
have_sha_extensions(),
|
||||||
allocator_name(),
|
allocator_name(),
|
||||||
build_profile_name(),
|
build_profile_name(),
|
||||||
@@ -50,6 +52,15 @@ fn bls_library_name() -> &'static str {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn bls_hardware_acceleration() -> bool {
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
return std::is_x86_feature_detected!("adx");
|
||||||
|
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
return std::arch::is_aarch64_feature_detected!("neon");
|
||||||
|
}
|
||||||
|
|
||||||
fn allocator_name() -> &'static str {
|
fn allocator_name() -> &'static str {
|
||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
"system"
|
"system"
|
||||||
|
|||||||
Reference in New Issue
Block a user