byte_swap_2.S revision 1.1 1 1.1 cherry /* $FreeBSD$ */
2 1.1 cherry /* $NetBSD: byte_swap_2.S,v 1.1 2006/04/07 13:57:43 cherry Exp $ */
3 1.1 cherry
4 1.1 cherry /*-
5 1.1 cherry * Copyright (c) 1996 Carnegie-Mellon University.
6 1.1 cherry * All rights reserved.
7 1.1 cherry *
8 1.1 cherry * Author: Chris G. Demetriou
9 1.1 cherry *
10 1.1 cherry * Permission to use, copy, modify and distribute this software and
11 1.1 cherry * its documentation is hereby granted, provided that both the copyright
12 1.1 cherry * notice and this permission notice appear in all copies of the
13 1.1 cherry * software, derivative works or modified versions, and any portions
14 1.1 cherry * thereof, and that both notices appear in supporting documentation.
15 1.1 cherry *
16 1.1 cherry * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 1.1 cherry * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 1.1 cherry * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 1.1 cherry *
20 1.1 cherry * Carnegie Mellon requests users of this software to return to
21 1.1 cherry *
22 1.1 cherry * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
23 1.1 cherry * School of Computer Science
24 1.1 cherry * Carnegie Mellon University
25 1.1 cherry * Pittsburgh PA 15213-3890
26 1.1 cherry *
27 1.1 cherry * any improvements or extensions that they make and grant Carnegie the
28 1.1 cherry * rights to redistribute these changes.
29 1.1 cherry */
30 1.1 cherry
31 1.1 cherry #include <machine/asm.h>
32 1.1 cherry
33 1.1 cherry #ifndef NAME
34 1.1 cherry #error NAME not defined
35 1.1 cherry #endif
36 1.1 cherry
37 1.1 cherry /*
38 1.1 cherry * Byte-swap a 2-byte quantity. (Convert 0x0123 to 0x2301.)
39 1.1 cherry *
40 1.1 cherry * Argument is an unsigned 2-byte integer (u_int16_t).
41 1.1 cherry */
42 1.1 cherry ENTRY(NAME, 1)
43 1.1 cherry mux1 r16=in0,@rev
44 1.1 cherry ;;
45 1.1 cherry extr.u r8=r16,48,16
46 1.1 cherry br.ret.sptk.few rp
47 1.1 cherry END(NAME)
48