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.
This commit is contained in:
Diego Biurrun 2011-05-27 21:18:12 +02:00
parent faf8d3ddfa
commit 5e528cffcf
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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)
{