Rex Dieter wrote:

> Felipe Sateler wrote:
> 
>>> Is there some reason you can't /build/ with SSE2 support on the
>>> compiler? Or were you suggesting that we needed to add  compiler flags
>>> to make this work?
>> 
>> My fear is that enabling SSE2 support globally for the library might
>> induce gcc to use SSE2 instructions in its generated code. See the
>> -msse section in the gcc manual[1]:
>> 
>>> In particular, the file containing the CPU detection code should be
>>> compiled without these options.
>> 
>> So, I think what is needed is to split sse-using functions to a
>> separate file and add -msse2 only to that file. However, I am not very
>> confident I understand this very well, so this may not be optimal
>> either.
> 
> Ah, sneaky, if that's true, the approach I took in the initial patches I
> posted elsewhere in this thread aren't ideal either.
> 
> I'll go back and see if I can work up something better.

OK, this version applies the -msse2 flag only to the source objects that 
need it, and it at least compiles.  No runtime testing done yet.

(I'll do more testing, and followup if I find anything more is needed)

-- Rex
diff -up webrtc-audio-processing-0.2/webrtc/common_audio/Makefile.am.x86_msse2 webrtc-audio-processing-0.2/webrtc/common_audio/Makefile.am
--- webrtc-audio-processing-0.2/webrtc/common_audio/Makefile.am.x86_msse2	2015-10-19 01:18:38.000000000 -0500
+++ webrtc-audio-processing-0.2/webrtc/common_audio/Makefile.am	2016-05-27 11:30:33.208347181 -0500
@@ -93,10 +93,17 @@ libcommon_audio_la_SOURCES = resampler/i
 			     window_generator.cc
 
 if HAVE_X86
-libcommon_audio_la_SOURCES += \
+noinst_LTLIBRARIES += libcommon_audio_sse2.la
+libcommon_audio_sse2_la_SOURCES = \
 			     resampler/sinc_resampler_sse.cc \
 			     fir_filter_sse.cc \
 			     fir_filter_sse.h
+
+libcommon_audio_sse2_la_CFLAGS = $(AM_CFLAGS) $(COMMON_CFLAGS) -msse2
+libcommon_audio_sse2_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS) -msse2
+libcommon_audio_sse2_la_LDFLAGS = $(AM_LDFLAGS)
+
+libcommon_audio_la_LIBADD = libcommon_audio_sse2.la 
 endif
 
 if HAVE_ARM
diff -up webrtc-audio-processing-0.2/webrtc/modules/audio_processing/Makefile.am.x86_msse2 webrtc-audio-processing-0.2/webrtc/modules/audio_processing/Makefile.am
--- webrtc-audio-processing-0.2/webrtc/modules/audio_processing/Makefile.am.x86_msse2	2015-11-19 06:41:44.000000000 -0600
+++ webrtc-audio-processing-0.2/webrtc/modules/audio_processing/Makefile.am	2016-05-27 11:31:18.164561776 -0500
@@ -147,9 +147,14 @@ libwebrtc_audio_processing_la_SOURCES +=
 endif
 
 if HAVE_X86
-libwebrtc_audio_processing_la_SOURCES += \
+noinst_LTLIBRARIES = libwebrtc_audio_processing_privatearch.la
+LIBWEBRTC_PRIVATEARCH=libwebrtc_audio_processing_privatearch.la
+libwebrtc_audio_processing_privatearch_la_SOURCES = \
 					aec/aec_core_sse2.c \
 					aec/aec_rdft_sse2.c
+libwebrtc_audio_processing_privatearch_la_CFLAGS = $(AM_CFLAGS) $(COMMON_CFLAGS) -msse2
+libwebrtc_audio_processing_privatearch_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS) -msse2
+libwebrtc_audio_processing_privatearch_la_LDFLAGS = $(AM_LDFLAGS)
 endif
 
 if HAVE_NEON
@@ -166,7 +171,8 @@ libwebrtc_audio_processing_la_LIBADD = $
 				       $(top_builddir)/webrtc/base/libbase.la \
 				       $(top_builddir)/webrtc/system_wrappers/libsystem_wrappers.la \
 				       $(top_builddir)/webrtc/common_audio/libcommon_audio.la \
-				       $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la
+				       $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la \
+				       $(LIBWEBRTC_PRIVATEARCH)
 libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBWEBRTC_AUDIO_PROCESSING_VERSION_INFO)
 
 # FIXME: The MIPS optimisations need to be hooked up once we have the

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to