From: "Ronald S. Bultje" <[email protected]>
64-bit CPUs always have SSE available, thus there is no need to compile
in the 3dnow functions. This results in smaller binaries.
---
libavcodec/x86/fft.c | 2 ++
libavcodec/x86/fft_mmx.asm | 15 ++++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c
index 6349c23..f1c1c9d 100644
--- a/libavcodec/x86/fft.c
+++ b/libavcodec/x86/fft.c
@@ -25,6 +25,7 @@ av_cold void ff_fft_init_mmx(FFTContext *s)
{
#if HAVE_YASM
int has_vectors = av_get_cpu_flags();
+#if ARCH_X86_32
if (has_vectors & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
/* 3DNow! for K6-2/3 */
s->imdct_calc = ff_imdct_calc_3dnow;
@@ -37,6 +38,7 @@ av_cold void ff_fft_init_mmx(FFTContext *s)
s->imdct_half = ff_imdct_half_3dnow2;
s->fft_calc = ff_fft_calc_3dnow2;
}
+#endif
if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
/* SSE for P3/P4/K8 */
s->imdct_calc = ff_imdct_calc_sse;
diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm
index 8928440..54c839f 100644
--- a/libavcodec/x86/fft_mmx.asm
+++ b/libavcodec/x86/fft_mmx.asm
@@ -497,6 +497,7 @@ fft8 %+ SUFFIX:
ret
%endmacro
+%if ARCH_X86_32
INIT_MMX 3dnow2
FFT48_3DN
@@ -513,7 +514,7 @@ FFT48_3DN
INIT_MMX 3dnow
FFT48_3DN
-
+%endif
%define Z(x) [zcq + o1q*(x&6) + mmsize*(x&1)]
%define Z2(x) [zcq + o3q + mmsize*(x&1)]
@@ -624,10 +625,13 @@ cglobal fft_calc, 2,5,8
REP_RET
%endmacro
+%if ARCH_X86_32
INIT_MMX 3dnow
FFT_CALC_FUNC
INIT_MMX 3dnow2
FFT_CALC_FUNC
+%endif
+
INIT_XMM sse
FFT_CALC_FUNC
@@ -726,13 +730,17 @@ cglobal imdct_calc, 3,5,3
%endif
%endmacro
+%if ARCH_X86_32
INIT_MMX 3dnow
IMDCT_CALC_FUNC
INIT_MMX 3dnow2
IMDCT_CALC_FUNC
+%endif
+
INIT_XMM sse
IMDCT_CALC_FUNC
+%if ARCH_X86_32
INIT_MMX 3dnow
%define mulps pfmul
%define addps pfadd
@@ -743,6 +751,7 @@ DECL_PASS pass_3dnow, PASS_SMALL 1, [wq], [wq+o1q]
DECL_PASS pass_interleave_3dnow, PASS_BIG 0
%define pass_3dnow2 pass_3dnow
%define pass_interleave_3dnow2 pass_interleave_3dnow
+%endif
%ifdef PIC
%define SECTION_REL - $$
@@ -806,12 +815,14 @@ DECL_FFT 6, _interleave
INIT_XMM sse
DECL_FFT 5
DECL_FFT 5, _interleave
+%if ARCH_X86_32
INIT_MMX 3dnow
DECL_FFT 4
DECL_FFT 4, _interleave
INIT_MMX 3dnow2
DECL_FFT 4
DECL_FFT 4, _interleave
+%endif
INIT_XMM sse
%undef mulps
@@ -1075,11 +1086,13 @@ cglobal imdct_half, 3,12,8; FFTContext *s, FFTSample
*output, const FFTSample *i
DECL_IMDCT POSROTATESHUF
+%if ARCH_X86_32
INIT_MMX 3dnow
DECL_IMDCT POSROTATESHUF_3DNOW
INIT_MMX 3dnow2
DECL_IMDCT POSROTATESHUF_3DNOW
+%endif
INIT_YMM avx
--
1.7.9.5
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel