mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:20:56 +01:00
aarch64: Add Apple runtime detection of dotprod and i8mm using sysctl
For now, there's not much value in this since Clang don't support enabling the dotprod or i8mm features with either .arch_extension or .arch (it has to be enabled by the base arch flags passed to the compiler). But it may be supported in the future. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
493fcde50a
commit
9b0052200a
2 changed files with 24 additions and 0 deletions
|
|
@ -61,6 +61,28 @@ static int detect_flags(void)
|
|||
return flags;
|
||||
}
|
||||
|
||||
#elif defined(__APPLE__) && HAVE_SYSCTLBYNAME
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
static int detect_flags(void)
|
||||
{
|
||||
uint32_t value = 0;
|
||||
size_t size;
|
||||
int flags = 0;
|
||||
|
||||
size = sizeof(value);
|
||||
if (!sysctlbyname("hw.optional.arm.FEAT_DotProd", &value, &size, NULL, 0)) {
|
||||
if (value)
|
||||
flags |= AV_CPU_FLAG_DOTPROD;
|
||||
}
|
||||
size = sizeof(value);
|
||||
if (!sysctlbyname("hw.optional.arm.FEAT_I8MM", &value, &size, NULL, 0)) {
|
||||
if (value)
|
||||
flags |= AV_CPU_FLAG_I8MM;
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int detect_flags(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue