mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-23 06:59:53 -05:00
build-sys: meson: check if NEON code can be compiled on arm
When Meson SIMD module returns HAVE_NEON=1 on arm host, do extra compile check to verify compiler can actually handle NEON code. Related Meson issue #6361 https://github.com/mesonbuild/meson/issues/6361 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/574>
This commit is contained in:
parent
e0d9231bf4
commit
6d2a49a6a1
1 changed files with 31 additions and 10 deletions
|
|
@ -172,16 +172,37 @@ endif
|
|||
|
||||
# FIXME: SIMD support (ORC)
|
||||
simd = import('unstable-simd')
|
||||
simd_variants = [
|
||||
{ 'mmx' : ['remap_mmx.c', 'svolume_mmx.c'] },
|
||||
{ 'sse' : ['remap_sse.c', 'sconv_sse.c', 'svolume_sse.c'] },
|
||||
{ 'neon' : ['remap_neon.c', 'sconv_neon.c', 'mix_neon.c'] },
|
||||
]
|
||||
|
||||
libpulsecore_simd_lib = []
|
||||
|
||||
foreach simd_kwargs : simd_variants
|
||||
|
||||
if host_machine.cpu_family() == 'arm' and 'neon' in simd_kwargs
|
||||
if not cc.compiles('''
|
||||
#include <arm_neon.h>
|
||||
int main() {
|
||||
return sizeof(uint8x8_t) + sizeof(int32x4_t) + sizeof(float32x4_t);
|
||||
}
|
||||
''', name : 'neon code')
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
|
||||
libpulsecore_simd = simd.check('libpulsecore_simd',
|
||||
mmx : ['remap_mmx.c', 'svolume_mmx.c'],
|
||||
sse : ['remap_sse.c', 'sconv_sse.c', 'svolume_sse.c'],
|
||||
neon : ['remap_neon.c', 'sconv_neon.c', 'mix_neon.c'],
|
||||
kwargs : simd_kwargs,
|
||||
c_args : [pa_c_args],
|
||||
include_directories : [configinc, topinc],
|
||||
implicit_include_directories : false,
|
||||
compiler : cc)
|
||||
libpulsecore_simd_lib = libpulsecore_simd[0]
|
||||
|
||||
libpulsecore_simd_lib += libpulsecore_simd[0]
|
||||
cdata.merge_from(libpulsecore_simd[1])
|
||||
endforeach
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
libpulsecore_sources += ['mutex-win32.c',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue