Revision 6ad1fa5a libavcodec/bswap.h

View differences:

libavcodec/bswap.h
94 94
    return (x>>8) | (x<<8);
95 95
}
96 96

  
97
#ifdef ARCH_ARM
98
static always_inline uint32_t bswap_32(uint32_t x){
99
    uint32_t t;
100
    __asm__ (
101
      "eor %1, %0, %0, ror #16 \n\t"
102
      "bic %1, %1, #0xFF0000   \n\t"
103
      "mov %0, %0, ror #8      \n\t"
104
      "eor %0, %0, %1, lsr #8  \n\t"
105
      : "+r"(x), "+r"(t));
106
    return x;
107
}
108
#else
97 109
static always_inline uint32_t bswap_32(uint32_t x){
98 110
    x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
99 111
    return (x>>16) | (x<<16);
100 112
}
113
#endif
101 114

  
102 115
static inline uint64_t bswap_64(uint64_t x)
103 116
{

Also available in: Unified diff