fix x86 sse2 runtime detection

tried and failed doing the same for arm neon support
This commit is contained in:
Rex Dieter 2016-05-16 13:18:46 -05:00
parent 28695292b7
commit 9556fffdef
5 changed files with 47 additions and 38 deletions

View File

@ -1,12 +0,0 @@
diff -up webrtc-audio-processing-0.2/configure.ac.no_sse2_x86 webrtc-audio-processing-0.2/configure.ac
--- webrtc-audio-processing-0.2/configure.ac.no_sse2_x86 2015-11-04 01:49:34.000000000 -0600
+++ webrtc-audio-processing-0.2/configure.ac 2016-05-13 11:55:30.199168174 -0500
@@ -56,7 +56,7 @@ AS_CASE(["${host}"],
AC_SUBST(PLATFORM_CFLAGS)
AS_CASE(["${host_cpu}"],
- [i?86|x86_64],
+ [x86_64],
[
HAVE_X86=1
],

View File

@ -1,12 +0,0 @@
diff -up webrtc-audio-processing-0.2/configure.no_sse2_x86 webrtc-audio-processing-0.2/configure
--- webrtc-audio-processing-0.2/configure.no_sse2_x86 2015-11-04 01:50:11.000000000 -0600
+++ webrtc-audio-processing-0.2/configure 2016-05-13 11:55:38.964203868 -0500
@@ -16104,7 +16104,7 @@ esac
case "${host_cpu}" in #(
- i?86|x86_64) :
+ x86_64) :
HAVE_X86=1
;; #(

View File

@ -0,0 +1,15 @@
diff -up webrtc-audio-processing-0.2/configure.ac.x86_sse2 webrtc-audio-processing-0.2/configure.ac
--- webrtc-audio-processing-0.2/configure.ac.x86_sse2 2015-11-04 01:49:34.000000000 -0600
+++ webrtc-audio-processing-0.2/configure.ac 2016-05-16 12:27:16.640796437 -0500
@@ -56,6 +56,11 @@ AS_CASE(["${host}"],
AC_SUBST(PLATFORM_CFLAGS)
AS_CASE(["${host_cpu}"],
+ [i?86],
+ [
+ HAVE_X86=1
+ ARCH_CFLAGS="-msse2"
+ ],
[i?86|x86_64],
[
HAVE_X86=1

View File

@ -0,0 +1,12 @@
diff -up webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc.x86_sse2 webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc
--- webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc.x86_sse2 2015-11-19 06:41:44.000000000 -0600
+++ webrtc-audio-processing-0.2/webrtc/common_audio/fir_filter.cc 2016-05-16 12:31:21.558877588 -0500
@@ -45,7 +45,7 @@ FIRFilter* FIRFilter::Create(const float
FIRFilter* filter = NULL;
// If we know the minimum architecture at compile time, avoid CPU detection.
#if defined(WEBRTC_ARCH_X86_FAMILY)
-#if defined(__SSE2__)
+#if 0 //defined(__SSE2__)
filter =
new FIRFilterSSE2(coefficients, coefficients_length, max_input_length);
#else

View File

@ -1,8 +1,4 @@
%ifarch %{arm}
%global neon --enable-neon=no
%endif
Name: webrtc-audio-processing
Version: 0.2
Release: 2%{?dist}
@ -12,12 +8,9 @@ License: BSD
URL: http://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/
Source0: http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/%{name}-%{version}.tar.xz
Patch0: webrtc-fix-typedefs-on-other-arches.patch
# can't use sse2 on %%ix86 in fedora
Patch1: webrtc-audio-processing-0.2-no_sse2_x86.patch
# match for patch1 when autoreconf'ing (unused, so far)
Patch10: webrtc-audio-processing-0.2-no_sse2_x86-ac.patch
Patch2: webrtc-audio-processing-0.2-no_undefined.patch
Patch1: webrtc-audio-processing-0.2-no_undefined.patch
Patch2: webrtc-audio-processing-0.2-x86_msse2.patch
Patch3: webrtc-audio-processing-0.2-x86_sse2_runtime_detection.patch
BuildRequires: automake libtool
@ -37,15 +30,27 @@ files for developing applications that use %{name}.
%prep
%setup -q
%patch0 -p1 -b .typedef
%patch1 -p1 -b .no_sse2_x86
%patch10 -p1 -b .no_sse2_x86_ac
%patch2 -p1 -b .no_undefined
%patch1 -p1 -b .no_undefined
%patch2 -p1 -b .x86_msse2
%ifarch %{ix86}
%patch3 -p1 -b .x86_sse2_runtime_detection
%endif
# for patch10/patch2
# for patch1/patch2
autoreconf -fi
%build
%ifarch %{arm}
# disable neon support
# can't unconditionally enable neon, and --enable-neon=runtime is broken (WebRtc_GetCPUFeaturesARM is unimplemented)
%global neon --enable-neon=no
## hack to ensure -mfpu=neon flag appears last when using --enable-neon=yes|runtime
#export CFLAGS="%{optflags} -mfpu=neon"
#export CXXFLAGS="%{optflags} -mfpu=neon"
%endif
%configure \
%{?neon} \
--disable-silent-rules \
@ -76,6 +81,7 @@ rm -fv %{buildroot}%{_libdir}/lib*.la
%changelog
* Mon May 16 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.2-2
- link w/ --no-undefined
- fix x86 sse2 runtime detection
* Thu May 12 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.2-1
- webrtc-audio-processing-0.2 (#1335536)