2011-02-14 20:36:03 +01:00
|
|
|
/* Written by Anders Magnusson. Public Domain */
|
|
|
|
|
|
|
|
#include <machine/asm.h>
|
|
|
|
|
2012-11-15 12:06:41 +01:00
|
|
|
RCSID("$NetBSD: bswap64.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
|
|
|
|
2011-02-14 20:36:03 +01:00
|
|
|
ENTRY(bswap64, 0)
|
|
|
|
movq 4(%ap),%r3
|
|
|
|
rotl $-8,%r3,%r1
|
|
|
|
insv %r1,$16,$8,%r1
|
|
|
|
rotl $8,%r3,%r2
|
|
|
|
movb %r2,%r1
|
|
|
|
rotl $-8,%r4,%r0
|
|
|
|
insv %r0,$16,$8,%r0
|
|
|
|
rotl $8,%r4,%r2
|
|
|
|
movb %r2,%r0
|
|
|
|
ret
|
2012-11-15 12:06:41 +01:00
|
|
|
END(bswap64)
|