[FFmpeg-devel] [PATCH] Move CPU detection to libavutil and cleanup

Stefano Sabatini stefano.sabatini-lala
Mon Aug 30 00:40:41 CEST 2010


On date Tuesday 2010-08-24 10:19:40 +0200, Stefano Sabatini encoded:
> On date Tuesday 2010-08-24 00:21:08 +0100, M?ns Rullg?rd encoded:
> > Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> [...]
> > > Updated with a less absurd name and with actually moving the code (not
> > > only the declaration of the interface) from libavcodec to libavutil.
> > >
> > > I preferred to put all the code in a single cpuid.c file rather than
> > > split the code in various x86/ppc/arm, also because this way it looked
> > > simpler.
> > 
> > Arch-specific code goes in the arch dirs.  No discussion.
> 
> No problem.
> 
> > > FF_MM_* flags also maybe should be renamed something like:
> > >
> > > AV_CPU_MM_FLAG_*
> > > or maybe:
> > > AVCPU_MM_FLAG_*
> > >
> > > Please review it, regards.
> > 
> > Didn't we mostly agree on dropping the global mm_flags (used only in
> > emms_c())?  A patch for that is underway as soon as it finishes
> > testing here.  Getting rid of that global should reduce the size of
> > this patch significantly.
> 
> I'll update this patch as soon as your patch will get applied.

Updated, but the patch is still *huge* and not yet ready for
application, I could possibly try to put the ff_has_altivec() change
to a separate patch.

Also I'm not sure the way I'm dealing with the CPU specific code
(cpu.c including x86/cpu.h, ppc/cpu.h, arm/cpu.h) is acceptable, and
the compilation of cpu-test fails with:

make cpu-test
CC	cpu.o
In file included from cpu.c:27:
x86/cpu.h: In function ?av_get_cpu_mm_flags?:
x86/cpu.h:50: error: ?x86_reg? undeclared (first use in this function)
x86/cpu.h:50: error: (Each undeclared identifier is reported only once
x86/cpu.h:50: error: for each function it appears in.)
x86/cpu.h:50: error: expected ?;? before ?a?
x86/cpu.h:67: error: ?a? undeclared (first use in this function)
x86/cpu.h:67: error: ?c? undeclared (first use in this function)
x86/cpu.h:76: error: expected ?:? or ?)? before ?REG_b?
x86/cpu.h:79: error: expected ?:? or ?)? before ?REG_b?
x86/cpu.h:102: error: expected ?:? or ?)? before ?REG_b?
x86/cpu.h:105: error: expected ?:? or ?)? before ?REG_b?
x86/cpu.h:44: warning: unused variable ?edx?
x86/cpu.h:44: warning: unused variable ?ecx?
x86/cpu.h:44: warning: unused variable ?ebx?
x86/cpu.h:51: error: invalid lvalue in asm output 0
x86/cpu.h:51: error: invalid lvalue in asm output 1
make: *** [cpu.o] Error 1

I didn't investigated the issue since I'm quite sure someone can point
me in the right direction in few seconds, I don't even know where
x86_reg is supposed to be defined.

Regards.
-- 
FFmpeg = Free Foolish Most Power Ecumenical Goblin



More information about the ffmpeg-devel mailing list