1 /* Cloned and hacked for uClibc by Paul Mundt, December 2003 */
2 /* Modified by SuperH, Inc. September 2003 */
3 ! Entry: arg0: destination
5 ! Exit: result: destination
7 ! SH5 code Copyright 2002 SuperH Ltd.
9 #if __BYTE_ORDER == __LITTLE_ENDIAN
17 .section .text..SHmedia32,"ax"
19 .type strcpy, @function
31 bnei/u r6,0,tr1 // shortstring
41 bgt/u r22, r23, tr2 // no_lddst
43 // r22 < r23 : Need to do a load from the destination.
44 // r22 == r23 : Doesn't actually need to load from destination,
45 // but still can be handled here.
51 beqi/l r6, 0, tr0 // loop
55 blink tr1, r63 // shortstring
57 // r22 > r23: note that for r22 == r23 the sthi.q would clobber
58 // bytes before the destination region.
62 beqi/l r6, 0, tr0 // loop
67 #if __BYTE_ORDER != __LITTLE_ENDIAN
68 pta/l shortstring2,tr1
77 blink tr4,r63 // return
86 bnei/u r6, 0, tr1 // shortstring
91 beqi/l r6, 0, tr0 // loop
95 blink tr1, r63 // shortstring