[FFmpeg-devel] m68k code for bswap

ami_stuff ami_stuff
Mon Jul 6 16:44:41 CEST 2009


Hi,

Mans, do you know how to correctly inline this asm code for GCC?
I tryed myself, but I get only crashes while converting ape to wav:

move.l d0,d1
ror.l #8,d0
and.l #$ff00ff00,d0
rol.l #8,d1
and.l #$00ff00ff,d1
or.l d1,d0 

This is the same bswap_32 code like belowe, but probably optimized for 68060 CPU:

av_always_inline av_const uint32_t bswap_32(uint32_t x)
{
asm(
"rol.w #8,%0;"
"swap %0;"
"rol.w #8,%0;"
: "=d"(x)
: "0"(x)
: "cc"
);
return x;
}


#NO_APP
.text
.even
.globl _bswap_32
_bswap_32:
move.l 4(sp),d0
#APP
rol.w #8,d0;swap d0;rol.w #8,d0;
#NO_APP
rts 

Regards



More information about the ffmpeg-devel mailing list