2 * libc/sysdeps/linux/v850/bits/byteswap.h -- Macros to swap the order
3 * of bytes in integer values
5 * Copyright (C) 2001 NEC Corporation
6 * Copyright (C) 2001 Miles Bader <miles@gnu.org>
7 * Copyright (C) 1997,1998,2001 Free Software Foundation, Inc.
9 * This file is subject to the terms and conditions of the GNU Lesser
10 * General Public License. See the file COPYING.LIB in the main
11 * directory of this archive for more details.
14 #ifndef _ASM_BITS_BYTESWAP_H
15 #define _ASM_BITS_BYTESWAP_H 1
17 #define __bswap_non_constant_16(x) \
19 ({ unsigned long int __bswap_16_v; \
20 __asm__ ("bsh %1, %0" : "=r" (__bswap_16_v) : "r" (x)); \
23 # define __bswap_non_constant_32(x) \
25 ({ unsigned long int __bswap_32_v; \
26 __asm__ ("bsw %1, %0" : "=r" (__bswap_32_v) : "r" (x)); \
31 #include <bits/byteswap-common.h>