xref: /netbsd-src/sys/lib/libkern/arch/sh3/byte_swap_8.S (revision 95e1ffb15694e54f29f8baaa4232152b703c2a5a)
1*95e1ffb1Schristos/*	$NetBSD: byte_swap_8.S,v 1.2 2005/12/11 12:24:44 christos Exp $ */
2be72e49cSuwe
3be72e49cSuwe/*
4be72e49cSuwe * Copyright (c) 2003 Valeriy E. Ushakov
5be72e49cSuwe * All rights reserved.
6be72e49cSuwe *
7be72e49cSuwe * Redistribution and use in source and binary forms, with or without
8be72e49cSuwe * modification, are permitted provided that the following conditions
9be72e49cSuwe * are met:
10be72e49cSuwe * 1. Redistributions of source code must retain the above copyright
11be72e49cSuwe *    notice, this list of conditions and the following disclaimer.
12be72e49cSuwe * 2. Redistributions in binary form must reproduce the above copyright
13be72e49cSuwe *    notice, this list of conditions and the following disclaimer in the
14be72e49cSuwe *    documentation and/or other materials provided with the distribution.
15be72e49cSuwe * 3. The name of the author may not be used to endorse or promote products
16be72e49cSuwe *    derived from this software without specific prior written permission
17be72e49cSuwe *
18be72e49cSuwe * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19be72e49cSuwe * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20be72e49cSuwe * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21be72e49cSuwe * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22be72e49cSuwe * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23be72e49cSuwe * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24be72e49cSuwe * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25be72e49cSuwe * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26be72e49cSuwe * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27be72e49cSuwe * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28be72e49cSuwe */
29be72e49cSuwe
30be72e49cSuwe#include <machine/asm.h>
31be72e49cSuwe
32be72e49cSuwe#if defined(LIBC_SCCS) && !defined(lint)
33*95e1ffb1Schristos	RCSID("$NetBSD: byte_swap_8.S,v 1.2 2005/12/11 12:24:44 christos Exp $")
34be72e49cSuwe#endif
35be72e49cSuwe
36be72e49cSuweENTRY(bswap64)
37be72e49cSuwe	swap.b	r4,r4
38be72e49cSuwe	swap.b	r5,r5
39be72e49cSuwe	swap.w	r4,r4
40be72e49cSuwe	swap.w	r5,r5
41be72e49cSuwe	swap.b	r4,r1
42be72e49cSuwe	rts
43be72e49cSuwe	 swap.b	r5,r0
44