Skip to content

Commit

Permalink
Specify armv8.6-a architecture when building aarch64
Browse files Browse the repository at this point in the history
This enables building code requiring `i8mm` ISA extension
  • Loading branch information
Frank Bossen committed Jul 17, 2024
1 parent 3ae38b3 commit 6b87a77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions src/mc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6b87a77

Please sign in to comment.