Skip to content

Commit

Permalink
aarch64_cpudetect: detect I8MM on Windows via SVE-I8MM
Browse files Browse the repository at this point in the history
There's no direct processor feature constant for I8MM alone, but
there is a flag for SVE-I8MM (added in WinSDK 10.0.26100 and
recent versions of mingw-w64). If SVE-I8MM is available, we can
assume that I8MM is available.

While HW supporting these features isn't yet commonly running
Windows, this at least allows detecting and running the I8MM codepaths
in Windows builds in Wine (possibly running in QEMU).

Based on patch from Martin Storsjö on ffmpeg-devel:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-September/333609.html

Change-Id: I77117bee8516924fddcdecccae8bab3cf5beed96
  • Loading branch information
jzern committed Sep 18, 2024
1 parent 6dfdc4e commit 729b78a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion vpx_ports/aarch64_cpudetect.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,18 @@ static int arm_get_cpu_caps(void) {
}
#endif // defined(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)
#endif // HAVE_NEON_DOTPROD
// No I8MM or SVE feature detection available on Windows at time of writing.
#if HAVE_NEON_I8MM
// Support for PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE was added in Windows SDK
// 26100.
#if defined(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE)
// There's no PF_* flag that indicates whether plain I8MM is available
// or not. But if SVE_I8MM is available, that also implies that
// regular I8MM is available.
if (IsProcessorFeaturePresent(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE)) {
flags |= HAS_NEON_I8MM;
}
#endif // defined(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE)
#endif // HAVE_NEON_I8MM
return flags;
}

Expand Down

0 comments on commit 729b78a

Please sign in to comment.