1; SPDX-License-Identifier: GPL-2.0-only
2;  Port on Texas Instruments TMS320C6x architecture
3;
4;  Copyright (C) 2006, 2009, 2010 Texas Instruments Incorporated
5;  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
6;
7
8#include <linux/linkage.h>
9
10	.text
11
12ENTRY(memcpy)
13	AND	.L1	0x1,A6,A0
14 ||	AND	.S1	0x2,A6,A1
15 ||	AND	.L2X	0x4,A6,B0
16 ||	MV	.D1	A4,A3
17 ||	MVC	.S2	ILC,B2
18
19   [A0] LDB	.D2T1	*B4++,A5
20   [A1] LDB	.D2T1	*B4++,A7
21   [A1] LDB	.D2T1	*B4++,A8
22   [B0] LDNW	.D2T1	*B4++,A9
23 ||	SHRU	.S2X	A6,0x3,B1
24  [!B1] BNOP	.S2	B3,1
25
26   [A0] STB	.D1T1	A5,*A3++
27 ||[B1] MVC	.S2	B1,ILC
28   [A1] STB	.D1T1	A7,*A3++
29   [A1] STB	.D1T1	A8,*A3++
30   [B0] STNW	.D1T1	A9,*A3++	; return when len < 8
31
32	SPLOOP	2
33
34	LDNDW	.D2T1	*B4++,A9:A8
35	NOP	3
36
37	NOP
38	SPKERNEL	0,0
39 ||	STNDW	.D1T1	A9:A8,*A3++
40
41	BNOP	.S2	B3,4
42	MVC	.S2	B2,ILC
43ENDPROC(memcpy)
44