diff options
author | James Almer <jamrial@gmail.com> | 2017-09-27 23:10:09 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-09-27 23:10:09 -0300 |
commit | 3b345d389be2d67017f904caa21713f53a8e8c90 (patch) | |
tree | 44d50b299738c39f3631855bf5a67464ec0d4540 /libavutil/cpu.c | |
parent | 522f87708653af3badcdc33be983bcc6009de49b (diff) | |
download | ffmpeg-3b345d389be2d67017f904caa21713f53a8e8c90.tar.gz |
avutil/cpu: split flag checks per arch in av_cpu_max_align()
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/cpu.c')
-rw-r--r-- | libavutil/cpu.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c index ab04494acf..c8401b8258 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -304,37 +304,14 @@ int av_cpu_count(void) size_t av_cpu_max_align(void) { - int av_unused flags = av_get_cpu_flags(); - -#if ARCH_ARM || ARCH_AARCH64 - if (flags & AV_CPU_FLAG_NEON) - return 16; -#elif ARCH_PPC - if (flags & (AV_CPU_FLAG_ALTIVEC | - AV_CPU_FLAG_VSX | - AV_CPU_FLAG_POWER8)) - return 16; -#elif ARCH_X86 - if (flags & (AV_CPU_FLAG_AVX2 | - AV_CPU_FLAG_AVX | - AV_CPU_FLAG_XOP | - AV_CPU_FLAG_FMA4 | - AV_CPU_FLAG_FMA3 | - AV_CPU_FLAG_AVXSLOW)) - return 32; - if (flags & (AV_CPU_FLAG_AESNI | - AV_CPU_FLAG_SSE42 | - AV_CPU_FLAG_SSE4 | - AV_CPU_FLAG_SSSE3 | - AV_CPU_FLAG_SSE3 | - AV_CPU_FLAG_SSE2 | - AV_CPU_FLAG_SSE | - AV_CPU_FLAG_ATOM | - AV_CPU_FLAG_SSSE3SLOW | - AV_CPU_FLAG_SSE3SLOW | - AV_CPU_FLAG_SSE2SLOW)) - return 16; -#endif + if (ARCH_AARCH64) + return ff_get_cpu_max_align_aarch64(); + if (ARCH_ARM) + return ff_get_cpu_max_align_arm(); + if (ARCH_PPC) + return ff_get_cpu_max_align_ppc(); + if (ARCH_X86) + return ff_get_cpu_max_align_x86(); return 8; } |