don't check x86 features on non-x86 architectures

This commit is contained in:
Anton Lazarev 2021-12-01 20:41:53 -08:00 committed by Michael Vines
parent c825b0a84d
commit 3c8b33eaef
1 changed files with 8 additions and 2 deletions

View File

@ -54,7 +54,10 @@ pub fn report_target_features() {
// when run on machines without AVX causing a non-obvious process abort. Instead detect
// the mismatch and error cleanly.
if !is_rosetta_emulated() {
#[cfg(build_target_feature_avx)]
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
build_target_feature_avx
))]
{
if is_x86_feature_detected!("avx") {
info!("AVX detected");
@ -66,7 +69,10 @@ pub fn report_target_features() {
}
}
#[cfg(build_target_feature_avx2)]
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
build_target_feature_avx2
))]
{
if is_x86_feature_detected!("avx2") {
info!("AVX2 detected");