aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/cpu.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2013-12-10 20:13:32 +0100
committerJanne Grunau <janne-libav@jannau.net>2014-01-15 12:05:09 +0100
commitb7b17ed66e199afc7246e642bf3b35c3f8eca217 (patch)
tree2bd123eca798d0ccfaf4c10cf4e41f5e7a847ed3 /libavutil/cpu.c
parent1e9265cd8f0821acbeca1db437be1361a3976b85 (diff)
downloadffmpeg-b7b17ed66e199afc7246e642bf3b35c3f8eca217.tar.gz
aarch64: add cpuflags support for NEON and VFP
NEON and VFP are currently mandatory for all ARMv8 profiles. Both are handled as extensions as far as cpuflags are concerned. This is consistent with handling x86_64 which always has SSE2, but still handles it as an extension.
Diffstat (limited to 'libavutil/cpu.c')
-rw-r--r--libavutil/cpu.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 25af4c5580..8c2cfb87cc 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -51,9 +51,14 @@ int av_get_cpu_flags(void)
if (checked)
return flags;
- if (ARCH_ARM) flags = ff_get_cpu_flags_arm();
- if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
- if (ARCH_X86) flags = ff_get_cpu_flags_x86();
+ if (ARCH_AARCH64)
+ flags = ff_get_cpu_flags_aarch64();
+ if (ARCH_ARM)
+ flags = ff_get_cpu_flags_arm();
+ if (ARCH_PPC)
+ flags = ff_get_cpu_flags_ppc();
+ if (ARCH_X86)
+ flags = ff_get_cpu_flags_x86();
flags &= cpuflags_mask;
checked = 1;
@@ -114,6 +119,9 @@ int av_parse_cpu_flags(const char *s)
{ "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
{ "vfpv3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFPV3 }, .unit = "flags" },
{ "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
+#elif ARCH_AARCH64
+ { "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
+ { "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
#endif
{ NULL },
};
@@ -170,7 +178,10 @@ static const struct {
int flag;
const char *name;
} cpu_flag_tab[] = {
-#if ARCH_ARM
+#if ARCH_AARCH64
+ { AV_CPU_FLAG_NEON, "neon" },
+ { AV_CPU_FLAG_VFP, "vfp" },
+#elif ARCH_ARM
{ AV_CPU_FLAG_ARMV5TE, "armv5te" },
{ AV_CPU_FLAG_ARMV6, "armv6" },
{ AV_CPU_FLAG_ARMV6T2, "armv6t2" },