OSDN Git Service

Blackfin: fix typo in byteswap.h commit
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / bfin / bits / byteswap.h
1 /* File: libc/sysdeps/linux/bfin/bits/byteswap.h
2  *
3  * Copyright 2004-2006 Analog Devices Inc.
4  *
5  * Enter bugs at http://blackfin.uclinux.org/
6  *
7  * Licensed under the GPL-2 or later.
8  */
9
10 #ifndef _ASM_BITS_BYTESWAP_H
11 #define _ASM_BITS_BYTESWAP_H 1
12
13 #define __bswap_non_constant_16(x) \
14      (__extension__                                                           \
15       ({ register unsigned short int __v;                                     \
16          __asm__ ("%0 = PACK (%1.L, %1.L);"                                   \
17                   "%0 >>= 8;"                                                 \
18                   : "=d" (__v)                                                \
19                   : "d" (x));                                                 \
20          __v; }))
21
22 #define __bswap_non_constant_32(x) \
23      (__extension__                                                           \
24       ({ register unsigned int __v;                                           \
25          __asm__ ("%1 = %0 >> 8 (V);"                                         \
26                   "%0 = %0 << 8 (V);"                                         \
27                   "%0 = %0 | %1;"                                             \
28                   "%1 = PACK(%0.L, %0.H);"                                    \
29                   : "+d"(x), "=&d"(__v));                                     \
30          __v; }))
31
32 #endif
33
34 #include <bits/byteswap-common.h>