diff options
author | Henrik Gramner <gramner@twoorioles.com> | 2022-07-06 15:43:44 +0300 |
---|---|---|
committer | Henrik Gramner <henrik@gramner.com> | 2022-07-06 16:05:47 +0300 |
commit | bd0466350d20e2c6aab4c47668cd5486dc7a3d94 (patch) | |
tree | a49202fdff9fe3f560aa4eadde6f54f4d033ed21 /src/cdef_tmpl.c | |
parent | 820bf5156322ea6f9d1fc180ac579743347b9c5b (diff) |
Eliminate unused C DSP functions at compile time
When compiling with asm enabled there's no point in compiling
C versions of DSP functions that have asm implementations using
instruction sets that the compiler can unconditionally use.
E.g. when compiling with -mssse3 we can remove the C version
of all functions with SSSE3 implementations.
This is accomplished using the compiler's dead code elimination
functionality.
Can be configured using the new 'trim_dsp' meson option, which
by default is enabled when compiling in release mode.
Diffstat (limited to 'src/cdef_tmpl.c')
-rw-r--r-- | src/cdef_tmpl.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cdef_tmpl.c b/src/cdef_tmpl.c index 1c95dbf..5943945 100644 --- a/src/cdef_tmpl.c +++ b/src/cdef_tmpl.c @@ -303,6 +303,16 @@ static int cdef_find_dir_c(const pixel *img, const ptrdiff_t stride, return best_dir; } +#if HAVE_ASM +#if ARCH_AARCH64 || ARCH_ARM +#include "src/arm/cdef.h" +#elif ARCH_PPC64LE +#include "src/ppc/cdef.h" +#elif ARCH_X86 +#include "src/x86/cdef.h" +#endif +#endif + COLD void bitfn(dav1d_cdef_dsp_init)(Dav1dCdefDSPContext *const c) { c->dir = cdef_find_dir_c; c->fb[0] = cdef_filter_block_8x8_c; @@ -311,11 +321,11 @@ COLD void bitfn(dav1d_cdef_dsp_init)(Dav1dCdefDSPContext *const c) { #if HAVE_ASM #if ARCH_AARCH64 || ARCH_ARM - bitfn(dav1d_cdef_dsp_init_arm)(c); + cdef_dsp_init_arm(c); #elif ARCH_PPC64LE - bitfn(dav1d_cdef_dsp_init_ppc)(c); + cdef_dsp_init_ppc(c); #elif ARCH_X86 - bitfn(dav1d_cdef_dsp_init_x86)(c); + cdef_dsp_init_x86(c); #endif #endif } |