aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/aarch64
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2024-09-17 15:00:56 +0300
committerMartin Storsjö <martin@martin.st>2024-09-27 00:02:48 +0300
commit067abbfe9dbf136c5621592622fa93bdd0f9f84d (patch)
tree06351793a7acdfe97d335cc69adb181235e44c21 /libavutil/aarch64
parentd55ab2ba9b16cabf1a069bcd6784e8d4906fc859 (diff)
downloadffmpeg-067abbfe9dbf136c5621592622fa93bdd0f9f84d.tar.gz
aarch64: Detect I8MM on Windows via SVE-I8MM
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). Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil/aarch64')
-rw-r--r--libavutil/aarch64/cpu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index 7631d13de0..fe24b1da4d 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -113,6 +113,13 @@ static int detect_flags(void)
if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE))
flags |= AV_CPU_FLAG_DOTPROD;
#endif
+#ifdef 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 |= AV_CPU_FLAG_I8MM;
+#endif
return flags;
}
#else