From: Diego Biurrun Date: Fri, 27 May 2011 19:18:12 +0000 (+0200) Subject: x86: Add appropriate ifdefs around certain AVX functions. X-Git-Tag: v0.7rc1~256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e528cffcf3d2cb1665075649601f4e62c8764e1;p=platform%2Fupstream%2Flibav.git 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. --- 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) {