Commit 5e528cff authored by Diego Biurrun's avatar 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.
parent faf8d3dd
...@@ -299,6 +299,7 @@ IF%1 mova Z(1), m5 ...@@ -299,6 +299,7 @@ IF%1 mova Z(1), m5
INIT_YMM INIT_YMM
%ifdef HAVE_AVX
align 16 align 16
fft8_avx: fft8_avx:
mova m0, Z(0) mova m0, Z(0)
...@@ -387,6 +388,7 @@ fft32_interleave_avx: ...@@ -387,6 +388,7 @@ fft32_interleave_avx:
sub r2d, mmsize/4 sub r2d, mmsize/4
jg .deint_loop jg .deint_loop
ret ret
%endif
INIT_XMM INIT_XMM
%define movdqa movaps %define movdqa movaps
...@@ -532,6 +534,7 @@ DEFINE_ARGS z, w, n, o1, o3 ...@@ -532,6 +534,7 @@ DEFINE_ARGS z, w, n, o1, o3
INIT_YMM INIT_YMM
%ifdef HAVE_AVX
%macro INTERL_AVX 5 %macro INTERL_AVX 5
vunpckhps %3, %2, %1 vunpckhps %3, %2, %1
vunpcklps %2, %2, %1 vunpcklps %2, %2, %1
...@@ -545,6 +548,7 @@ INIT_YMM ...@@ -545,6 +548,7 @@ INIT_YMM
DECL_PASS pass_avx, PASS_BIG 1 DECL_PASS pass_avx, PASS_BIG 1
DECL_PASS pass_interleave_avx, PASS_BIG 0 DECL_PASS pass_interleave_avx, PASS_BIG 0
%endif
INIT_XMM INIT_XMM
...@@ -634,8 +638,10 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits ...@@ -634,8 +638,10 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits
RET RET
%endmacro ; DECL_FFT %endmacro ; DECL_FFT
%ifdef HAVE_AVX
DECL_FFT 6, _avx DECL_FFT 6, _avx
DECL_FFT 6, _avx, _interleave DECL_FFT 6, _avx, _interleave
%endif
DECL_FFT 5, _sse DECL_FFT 5, _sse
DECL_FFT 5, _sse, _interleave DECL_FFT 5, _sse, _interleave
DECL_FFT 4, _3dn DECL_FFT 4, _3dn
...@@ -847,4 +853,6 @@ DECL_IMDCT _sse, POSROTATESHUF ...@@ -847,4 +853,6 @@ DECL_IMDCT _sse, POSROTATESHUF
INIT_YMM INIT_YMM
%ifdef HAVE_AVX
DECL_IMDCT _avx, POSROTATESHUF_AVX DECL_IMDCT _avx, POSROTATESHUF_AVX
%endif
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "libavutil/x86_cpu.h" #include "libavutil/x86_cpu.h"
#include "libavcodec/dsputil.h" #include "libavcodec/dsputil.h"
#include "fft.h" #include "fft.h"
#include "config.h"
DECLARE_ASM_CONST(16, int, ff_m1m1m1m1)[4] = DECLARE_ASM_CONST(16, int, ff_m1m1m1m1)[4] =
{ 1 << 31, 1 << 31, 1 << 31, 1 << 31 }; { 1 << 31, 1 << 31, 1 << 31, 1 << 31 };
...@@ -30,10 +31,12 @@ void ff_fft_dispatch_sse(FFTComplex *z, int nbits); ...@@ -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_sse(FFTComplex *z, int nbits);
void ff_fft_dispatch_interleave_avx(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) void ff_fft_calc_avx(FFTContext *s, FFTComplex *z)
{ {
ff_fft_dispatch_interleave_avx(z, s->nbits); ff_fft_dispatch_interleave_avx(z, s->nbits);
} }
#endif
void ff_fft_calc_sse(FFTContext *s, FFTComplex *z) void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
{ {
......
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