[FFmpeg-devel] [PATCH] avutil: disable arch specific intmath routines if optimizations are disabled
Yu Xiaolei
dreifachstein at gmail.com
Tue Feb 16 16:00:38 CET 2016
On Tue, Feb 16, 2016 at 9:01 PM, Michael Niedermayer <michael at niedermayer.cc
> wrote:
> On Tue, Feb 16, 2016 at 02:40:10PM +0800, Xiaolei Yu wrote:
> > Current intmath routines for arm require inter-procedure constant
> propagation
> > and fail to compile when optimizations are disabled.
> > ---
> > configure | 1 +
> > libavutil/intmath.h | 2 ++
> > 2 files changed, 3 insertions(+)
>
> on arm without opts and this patch i get
> src/libavcodec/arm/aac.h: In function ‘VMUL4S’:
> src/libavcodec/arm/aac.h:102:5: error: can't find a register in class
> ‘LO_REGS’ while reloading ‘asm’
> src/libavcodec/arm/aac.h:102:5: error: ‘asm’ operand has impossible
> constraints
> make: *** [libavcodec/aacdec.o] Error 1
>
>
This error seems unrelated to the patch, but I am not sure as I am only
building some selected codecs.
Can you build again without the patch?
Without the patch I get:
In file included from src/libavutil/intmath.h:30:0,
from src/libavutil/common.h:106,
from src/libavutil/avutil.h:288,
from src/libavutil/samplefmt.h:24,
from src/libavcodec/avcodec.h:31,
from src/libavcodec/internal.h:33,
from src/libavcodec/h264_direct.c:28:
src/libavutil/arm/intmath.h: In function 'get_scale_factor':
src/libavutil/arm/intmath.h:69:5: warning: asm operand 2 probably doesn't
match constraints
__asm__ ("ssat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p+1));
^
src/libavutil/arm/intmath.h:69:5: error: impossible constraint in 'asm'
on x86 build passes with and without the patch here
> with what compiler is this needed ?
>
>
Yes, x86 builds fine without this patch. But the underlying problem is not
arch specific and may be encountered in other inline asm. I think current
patch is more consistent if we consider these routines as manual
optimizations.
The code __asm__ ("ssat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p+1)) is in
fact illegal as the bit position (p+1) is not a compile time constant. The
compiler can emit code only because p is known after constant propagation.
I am using gcc-4.9 shipped by android ndk r10e.
More information about the ffmpeg-devel
mailing list