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

Thierry Foucu tfoucu at gmail.com
Thu Oct 31 21:43:38 CET 2013


On Thu, Oct 31, 2013 at 1:17 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

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


damn.. i though it will be working fine. Sorry i could not test it against
old version.


>
> /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.
>
>

Any idea how we can resolve this problem?

Could it be a bug in clang then?


>
>
> [...]
> --
> 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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>


More information about the ffmpeg-devel mailing list