[FFmpeg-cvslog] r14239 - trunk/libavutil/bswap.h

matthieu castet castet.matthieu
Tue Jul 15 22:59:50 CEST 2008


Hi,

mru wrote:
> ==============================================================================
> --- trunk/libavutil/bswap.h	(original)
> +++ trunk/libavutil/bswap.h	Tue Jul 15 21:05:49 2008
> @@ -40,6 +40,8 @@ static av_always_inline av_const uint16_
>      asm("rorw $8, %0" : "+r"(x));
>  #elif defined(ARCH_SH4)
>      asm("swap.b %0,%0" : "=r"(x) : "0"(x));
> +#elif defined(HAVE_ARMV6)
> +    asm("rev16 %0, %0" : "+r"(x));
>  #else
>      x= (x>>8) | (x<<8);
BTW did you see that gcc transform this into [1]
     rev16 r0, r0
     mov r0, r0, asl #16
     mov r0, r0, lsr #16

Gcc asm inline seem to assume we are unable to output real 16 bits 
value, and do 2 extras operations to do the 32 to 16 bits cast...


[1] At least with CodeSourcery 2007q3




More information about the ffmpeg-cvslog mailing list