Parent Directory | Revision Log | Patch
revision 1.2 by okuji, Thu Feb 7 23:28:47 2002 UTC | revision 1.3 by okuji, Sat Jun 15 00:47:08 2002 UTC | |
---|---|---|
# | Line 109 le16 (__uint16_t x) | Line 109 le16 (__uint16_t x) |
109 | static inline __const__ __uint32_t | static inline __const__ __uint32_t |
110 | le32 (__uint32_t x) | le32 (__uint32_t x) |
111 | { | { |
112 | #if 0 | |
113 | /* 386 doesn't have bswap. */ | |
114 | __asm__("bswap %0" : "=r" (x) : "0" (x)); | __asm__("bswap %0" : "=r" (x) : "0" (x)); |
115 | #else | |
116 | /* This is slower but this works on all x86 architectures. */ | |
117 | __asm__("xchgb %b0, %h0" \ | |
118 | "\n\troll $16, %0" \ | |
119 | "\n\txchgb %b0, %h0" \ | |
120 | : "=q" (x) : "0" (x)); | |
121 | #endif | |
122 | return x; | return x; |
123 | } | } |
124 |
|
savannah-hackers-public@gnu.org | ViewVC Help |
Powered by ViewVC 1.1.26 |