Revision be449fca libavutil/bswap.h

View differences:

libavutil/bswap.h
33 33
static av_always_inline av_const uint16_t bswap_16(uint16_t x)
34 34
{
35 35
#if defined(ARCH_X86)
36
    asm("rorw $8, %0" : "+r"(x));
36
    __asm__("rorw $8, %0" : "+r"(x));
37 37
#elif defined(ARCH_SH4)
38
    asm("swap.b %0,%0" : "=r"(x) : "0"(x));
38
    __asm__("swap.b %0,%0" : "=r"(x) : "0"(x));
39 39
#elif defined(HAVE_ARMV6)
40
    asm("rev16 %0, %0" : "+r"(x));
40
    __asm__("rev16 %0, %0" : "+r"(x));
41 41
#else
42 42
    x= (x>>8) | (x<<8);
43 43
#endif
......
48 48
{
49 49
#if defined(ARCH_X86)
50 50
#ifdef HAVE_BSWAP
51
    asm("bswap   %0" : "+r" (x));
51
    __asm__("bswap   %0" : "+r" (x));
52 52
#else
53
    asm("rorw    $8,  %w0 \n\t"
53
    __asm__("rorw    $8,  %w0 \n\t"
54 54
        "rorl    $16, %0  \n\t"
55 55
        "rorw    $8,  %w0"
56 56
        : "+r"(x));
57 57
#endif
58 58
#elif defined(ARCH_SH4)
59
    asm("swap.b %0,%0\n"
59
    __asm__("swap.b %0,%0\n"
60 60
        "swap.w %0,%0\n"
61 61
        "swap.b %0,%0\n"
62 62
        : "=r"(x) : "0"(x));
63 63
#elif defined(HAVE_ARMV6)
64
    asm("rev %0, %0" : "+r"(x));
64
    __asm__("rev %0, %0" : "+r"(x));
65 65
#elif defined(ARCH_ARMV4L)
66 66
    uint32_t t;
67
    asm ("eor %1, %0, %0, ror #16 \n\t"
67
    __asm__ ("eor %1, %0, %0, ror #16 \n\t"
68 68
         "bic %1, %1, #0xFF0000   \n\t"
69 69
         "mov %0, %0, ror #8      \n\t"
70 70
         "eor %0, %0, %1, lsr #8  \n\t"
71 71
         : "+r"(x), "+r"(t));
72 72
#elif defined(ARCH_BFIN)
73 73
    unsigned tmp;
74
    asm("%1 = %0 >> 8 (V);      \n\t"
74
    __asm__("%1 = %0 >> 8 (V);      \n\t"
75 75
        "%0 = %0 << 8 (V);      \n\t"
76 76
        "%0 = %0 | %1;          \n\t"
77 77
        "%0 = PACK(%0.L, %0.H); \n\t"
......
90 90
    x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
91 91
    return (x>>32) | (x<<32);
92 92
#elif defined(ARCH_X86_64)
93
  asm("bswap  %0": "=r" (x) : "0" (x));
93
  __asm__("bswap  %0": "=r" (x) : "0" (x));
94 94
  return x;
95 95
#else
96 96
    union {

Also available in: Unified diff