Revision 27af15dc libavutil/bswap.h

View differences:

libavutil/bswap.h
42 42
static av_always_inline uint16_t bswap_16(uint16_t x)
43 43
{
44 44
#if defined(ARCH_X86)
45
  __asm("rorw $8, %0"   :
46
        LEGACY_REGS (x) :
47
        "0" (x));
45
    __asm("rorw $8, %0"   :
46
          LEGACY_REGS (x) :
47
          "0" (x));
48 48
#elif defined(ARCH_SH4)
49
        __asm__("swap.b %0,%0":"=r"(x):"0"(x));
49
    __asm__("swap.b %0,%0":"=r"(x):"0"(x));
50 50
#else
51 51
    x= (x>>8) | (x<<8);
52 52
#endif
......
57 57
{
58 58
#if defined(ARCH_X86)
59 59
#if __CPU__ != 386
60
 __asm("bswap   %0":
61
      "=r" (x)     :
60
    __asm("bswap   %0":
61
          "=r" (x)    :
62 62
#else
63
 __asm("xchgb   %b0,%h0\n"
64
      "         rorl    $16,%0\n"
65
      "         xchgb   %b0,%h0":
66
      LEGACY_REGS (x)                :
63
    __asm("xchgb   %b0,%h0\n"
64
          "rorl    $16,%0 \n"
65
          "xchgb   %b0,%h0":
66
          LEGACY_REGS (x)  :
67 67
#endif
68
      "0" (x));
68
          "0" (x));
69 69
#elif defined(ARCH_SH4)
70
        __asm__(
71
        "swap.b %0,%0\n"
72
        "swap.w %0,%0\n"
73
        "swap.b %0,%0\n"
74
        :"=r"(x):"0"(x));
70
    __asm__("swap.b %0,%0\n"
71
            "swap.w %0,%0\n"
72
            "swap.b %0,%0\n"
73
            :"=r"(x):"0"(x));
75 74
#elif defined(ARCH_ARM)
76 75
    uint32_t t;
77
    __asm__ (
78
      "eor %1, %0, %0, ror #16 \n\t"
79
      "bic %1, %1, #0xFF0000   \n\t"
80
      "mov %0, %0, ror #8      \n\t"
81
      "eor %0, %0, %1, lsr #8  \n\t"
82
      : "+r"(x), "+r"(t));
76
    __asm__ ("eor %1, %0, %0, ror #16 \n\t"
77
             "bic %1, %1, #0xFF0000   \n\t"
78
             "mov %0, %0, ror #8      \n\t"
79
             "eor %0, %0, %1, lsr #8  \n\t"
80
             : "+r"(x), "+r"(t));
83 81
#elif defined(ARCH_BFIN)
84 82
    unsigned tmp;
85
    asm("%1 = %0 >> 8 (V);\n\t"
86
        "%0 = %0 << 8 (V);\n\t"
87
        "%0 = %0 | %1;\n\t"
88
        "%0 = PACK(%0.L, %0.H);\n\t"
83
    asm("%1 = %0 >> 8 (V);      \n\t"
84
        "%0 = %0 << 8 (V);      \n\t"
85
        "%0 = %0 | %1;          \n\t"
86
        "%0 = PACK(%0.L, %0.H); \n\t"
89 87
        : "+d"(x), "=&d"(tmp));
90 88
#else
91 89
    x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

Also available in: Unified diff