Commit ae4d7204 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Fix/re-enable SSE/SSE2 lpc optimisations.

parent d6fa2907
...@@ -415,6 +415,11 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then ...@@ -415,6 +415,11 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
XIPH_ADD_CFLAGS([-fgnu89-inline]) XIPH_ADD_CFLAGS([-fgnu89-inline])
fi fi
if test "x$asm_optimisation" = "xyes" ; then
XIPH_ADD_CFLAGS([-msse])
XIPH_ADD_CFLAGS([-msse2])
fi
fi fi
XIPH_ADD_CFLAGS([-Wextra]) XIPH_ADD_CFLAGS([-Wextra])
......
...@@ -430,7 +430,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) ...@@ -430,7 +430,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info)
#endif #endif
} }
#if defined FLAC__CPU_X86_64 && defined FLAC__HAS_X86INTRIN #if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN
#if defined _MSC_VER && (_MSC_VER >= 1400) #if defined _MSC_VER && (_MSC_VER >= 1400)
#include <intrin.h> /* for __cpuid() */ #include <intrin.h> /* for __cpuid() */
...@@ -456,4 +456,4 @@ void FLAC__cpu_info_x86(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx) ...@@ -456,4 +456,4 @@ void FLAC__cpu_info_x86(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx)
*flags_ecx = *flags_edx = 0; *flags_ecx = *flags_edx = 0;
#endif #endif
} }
#endif /* FLAC__HAS_X86INTRIN && FLAC__CPU_X86_64 */ #endif /* (FLAC__CPU_IA32 || FLAC__HAS_X86INTRIN) && FLAC__CPU_X86_64 */
...@@ -91,7 +91,7 @@ void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flag ...@@ -91,7 +91,7 @@ void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flag
FLAC__uint32 FLAC__cpu_info_extended_amd_asm_ia32(void); FLAC__uint32 FLAC__cpu_info_extended_amd_asm_ia32(void);
#endif #endif
#if defined FLAC__CPU_X86_64 && defined FLAC__HAS_X86INTRIN #if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN
void FLAC__cpu_info_x86(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx); void FLAC__cpu_info_x86(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx);
#endif #endif
......
...@@ -79,13 +79,11 @@ void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16(const FLAC__real data ...@@ -79,13 +79,11 @@ void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16(const FLAC__real data
void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
# endif # endif
# endif # endif
# if defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64 # if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN
# ifdef FLAC__HAS_X86INTRIN
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_4(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_4(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_8(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_8(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_12(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_12(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_16(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_16(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
# endif
# endif # endif
#endif #endif
...@@ -156,10 +154,8 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32(const FLAC__int32 ...@@ -156,10 +154,8 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32(const FLAC__int32
void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]);
# endif # endif
# endif # endif
# if defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64 # if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN
# ifdef FLAC__HAS_X86INTRIN
void FLAC__lpc_compute_residual_from_qlp_coefficients_16_intrin_sse2(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); void FLAC__lpc_compute_residual_from_qlp_coefficients_16_intrin_sse2(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]);
# endif
# endif # endif
#endif #endif
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#ifndef FLAC__INTEGER_ONLY_LIBRARY #ifndef FLAC__INTEGER_ONLY_LIBRARY
#ifndef FLAC__NO_ASM #ifndef FLAC__NO_ASM
#if defined FLAC__CPU_X86_64 && defined FLAC__HAS_X86INTRIN #if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN
#include "FLAC/assert.h" #include "FLAC/assert.h"
#include "FLAC/format.h" #include "FLAC/format.h"
...@@ -561,6 +561,6 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_16_intrin_sse2(const FLAC_ ...@@ -561,6 +561,6 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_16_intrin_sse2(const FLAC_
} }
} }
#endif /* FLAC__CPU_X86_64 && FLAC__HAS_X86INTRIN */ #endif /* (FLAC__CPU_IA32 || FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN */
#endif /* FLAC__NO_ASM */ #endif /* FLAC__NO_ASM */
#endif /* FLAC__INTEGER_ONLY_LIBRARY */ #endif /* FLAC__INTEGER_ONLY_LIBRARY */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment