fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / machine / m68k / strcpy.c
blobccc914193d7cec0d64796f984a724414122d3b11
1 /*
2 * C library strcpy routine
4 * This routine has been optimized for the CPU32+.
5 * It should run on all 68k machines.
7 * W. Eric Norum
8 * Saskatchewan Accelerator Laboratory
9 * University of Saskatchewan
10 * Saskatoon, Saskatchewan, CANADA
11 * eric@skatter.usask.ca
14 #include <string.h>
17 * Copy bytes using CPU32+ loop mode if possible
20 char *
21 strcpy (char *to, const char *from)
23 char *pto = to;
24 unsigned int n = 0xFFFF;
26 asm volatile ("1:\n"
27 "\tmove.b (%0)+,(%1)+\n"
28 #if defined(__mcpu32__)
29 "\tdbeq %2,1b\n"
30 #endif
31 "\tbne.b 1b\n" :
32 "=a" (from), "=a" (pto), "=d" (n) :
33 "0" (from), "1" (pto), "2" (n) :
34 "cc", "memory");
35 return to;