configure: add detection of assembler support for SME

All changes are made during development/testing of SVE/SME for ffmpeg (vvc). Tested on Apple M4
This commit is contained in:
Georgii Zagoruiko 2025-12-08 19:45:32 +00:00 committed by Martin Storsjö
parent 2251ede69e
commit cdb14bc74d
12 changed files with 85 additions and 4 deletions

View file

@ -28,6 +28,7 @@
#define HWCAP_AARCH64_SVE (1 << 22)
#define HWCAP2_AARCH64_SVE2 (1 << 1)
#define HWCAP2_AARCH64_I8MM (1 << 13)
#define HWCAP2_AARCH64_SME (1 << 23)
static int detect_flags(void)
{
@ -44,6 +45,8 @@ static int detect_flags(void)
flags |= AV_CPU_FLAG_SVE2;
if (hwcap2 & HWCAP2_AARCH64_I8MM)
flags |= AV_CPU_FLAG_I8MM;
if (hwcap & HWCAP2_AARCH64_SME)
flags |= AV_CPU_FLAG_SME;
return flags;
}
@ -67,6 +70,8 @@ static int detect_flags(void)
flags |= AV_CPU_FLAG_DOTPROD;
if (have_feature("hw.optional.arm.FEAT_I8MM"))
flags |= AV_CPU_FLAG_I8MM;
if (have_feature("hw.optional.arm.FEAT_SME"))
flags |= AV_CPU_FLAG_SME;
return flags;
}
@ -133,6 +138,10 @@ static int detect_flags(void)
#ifdef PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE
if (IsProcessorFeaturePresent(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE))
flags |= AV_CPU_FLAG_SVE2;
#endif
#ifdef PF_ARM_SME_INSTRUCTIONS_AVAILABLE
if (IsProcessorFeaturePresent(PF_ARM_SME_INSTRUCTIONS_AVAILABLE))
flags |= AV_CPU_FLAG_SME;
#endif
return flags;
}
@ -162,6 +171,9 @@ int ff_get_cpu_flags_aarch64(void)
#ifdef __ARM_FEATURE_SVE2
flags |= AV_CPU_FLAG_SVE2;
#endif
#ifdef __ARM_FEATURE_SME
flags |= AV_CPU_FLAG_SME;
#endif
flags |= detect_flags();