[Ffmpeg-cvslog] CVS: ffmpeg/libavutil bswap.h,1.12,1.13

Ivan Kalvachev ikalvachev
Wed Feb 22 18:31:55 CET 2006


2006/2/22, Michael Niedermayer <michaelni at gmx.at>:
> Hi
>
> On Wed, Feb 22, 2006 at 11:28:46AM +0100, Ivan Kalvachev CVS wrote:
> > Update of /cvsroot/ffmpeg/ffmpeg/libavutil
> > In directory mail:/var2/tmp/cvs-serv12847
> >
> > Modified Files:
> >       bswap.h
> > Log Message:
> > Use native bswap32 instruction when __CPU__ is x86_64 instead of generic 386 code.
> >
> >
> > Index: bswap.h
> > ===================================================================
> > RCS file: /cvsroot/ffmpeg/ffmpeg/libavutil/bswap.h,v
> > retrieving revision 1.12
> > retrieving revision 1.13
> > diff -u -d -r1.12 -r1.13
> > --- bswap.h   22 Dec 2005 01:10:11 -0000      1.12
> > +++ bswap.h   22 Feb 2006 10:28:44 -0000      1.13
> > @@ -27,7 +27,7 @@
> >
> >  static always_inline uint32_t bswap_32(uint32_t x)
> >  {
> > -#if __CPU__ > 386
> > +#if __CPU__ != 386
>
> hrmpf... reverse this!
> this will fail if __CPU__ is not set (and too if its a 286, and libavutil
> isnt so difficult to get working on a 286)

The 386 assembler code that is the other case of this expression won't
compile on
286 because it requires 32 bit operand (rorl) while 286 is 16 bit cpu.
So 286 port will requre major rewrite anyway.

Even if __CPU__ is not defined (that shuoldn't be valid case anyway) the
block is in "#if defined(ARCH_X86) || defined(ARCH_X86_64)" and they
shouldn't be
defined too.

My change would work with whatever name they give to the new x86 CPU branches,
as they won't get rid of this nice instruction.


Anyway if you insist I will change it to
#if (CPU > 386) || defined(ARCH_X86_64)





More information about the ffmpeg-cvslog mailing list