[FFmpeg-devel] [PATCH] Fix ff_imdct_calc_sse() on gcc-4.6.

Ronald S. Bultje rsbultje
Wed Feb 2 03:27:54 CET 2011


Hi,

2011/2/1 M?ns Rullg?rd <mans at mansr.com>:
> Alex Converse <alex.converse at gmail.com> writes:
>> From 72140b8760c0014e6e05484e17440795a7a6e651 Mon Sep 17 00:00:00 2001
>> From: Alex Converse <alex.converse at gmail.com>
>> Date: Sun, 30 Jan 2011 01:04:41 -0800
>> Subject: [PATCH] Fix ff_imdct_calc_sse() on gcc-4.6.
>>
>> Gcc 4.6 only preserves the first value when using a vector with an "m"
>> constraint.
>> ---
>> ?libavcodec/x86/fft_sse.c | ? ?7 +++----
>> ?1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/libavcodec/x86/fft_sse.c b/libavcodec/x86/fft_sse.c
>> index 9f02816..0d151bc 100644
>> --- a/libavcodec/x86/fft_sse.c
>> +++ b/libavcodec/x86/fft_sse.c
>> @@ -23,7 +23,7 @@
>> ?#include "libavcodec/dsputil.h"
>> ?#include "fft.h"
>>
>> -DECLARE_ALIGNED(16, static const int, m1m1m1m1)[4] =
>> +DECLARE_ASM_CONST(16, int, ff_m1m1m1m1)[4] =
>> ? ? ?{ 1 << 31, 1 << 31, 1 << 31, 1 << 31 };
>>
>> ?void ff_fft_dispatch_sse(FFTComplex *z, int nbits);
>> @@ -82,7 +82,7 @@ void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
>> ? ? ?j = -n;
>> ? ? ?k = n-16;
>> ? ? ?__asm__ volatile(
>> - ? ? ? ?"movaps %4, %%xmm7 \n"
>> + ? ? ? ?"movaps "MANGLE(ff_m1m1m1m1)", %%xmm7 \n"
>> ? ? ? ? ?"1: \n"
>> ? ? ? ? ?"movaps ? ? ? (%2,%1), %%xmm0 \n"
>> ? ? ? ? ?"movaps ? ? ? (%3,%0), %%xmm1 \n"
>> @@ -95,8 +95,7 @@ void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
>> ? ? ? ? ?"add $16, %0 \n"
>> ? ? ? ? ?"jl 1b \n"
>> ? ? ? ? ?:"+r"(j), "+r"(k)
>> - ? ? ? ?:"r"(output+n4), "r"(output+n4*3),
>> - ? ? ? ? "m"(*m1m1m1m1)
>> + ? ? ? ?:"r"(output+n4), "r"(output+n4*3)
>> ? ? ? ? ?XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm7")
>> ? ? ?);
>> ?}
>
> This looks correct as far as I can tell.

Yes this is OK.

Ronald



More information about the ffmpeg-devel mailing list