Commit 3209e02e authored by diego's avatar diego

Faster 32 bit byteswaping code for Blackfin.

200% faster on BF537 compiled with gcc 4.1.
patch by Marc Hoffman, mmh pleasantst com


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8802 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d850c1e5
...@@ -125,6 +125,18 @@ static av_always_inline uint32_t bswap_32(uint32_t x){ ...@@ -125,6 +125,18 @@ static av_always_inline uint32_t bswap_32(uint32_t x){
: "+r"(x), "+r"(t)); : "+r"(x), "+r"(t));
return x; return x;
} }
#elif defined(ARCH_BFIN)
static av_always_inline uint32_t bswap_32(uint32_t x){
unsigned tmp;
asm("%1 = %0 >> 8 (V);\n\t"
"%0 = %0 << 8 (V);\n\t"
"%0 = %0 | %1;\n\t"
"%0 = PACK(%0.L, %0.H);\n\t"
: "+d"(x), "=&d"(tmp));
return x;
}
#else #else
static av_always_inline uint32_t bswap_32(uint32_t x){ static av_always_inline uint32_t bswap_32(uint32_t x){
x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment