1/*
2Copyright (c) 1990 The Regents of the University of California.
3All rights reserved.
4
5Redistribution and use in source and binary forms are permitted
6provided that the above copyright notice and this paragraph are
7duplicated in all such forms and that any documentation,
8and/or other materials related to such
9distribution and use acknowledge that the software was developed
10by the University of California, Berkeley.  The name of the
11University may not be used to endorse or promote products derived
12from this software without specific prior written permission.
13THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 */
17#include <picolibc.h>
18
19	.file "memset.S"
20
21	.section .text
22	.global  _memset
23	.type	 _memset,@function
24_memset:
25	movm  [d2,d3,a2,a3], (sp)
26.Lend_of_prologue:
27	mov   d0, d3
28	mov   d1, d2
29	mov   (28, sp),a1
30	mov   d3, a0
31#ifndef __OPTIMIZE_SIZE__
32	cmp   3, a1
33	bls   .L41
34	btst  3, d3
35	bne   .L41
36	extbu d2
37	mov   d2, d1
38	asl   8, d1
39	or    d2, d1
40	mov   d1, d0
41	asl   16, d0
42	or    d0, d1
43	cmp   15, a1
44	bls   .L36
45	setlb
46	mov   d1, (a0)
47	inc4  a0
48	mov   d1, (a0)
49	inc4  a0
50	mov   d1, (a0)
51	inc4  a0
52	mov   d1, (a0)
53	inc4  a0
54	add  -16, a1
55	cmp   15, a1
56	lhi
57.L36:
58	cmp   3, a1
59	bls   .L41
60	setlb
61	mov   d1, (a0)
62	inc4  a0
63	add   -4, a1
64	cmp   3, a1
65	lhi
66.L41:
67#endif
68	cmp   0, a1
69	beq   .Lepilogue
70	setlb
71	movbu d2, (a0)
72	inc   a0
73	sub   1, a1
74	lne
75.Lepilogue:
76	mov d3,a0
77	ret [d2,d3,a2,a3], 16
78.Lend_of_memset:
79	.size	 _memset, .Lend_of_memset - _memset
80
81	.section	.debug_frame,"",@progbits
82.Lstart_of_debug_frame:
83	# Common Information Entry (CIE)
84	.4byte	.Lend_of_CIE - .Lstart_of_CIE	# CIE Length
85.Lstart_of_CIE:
86	.4byte	 0xffffffff			# CIE Identifier Tag
87	.byte	 0x1				# CIE Version
88	.ascii   "\0"				# CIE Augmentation
89	.uleb128 0x1				# CIE Code Alignment Factor
90	.sleb128 -4				# CIE Data Alignment Factor
91	.byte	 0x32				# CIE RA Column
92	.byte	 0xc				# DW_CFA_def_cfa
93	.uleb128 0x9
94	.uleb128 0x0
95	.byte	 0xb2				# DW_CFA_offset, column 0x32
96	.uleb128 0x0
97	.align   2
98.Lend_of_CIE:
99
100	# Frame Description Entry (FDE)
101	.4byte	.Lend_of_FDE - .Lstart_of_FDE	# FDE Length
102.Lstart_of_FDE:
103	.4byte	 .Lstart_of_debug_frame		# FDE CIE offset
104	.4byte	 _memset			# FDE initial location
105	.4byte	 .Lend_of_memset - _memset	# FDE address range
106	.byte	 0x4				# DW_CFA_advance_loc4
107	.4byte	 .Lend_of_prologue - _memset
108	.byte	 0xe				# DW_CFA_def_cfa_offset
109	.uleb128 0x4
110	.byte	 0x87				# DW_CFA_offset, column 0x7
111	.uleb128 0x1
112	.align 2
113.Lend_of_FDE:
114