1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Cloned and hacked for uClibc by Paul Mundt, December 2003 */
3 /* Modified by SuperH, Inc. September 2003 */
4 ! Entry: arg0: destination
6 ! Exit: result: destination
8 ! SH5 code Copyright 2002 SuperH Ltd.
10 #if __BYTE_ORDER == __LITTLE_ENDIAN
18 .section .text..SHmedia32,"ax"
20 .type strcpy, @function
32 bnei/u r6,0,tr1 // shortstring
42 bgt/u r22, r23, tr2 // no_lddst
44 // r22 < r23 : Need to do a load from the destination.
45 // r22 == r23 : Doesn't actually need to load from destination,
46 // but still can be handled here.
52 beqi/l r6, 0, tr0 // loop
56 blink tr1, r63 // shortstring
58 // r22 > r23: note that for r22 == r23 the sthi.q would clobber
59 // bytes before the destination region.
63 beqi/l r6, 0, tr0 // loop
68 #if __BYTE_ORDER != __LITTLE_ENDIAN
69 pta/l shortstring2,tr1
78 blink tr4,r63 // return
87 bnei/u r6, 0, tr1 // shortstring
92 beqi/l r6, 0, tr0 // loop
96 blink tr1, r63 // shortstring