From 6b87a77489f2c2bfb652f1446c9b1012932ade14 Mon Sep 17 00:00:00 2001 From: Frank Bossen Date: Wed, 17 Jul 2024 18:40:04 -0400 Subject: [PATCH] Specify `armv8.6-a` architecture when building aarch64 This enables building code requiring `i8mm` ISA extension --- build.rs | 13 +++++++------ src/mc.rs | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.rs b/build.rs index 5f6bc6f81..4cb7c48ea 100644 --- a/build.rs +++ b/build.rs @@ -105,10 +105,8 @@ mod asm { define(Define::bool("ARCH_AARCH64", arch == ArchArm::Arm64)); if arch == ArchArm::Arm64 { - define(Define::bool("HAVE_DOTPROD", features.contains("dotprod"))); - } - if arch == ArchArm::Arm64 { - define(Define::bool("HAVE_I8MM", features.contains("i8mm"))); + define(Define::bool("HAVE_DOTPROD", true)); + define(Define::bool("HAVE_I8MM", true)); } } @@ -308,8 +306,11 @@ mod asm { } cc.compile(rav1dasm); } else { - cc::Build::new() - .files(asm_file_paths) + let mut cc = cc::Build::new(); + if arch == Arch::Arm(ArchArm::Arm64) { + cc.flag("-march=armv8.6-a"); + } + cc.files(asm_file_paths) .include(".") .include(&out_dir) .debug(cfg!(debug_assertions)) diff --git a/src/mc.rs b/src/mc.rs index bc4db6f4a..538aa7546 100644 --- a/src/mc.rs +++ b/src/mc.rs @@ -2303,7 +2303,7 @@ impl Rav1dMCDSPContext { self.warp8x8t = bd_fn!(warp8x8t::decl_fn, BD, warp_affine_8x8t, neon); self.emu_edge = bd_fn!(emu_edge::decl_fn, BD, emu_edge, neon); - #[cfg(target_feature = "dotprod")] + #[cfg(target_arch = "aarch64")] if BD::BITDEPTH == 8 { if !flags.contains(CpuFlags::DOTPROD) { return self; @@ -2335,7 +2335,7 @@ impl Rav1dMCDSPContext { }); } - #[cfg(target_feature = "i8mm")] + #[cfg(target_arch = "aarch64")] if BD::BITDEPTH == 8 { if !flags.contains(CpuFlags::I8MM) { return self;