[FFmpeg-devel] [Patch] inline asm: fix arrays when used as named constraint

Michael Niedermayer michaelni at gmx.at
Wed May 7 16:53:16 CEST 2014


On Wed, May 07, 2014 at 02:31:46PM +1000, Matt Oliver wrote:
> This patch should fix the recent problems with icl and FATE (I wont get
> started on icl and inline asm issues).
> 
> Basically when the name of a static array was passed to MANGLE it is
> treated as a pointer to the first element in the array and can be offset
> accordingly to get other elements. However when using named constraints the
> compiler was adding an extra level of pointer indirection and instead
> MANGLE generated a pointer to a pointer to the first element. This is
> obviously not what the inline asm is expecting and so invalid values are
> loaded. A result is named constraints where the input constraint is an
> array need to be handled differently.
> 
> The attached patch adds the correct way to handle this, previous versions
> of icl hid this issue so it snuck through but the patch has been tested
> with as many compiler versions as I can get my hands on and fate tests pass
> with all of them now. Also tested with gcc using named constraints (as this
> is now used when lto is enabled) and all tests pass there as well (gcc -lto
> probably wasnt working correctly before this patch just no one noticed).
> 
> Matt

>  libavcodec/x86/cabac.h            |    4 ++--
>  libavcodec/x86/h264_i386.h        |    4 ++--
>  libavcodec/x86/idct_sse2_xvid.c   |    2 +-
>  libavcodec/x86/lpc.c              |    6 +++---
>  libavutil/x86/asm.h               |    6 ++++++
>  libswresample/x86/resample_mmx.h  |    4 ++--
>  libswscale/x86/yuv2rgb_template.c |    2 +-
>  7 files changed, 17 insertions(+), 11 deletions(-)
> d435df22140dd56e3effaa0cb3644e8d136874c7  inline-asm-fix-arrays-as-named-constraints.patch
> From 8b52a6fcf3af2ba628974924a1bf240c2ceffda8 Mon Sep 17 00:00:00 2001
> From: Matt Oliver <protogonoi at gmail.com>
> Date: Wed, 7 May 2014 14:16:26 +1000
> Subject: [PATCH] inline asm: fix arrays as named constraints.

applied

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140507/0648f25f/attachment.asc>


More information about the ffmpeg-devel mailing list