[FFmpeg-cvslog] r12188 - in trunk/libavcodec: armv4l/dsputil_iwmmxt.c dsputil.h i386/cputest.c i386/dsputil_mmx.c

Rich Felker dalias
Mon Feb 25 02:41:41 CET 2008


On Sun, Feb 24, 2008 at 07:55:10PM +0000, M?ns Rullg?rd wrote:
> Rich Felker <dalias at aerifal.cx> writes:
> 
> > On Sun, Feb 24, 2008 at 03:46:23PM +0100, reimar wrote:
> >> Author: reimar
> >> Date: Sun Feb 24 15:46:22 2008
> >> New Revision: 12188
> >> 
> >> Log:
> >> __asm __volatile -> asm volatile, improves code consistency and works
> >> (as far as that is possible) with the Sun C compiler.
> >
> > Indeed, this is much saner. __asm is reserved for the implementation
> > so using it is rather inadvisible.
> 
> There is nothing wrong with using a reserved identifier to invoke
> implementation-specific functionality.  It is declaring things in the
> reserved namespace that should never be done.
> 
> It is of course generally bad to rely on specific implementation
> details, but when it comes to inline assembler, that is the only
> option.
> 
> > asm is reserved for the application, so at worst, if the
> > implementation doesn't support asm but does support __asm, then just
> > use -Dasm=__asm and be happy. The other way around is not valid,
> > though.
> 
> This is a good reason to use the _-less version.

This is what I meant by the above things you 'refuted'. If a compiler
happened to have __asm but not asm, then -Dasm=__asm is valid. On the
other hand, if your code contains literal __asm in it and that's not
what your compiler happens to use, defining __asm yourself is illegal
and might cause all sorts of breakage.

Rich




More information about the ffmpeg-cvslog mailing list