Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

28 lines
445 B
ArmAsm

/* $NetBSD: swab.S,v 1.11 2014/03/18 18:20:37 riastradh Exp $ */
#include <machine/asm.h>
ENTRY(swab)
movl 4(%sp),%a0 | source
movl 8(%sp),%a1 | destination
movl 12(%sp),%d0 | count
lsrl #1,%d0 | count is in bytes; we need words
jeq swdone
swloop:
#ifdef __mcoldfire__
movb (%a0)+,1(%a1)
movb (%a0)+,(%a1)
addql #2,%a1
#else
movw (%a0)+,%d1
rorw #8,%d1
movw %d1,(%a1)+
#endif
subql #1,%d0
jne swloop
swdone:
rts
END(swab)