mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
neon: fix neon detection and compilation
This commit is contained in:
parent
ab3a6d3441
commit
a81e269a7e
3 changed files with 9 additions and 14 deletions
15
meson.build
15
meson.build
|
|
@ -95,17 +95,12 @@ have_avx = cc.has_argument(avx_args)
|
||||||
have_avx2 = cc.has_argument(avx2_args)
|
have_avx2 = cc.has_argument(avx2_args)
|
||||||
|
|
||||||
have_neon = false
|
have_neon = false
|
||||||
if host_machine.cpu_family() == 'arm' or host_machine.cpu_family() == 'aarch64'
|
if host_machine.cpu_family() == 'aarch64'
|
||||||
if cc.compiles(
|
neon_args = []
|
||||||
'''
|
have_neon = true
|
||||||
#include <arm_neon.h>
|
elif cc.has_argument('-mfpu=neon')
|
||||||
int32x4_t testfunc(int16_t *a, int16_t *b) {
|
neon_args = ['-mfpu=neon']
|
||||||
return vmull_s16(vld1_s16(a), vld1_s16(b));
|
|
||||||
}
|
|
||||||
''',
|
|
||||||
name : 'NEON support')
|
|
||||||
have_neon = true
|
have_neon = true
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ if have_neon
|
||||||
audioconvert_neon = static_library('audioconvert_neon',
|
audioconvert_neon = static_library('audioconvert_neon',
|
||||||
['resample-native-neon.c',
|
['resample-native-neon.c',
|
||||||
'fmt-ops-neon.c' ],
|
'fmt-ops-neon.c' ],
|
||||||
c_args : ['-O3', '-DHAVE_NEON'],
|
c_args : [neon_args, '-O3', '-DHAVE_NEON'],
|
||||||
include_directories : [spa_inc],
|
include_directories : [spa_inc],
|
||||||
install : false
|
install : false
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ static void inner_product_neon(float *d, const float * SPA_RESTRICT s,
|
||||||
"5:"
|
"5:"
|
||||||
" vadd.f32 d0, d0, d1\n"
|
" vadd.f32 d0, d0, d1\n"
|
||||||
" vpadd.f32 d0, d0, d0\n"
|
" vpadd.f32 d0, d0, d0\n"
|
||||||
" str d0, [%[d]]\n"
|
" vstr d0, [%[d]]\n"
|
||||||
: [d] "+r" (d), [s] "+r" (s), [taps] "+r" (taps),
|
: [d] "+r" (d), [s] "+r" (s), [taps] "+r" (taps),
|
||||||
[n_taps] "+l" (n_taps), [remainder] "+l" (remainder)
|
[n_taps] "+l" (n_taps), [remainder] "+l" (remainder)
|
||||||
:
|
:
|
||||||
|
|
@ -209,7 +209,7 @@ static void inner_product_ip_neon(float *d, const float * SPA_RESTRICT s,
|
||||||
" vmla.f32 q0, q2, q10\n" /* sum[0] += sum[1] * x */
|
" vmla.f32 q0, q2, q10\n" /* sum[0] += sum[1] * x */
|
||||||
" vadd.f32 d0, d0, d1\n"
|
" vadd.f32 d0, d0, d1\n"
|
||||||
" vpadd.f32 d0, d0, d0\n"
|
" vpadd.f32 d0, d0, d0\n"
|
||||||
" str d0, [%[d]]\n"
|
" vstr d0, [%[d]]\n"
|
||||||
: [d] "+r" (d), [s] "+r" (s), [t0] "+r" (t0), [t1] "+r" (t1),
|
: [d] "+r" (d), [s] "+r" (s), [t0] "+r" (t0), [t1] "+r" (t1),
|
||||||
[n_taps] "+l" (n_taps), [x] "+l" (x)
|
[n_taps] "+l" (n_taps), [x] "+l" (x)
|
||||||
:
|
:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue