[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] build-sys: meson: check if NEON code can be compiled on arm
PulseAudio Marge Bot (@pulseaudio-merge-bot)
gitlab at gitlab.freedesktop.org
Sat Jun 5 15:19:55 UTC 2021
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
6d2a49a6 by garrison at 2021-06-05T15:14:59+00: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>
- - - - -
1 changed file:
- src/pulsecore/meson.build
Changes:
=====================================
src/pulsecore/meson.build
=====================================
@@ -172,16 +172,37 @@ endif
# FIXME: SIMD support (ORC)
simd = import('unstable-simd')
-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'],
- c_args : [pa_c_args],
- include_directories : [configinc, topinc],
- implicit_include_directories : false,
- compiler : cc)
-libpulsecore_simd_lib = libpulsecore_simd[0]
-cdata.merge_from(libpulsecore_simd[1])
+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',
+ kwargs : simd_kwargs,
+ c_args : [pa_c_args],
+ include_directories : [configinc, topinc],
+ implicit_include_directories : false,
+ compiler : cc)
+
+ libpulsecore_simd_lib += libpulsecore_simd[0]
+ cdata.merge_from(libpulsecore_simd[1])
+endforeach
if host_machine.system() == 'windows'
libpulsecore_sources += ['mutex-win32.c',
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/6d2a49a6a1eacc2096d0d9473a074421c181ab56
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/6d2a49a6a1eacc2096d0d9473a074421c181ab56
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210605/707c2bfd/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list