Mercurial > libavutil.hg
comparison x86/bswap.h @ 993:f8db9a2bae05 libavutil
Add av_ prefix to bswap macros
author | mru |
---|---|
date | Sat, 10 Jul 2010 22:12:30 +0000 |
parents | 0795a743bda1 |
children |
comparison
equal
deleted
inserted
replaced
992:a13125b5be3a | 993:f8db9a2bae05 |
---|---|
26 | 26 |
27 #include <stdint.h> | 27 #include <stdint.h> |
28 #include "config.h" | 28 #include "config.h" |
29 #include "libavutil/attributes.h" | 29 #include "libavutil/attributes.h" |
30 | 30 |
31 #define bswap_16 bswap_16 | 31 #define av_bswap16 av_bswap16 |
32 static av_always_inline av_const uint16_t bswap_16(uint16_t x) | 32 static av_always_inline av_const uint16_t av_bswap16(uint16_t x) |
33 { | 33 { |
34 __asm__("rorw $8, %0" : "+r"(x)); | 34 __asm__("rorw $8, %0" : "+r"(x)); |
35 return x; | 35 return x; |
36 } | 36 } |
37 | 37 |
38 #define bswap_32 bswap_32 | 38 #define av_bswap32 av_bswap32 |
39 static av_always_inline av_const uint32_t bswap_32(uint32_t x) | 39 static av_always_inline av_const uint32_t av_bswap32(uint32_t x) |
40 { | 40 { |
41 #if HAVE_BSWAP | 41 #if HAVE_BSWAP |
42 __asm__("bswap %0" : "+r" (x)); | 42 __asm__("bswap %0" : "+r" (x)); |
43 #else | 43 #else |
44 __asm__("rorw $8, %w0 \n\t" | 44 __asm__("rorw $8, %w0 \n\t" |
48 #endif | 48 #endif |
49 return x; | 49 return x; |
50 } | 50 } |
51 | 51 |
52 #if ARCH_X86_64 | 52 #if ARCH_X86_64 |
53 #define bswap_64 bswap_64 | 53 #define av_bswap64 av_bswap64 |
54 static inline uint64_t av_const bswap_64(uint64_t x) | 54 static inline uint64_t av_const av_bswap64(uint64_t x) |
55 { | 55 { |
56 __asm__("bswap %0": "=r" (x) : "0" (x)); | 56 __asm__("bswap %0": "=r" (x) : "0" (x)); |
57 return x; | 57 return x; |
58 } | 58 } |
59 #endif | 59 #endif |