Skip to content

Commit

Permalink
aarch64_cpudetect: detect SVE/SVE2 on Windows
Browse files Browse the repository at this point in the history
PF_ARM_SVE_INSTRUCTIONS_AVAILABLE and PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE
are available in WinSDK 10.0.26100 and recent versions of mingw-w64.

Based on a patch by Martin Storsjö on ffmpeg-devel:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-September/333611.html

Change-Id: I34b2341a559f95aa400e84d709f3eb36da5dbb7b
  • Loading branch information
jzern committed Sep 18, 2024
1 parent 729b78a commit ac68e7f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions vpx_ports/aarch64_cpudetect.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ static int arm_get_cpu_caps(void) {
}
#endif // defined(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE)
#endif // HAVE_NEON_I8MM
#if HAVE_SVE
// Support for PF_ARM_SVE_INSTRUCTIONS_AVAILABLE was added in Windows SDK 26100.
#if defined(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE)
if (IsProcessorFeaturePresent(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE)) {
flags |= HAS_SVE;
}
#endif // defined(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE)
#endif // HAVE_SVE
#if HAVE_SVE2
// Support for PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE was added in Windows SDK
// 26100.
#if defined(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE)
if (IsProcessorFeaturePresent(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE)) {
flags |= HAS_SVE2;
}
#endif // defined(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE)
#endif // HAVE_SVE2
return flags;
}

Expand Down

0 comments on commit ac68e7f

Please sign in to comment.