13
0

Use specific build-target for ARM/NEON routines

This commit is contained in:
Robin Gareus 2020-08-21 03:39:56 +02:00
parent 98023fcfe8
commit fb5abde677
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 8 additions and 3 deletions

View File

@ -70,8 +70,8 @@ LIBARDOUR_API void veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, cons
#endif
#if defined ARM_NEON_SUPPORT
/* Optimized NEON functions */
#if defined(__arm__) && !defined(__APPLE__)
extern "C" {
LIBARDOUR_API float arm_neon_compute_peak (const float * buf, uint32_t nsamples, float current);
LIBARDOUR_API void arm_neon_apply_gain_to_buffer (float * buf, uint32_t nframes, float gain);

View File

@ -217,7 +217,7 @@ setup_hardware_optimization (bool try_optimization)
generic_mix_functions = false;
}
#elif defined(__arm__) && !defined(__APPLE__)
#elif defined ARM_NEON_SUPPORT
/* Use NEON routines */
do {
compute_peak = arm_neon_compute_peak;

View File

@ -467,7 +467,6 @@ def build(bld):
avx_sources = []
if Options.options.fpu_optimization:
obj.source += ['arm_neon_functions.cc']
if (bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686'):
obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s', ]
avx_sources = [ 'sse_functions_avx_linux.cc' ]
@ -482,6 +481,9 @@ def build(bld):
obj.source += [ 'sse_functions_xmm.cc' ]
obj.source += [ 'sse_functions_64bit_win.s', 'sse_avx_functions_64bit_win.s' ]
avx_sources = [ 'sse_functions_avx.cc' ]
elif bld.env['build_target'] == 'armhf' or bld.env['build_target'] == 'aarch64':
obj.source += ['arm_neon_functions.cc']
obj.defines += [ 'ARM_NEON_SUPPORT' ]
if avx_sources:
# as long as we want to use AVX intrinsics in this file,

View File

@ -474,6 +474,9 @@ int main() { return 0; }''',
#
compiler_flags.append ('-U__STRICT_ANSI__')
if conf.env['build_target'] == 'armhf' or conf.env['build_target'] == 'aarch64':
conf.define('ARM_NEON_SUPPORT', 1)
if opt.use_libcpp or conf.env['build_host'] in [ 'el_capitan', 'sierra', 'high_sierra', 'mojave', 'catalina' ]:
cxx_flags.append('--stdlib=libc++')
linker_flags.append('--stdlib=libc++')