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