Use MMX ASM fucntions instead of SSE4.1 if available master
authorlvqcl <lvqcl.mail@gmail.com>
Sat, 2 Mar 2019 20:56:03 +0000 (23:56 +0300)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 7 Mar 2019 20:01:19 +0000 (07:01 +1100)
These SSE4.1 functions are not always faster than their MMX ASM counterparts,
so let's use ASM functions if they're available.

src/libFLAC/stream_decoder.c

index 40ea826..db1f320 100644 (file)
@@ -396,8 +396,10 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_(
 #if FLAC__HAS_X86INTRIN && ! defined FLAC__INTEGER_ONLY_LIBRARY
 # if defined FLAC__SSE4_1_SUPPORTED
                if (decoder->private_->cpuinfo.x86.sse41) {
+#  if !defined FLAC__HAS_NASM  /* these are not undoubtedly faster than their MMX ASM counterparts */
                        decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal_intrin_sse41;
                        decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_16_intrin_sse41;
+#  endif
                        decoder->private_->local_lpc_restore_signal_64bit = FLAC__lpc_restore_signal_wide_intrin_sse41;
                }
 # endif