arm/msac: Trim C functions from release build
Merge request reports
Activity
changed milestone to %1.4.1
added ARM performance labels
requested review from @mstorsjo
added 1 commit
- ba300a81 - arm64/msac: Trim C functions, saves 1280 bytes
added 1 commit
- 6a98be72 - arm32/msac: Trim C functions, saves 1028 bytes
Can you clarify how this relates to !1614 (merged)?
The functions that are enclosed within an ifdef here, they are all non-static, so I guess that means that the compiler can't omit them. But if we can ifdef them out altogether, that means nobody is using them in extern form, so can't we just make them static, and they should be trimmed out like all other ones?
Unfortunately we cannot just make them static. The msac DSP functions are the only ones that are specialized using
#define
's instead of function pointers, except for x86 where there is a function pointer added toMsacContext
to pick between SSE2 and AVX2 at run time. See lines 51-59 and 71-92 of src/msac.hThis relates to !1614 (merged) in that the specialization condition
#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
needs to match. Otherwise we could trim the C functions and cause a linking error.Edited by Nathan E. EggeThanks, that makes sense.
@gramner, I presume we could/should do something similar for x86 as well?
Maybe this could be generalized to something non-arch-specific instead of hardcoding every arch combination?
Possibly something along the lines of
#define TRIM_SYMBOL_ADAPT (defined(dav1d_msac_decode_symbol_adapt4) && \ defined(dav1d_msac_decode_symbol_adapt8 && \ defined(dav1d_msac_decode_symbol_adapt16)) #define TRIM_BOOL_ADAPT defined(dav1d_msac_decode_bool_adapt)
etc. at https://code.videolan.org/videolan/dav1d/-/blob/master/src/msac.h?ref_type=heads#L70
and then ifdef each C function under
#if !(TRIM_DSP && TRIM_X)
added 22 commits
-
6a98be72...b5b394cd - 20 commits from branch
videolan:master
- b9f53330 - arm64/msac: Trim C functions, saves 1392 bytes
- 84b9c6bf - arm32/msac: Trim C functions, saves 1028 bytes
-
6a98be72...b5b394cd - 20 commits from branch
added 1 commit
- 0fff614a - arm32/msac: Trim C functions, saves 1024 bytes