[FFmpeg-cvslog] x86: Add appropriate ifdefs around certain AVX functions.

Diego Biurrun git at videolan.org
Fri May 27 23:57:15 CEST 2011


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Fri May 27 21:18:12 2011 +0200| [5e528cffcf3d2cb1665075649601f4e62c8764e1] | committer: Diego Biurrun

x86: Add appropriate ifdefs around certain AVX functions.

nasm versions prior to 2.09 have trouble assembling some of our AVX code.
Protect these sections by preprocessor macros to allow compilation to pass.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e528cffcf3d2cb1665075649601f4e62c8764e1
---

 libavcodec/x86/fft_mmx.asm |    8 ++++++++
 libavcodec/x86/fft_sse.c   |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm
index bd2e829..27276a1 100644
--- a/libavcodec/x86/fft_mmx.asm
+++ b/libavcodec/x86/fft_mmx.asm
@@ -299,6 +299,7 @@ IF%1 mova  Z(1), m5
 
 INIT_YMM
 
+%ifdef HAVE_AVX
 align 16
 fft8_avx:
     mova      m0, Z(0)
@@ -387,6 +388,7 @@ fft32_interleave_avx:
     sub r2d, mmsize/4
     jg .deint_loop
     ret
+%endif
 
 INIT_XMM
 %define movdqa  movaps
@@ -532,6 +534,7 @@ DEFINE_ARGS z, w, n, o1, o3
 
 INIT_YMM
 
+%ifdef HAVE_AVX
 %macro INTERL_AVX 5
     vunpckhps      %3, %2, %1
     vunpcklps      %2, %2, %1
@@ -545,6 +548,7 @@ INIT_YMM
 
 DECL_PASS pass_avx, PASS_BIG 1
 DECL_PASS pass_interleave_avx, PASS_BIG 0
+%endif
 
 INIT_XMM
 
@@ -634,8 +638,10 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits
     RET
 %endmacro ; DECL_FFT
 
+%ifdef HAVE_AVX
 DECL_FFT 6, _avx
 DECL_FFT 6, _avx, _interleave
+%endif
 DECL_FFT 5, _sse
 DECL_FFT 5, _sse, _interleave
 DECL_FFT 4, _3dn
@@ -847,4 +853,6 @@ DECL_IMDCT _sse, POSROTATESHUF
 
 INIT_YMM
 
+%ifdef HAVE_AVX
 DECL_IMDCT _avx, POSROTATESHUF_AVX
+%endif
diff --git a/libavcodec/x86/fft_sse.c b/libavcodec/x86/fft_sse.c
index 5b52988..add20dd 100644
--- a/libavcodec/x86/fft_sse.c
+++ b/libavcodec/x86/fft_sse.c
@@ -22,6 +22,7 @@
 #include "libavutil/x86_cpu.h"
 #include "libavcodec/dsputil.h"
 #include "fft.h"
+#include "config.h"
 
 DECLARE_ASM_CONST(16, int, ff_m1m1m1m1)[4] =
     { 1 << 31, 1 << 31, 1 << 31, 1 << 31 };
@@ -30,10 +31,12 @@ void ff_fft_dispatch_sse(FFTComplex *z, int nbits);
 void ff_fft_dispatch_interleave_sse(FFTComplex *z, int nbits);
 void ff_fft_dispatch_interleave_avx(FFTComplex *z, int nbits);
 
+#if HAVE_AVX
 void ff_fft_calc_avx(FFTContext *s, FFTComplex *z)
 {
     ff_fft_dispatch_interleave_avx(z, s->nbits);
 }
+#endif
 
 void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
 {



More information about the ffmpeg-cvslog mailing list