1/*
2Copyright (c) 2009 Nick Clifton <nickc@redhat.com>
3 */
4	.file	"mempcpy.S"
5
6	.section .text
7	.global  _mempcpy
8	.type	 _mempcpy,@function
9_mempcpy:
10#ifdef __RX_DISALLOW_STRING_INSNS__
11	/* Do not use the string instructions - they might prefetch
12	   bytes from outside of valid memory.  This is particularly
13	   dangerous in I/O space.  */
14
15	cmp	 #0, r3	      	; If the count is zero, do nothing
16	beq	 2f
17
181:	mov.b	 [r2+], r5
19	mov.b	 r5, [r1+]
20	sub	 #1, r3
21	bne	 1b
22
232:	rts
24#else
25	smovf
26	rts
27#endif
28	.size _mempcpy, . - _mempcpy
29