1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/arch/m32r/lib/memcpy.S
5 * Copyright (C) 2001 Hiroyuki Kondo, and Hirokazu Takata
6 * Copyright (C) 2004 Hirokazu Takata
8 * void *memcopy(void *dst, const void *src, int n);
16 #include <linux/linkage.h>
17 #include <asm/assembler.h>
19 #ifdef CONFIG_ISA_DUAL_ISSUE
24 mv r4, r0 || mv r7, r0
26 jc r14 || cmpeq r0, r1 ; return if r2=0
27 jc r14 ; return if r0=r1
36 ld r7, @r1+ || addi r3, #-1
37 st r7, @+r4 || cmpz r2
39 addi r4, #4 || jc r14 ; return if r2=0
40 #if defined(CONFIG_ISA_M32R2)
42 ldb r7, @r1 || addi r1, #1
43 addi r2, #-1 || stb r7, @r4+
45 #elif defined(CONFIG_ISA_M32R)
47 ldb r7, @r1 || addi r1, #1
48 addi r2, #-1 || stb r7, @r4
52 #error unknown isa configuration
57 #else /* not CONFIG_ISA_DUAL_ISSUE */
65 beq r0, r1, end_memcopy
91 #endif /* not CONFIG_ISA_DUAL_ISSUE */