[FFmpeg-devel] [PATCH] avfilter/vf_fspp.c: make the filter compile with latest LLVM

Michael Niedermayer michaelni at gmx.at
Thu Oct 31 21:17:34 CET 2013


On Thu, Oct 31, 2013 at 12:16:55PM -0700, Thierry Foucu wrote:
> On Thu, Oct 31, 2013 at 12:09 PM, Reimar Döffinger <Reimar.Doeffinger at gmx.de
> > wrote:
> 
> > On Thu, Oct 31, 2013 at 11:53:22AM -0700, Thierry Foucu wrote:
> > > Make the vf_fspp code not use the incorrectly documented and essentially
> > > compiler-internal inline assembly constraint "o" which simply does not
> > work
> > > the way it was being used. Instead, pass explicit memory operands out of
> > the
> > > array of temporaries. The compiler is smart enough to build them with
> > > immediate offsets of a common register address.
> > >
> > > In the process, remove 2 unused 8-byte temporaries from two functions in
> > this
> > > filter. Doing this saves 16 bytes of stack space, and in row_idct_mmx
> > allows
> > > the use of simpler addressing modes (no offset from %rsp) which saves 3
> > bytes
> > > of encoded instruction stream.
> > >
> > > Otherwise, this produces *exactly* the same assembly as the previous
> > version,
> > > but can be assembled by LLVM as well as GCC.
> >
> > Which gcc versions did you try with?
> >
> 
> I tried with only one version of gcc "version 4.6.3"
> 
> For LLVM, i used :
> 
> clang version 3.4 (trunk 192869)
> 
> 
> Without this change, clang reports this type of errors:
> 
> libavfilter/libmpcodecs/vf_fspp.c:1975:42: error: unknown token in expression
>         "paddw %%mm4, %%mm1            \n\t"
>                                          ^
> <inline asm>:22:18: note: instantiated into assembly here
>         movq %mm5, 0*8+(%r12)
>                         ^
> libavfilter/libmpcodecs/vf_fspp.c:1978:42: error: unknown token in expression
>         "punpcklbw %%mm7, %%mm3        \n\t"
>                                          ^
> <inline asm>:24:18: note: instantiated into assembly here
>         movq %mm6, 1*8+(%r12)
> 

just tried some compilers i had installed on my box (sadly there are
no old ones amongth them) but
clang version 3.1 (trunk 144800)
fails to build the new code with -m32 -O0 but succeeds with the old

/home/michael/ffmpeg-git/ffmpeg/libavfilter/libmpcodecs/vf_fspp.c:878:9: error: ran out of registers during register allocation
        ".p2align " "4" "\n\t"
        ^
/home/michael/ffmpeg-git/ffmpeg/libavfilter/libmpcodecs/vf_fspp.c:878:9: error: ran out of registers during register allocation
3 warnings and 2 errors generated.



[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131031/2aeaff8f/attachment.asc>


More information about the ffmpeg-devel mailing list