File: byteswap.h

package info (click to toggle)
uclibc 1.0.54-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,176 kB
  • sloc: ansic: 230,009; asm: 30,803; cpp: 4,799; makefile: 2,911; sh: 716; yacc: 610; perl: 535; lex: 364; awk: 40
file content (34 lines) | stat: -rw-r--r-- 886 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* File: libc/sysdeps/linux/bfin/bits/byteswap.h
 *
 * Copyright 2004-2006 Analog Devices Inc.
 *
 * Enter bugs at http://blackfin.uclinux.org/
 *
 * Licensed under the GPL-2 or later.
 */

#ifndef _ASM_BITS_BYTESWAP_H
#define _ASM_BITS_BYTESWAP_H 1

#define __bswap_non_constant_16(x) \
     (__extension__							      \
      ({ register unsigned short int __v;				      \
	 __asm__ ("%0 = PACK (%1.L, %1.L);"				      \
		  "%0 >>= 8;"						      \
		  : "=d" (__v)						      \
		  : "d" (x));						      \
	 __v; }))

#define __bswap_non_constant_32(x) \
     (__extension__							      \
      ({ register unsigned int __v;					      \
	 __asm__ ("%1 = %0 >> 8 (V);"					      \
		  "%0 = %0 << 8 (V);"					      \
		  "%0 = %0 | %1;"					      \
		  "%1 = PACK(%0.L, %0.H);"				      \
		  : "+d"(x), "=&d"(__v));				      \
	 __v; }))

#endif

#include <bits/byteswap-common.h>