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