1
2
3
4
5
6
7
8
9
10
11 .macro HEXAGON_OPT_FUNC_BEGIN name
12 .text
13 .p2align 4
14 .globl \name
15 .type \name, @function
16\name:
17 .endm
18
19 .macro HEXAGON_OPT_FUNC_FINISH name
20 .size \name, . - \name
21 .endm
22
23
24
25HEXAGON_OPT_FUNC_BEGIN memset
26 {
27 r6 =
28 r7 = extractu(r0,
29 p0 = cmp.eq(r2,
30 p1 = cmp.gtu(r2,
31 }
32 {
33 r4 = vsplatb(r1)
34 r8 = r0
35 r9 = sub(r6, r7)
36 if p0 jumpr r31
37 }
38 {
39 r3 =
40 r7 =
41 p0 = tstbit(r9,
42 if p1 jump 2f
43 }
44
45
46
47 loop0(1f, r2)
48 .falign
491:
50 {
51 memb(r8++
52 }:endloop0
53 jumpr r31
54 .falign
552:
56 {
57 r6 =
58 p0 = tstbit(r9,
59 p1 = cmp.eq(r2,
60 if !p0 jump 3f
61 }
62 {
63 memb(r8++
64 r3:2 = sub(r3:2, r7:6)
65 if p1 jumpr r31
66 }
67 .falign
683:
69 {
70 r6 =
71 p0 = tstbit(r9,
72 p1 = cmp.eq(r2,
73 if !p0 jump 4f
74 }
75 {
76 memh(r8++
77 r3:2 = sub(r3:2, r7:6)
78 if p1 jumpr r31
79 }
80 .falign
814:
82 {
83 r6 =
84 p0 = cmp.gtu(r2,
85 p1 = cmp.eq(r2,
86 if !p0 jump 5f
87 }
88 {
89 memw(r8++
90 r3:2 = sub(r3:2, r7:6)
91 p0 = cmp.gtu(r2,
92 if p1 jumpr r31
93 }
94 .falign
955:
96 {
97 r10 = lsr(r2,
98 p1 = cmp.eq(r3,
99 if !p0 jump 7f
100 }
101 {
102 r5 = r4
103 r6 =
104 loop0(6f, r10)
105 }
106
107
108
109 .falign
1106:
111 {
112 memd(r8++
113 r3:2 = sub(r3:2, r7:6)
114 p1 = cmp.eq(r2,
115 }:endloop0
116 .falign
1177:
118 {
119 p0 = tstbit(r2,
120 if p1 jumpr r31
121 }
122 {
123 r6 =
124 p0 = tstbit(r2,
125 p1 = cmp.eq(r2,
126 if !p0 jump 8f
127 }
128 {
129 memw(r8++
130 r3:2 = sub(r3:2, r7:6)
131 if p1 jumpr r31
132 }
133 .falign
1348:
135 {
136 p1 = cmp.eq(r2,
137 if !p0 jump 9f
138 }
139 {
140 memh(r8++
141 if p1 jumpr r31
142 }
143 .falign
1449:
145 {
146 memb(r8++
147 jumpr r31
148 }
149HEXAGON_OPT_FUNC_FINISH memset
150#endif
151
152
153
154
155HEXAGON_OPT_FUNC_BEGIN memset
156 {
157 r7=vsplatb(r1)
158 r6 = r0
159 if (r2==
160 }
161 {
162 r5:4=combine(r7,r7)
163 p0 = cmp.gtu(r2,
164 if (p0.new) jump:nt .L3
165 }
166 {
167 r3 = r0
168 loop0(.L47,r2)
169 }
170 .falign
171.L47:
172 {
173 memb(r3++
174 }:endloop0
175 jumpr r31
176.L3:
177 {
178 p0 = tstbit(r0,
179 if (!p0.new) jump:nt .L8
180 p1 = cmp.eq(r2,
181 }
182 {
183 r6 = add(r0,
184 r2 = add(r2,
185 memb(r0) = r1
186 if (p1) jump .L1
187 }
188.L8:
189 {
190 p0 = tstbit(r6,
191 if (!p0.new) jump:nt .L10
192 }
193 {
194 r2 = add(r2,
195 memh(r6++
196 p0 = cmp.eq(r2,
197 if (p0.new) jump:nt .L1
198 }
199.L10:
200 {
201 p0 = tstbit(r6,
202 if (!p0.new) jump:nt .L12
203 }
204 {
205 r2 = add(r2,
206 memw(r6++
207 p0 = cmp.eq(r2,
208 if (p0.new) jump:nt .L1
209 }
210.L12:
211 {
212 p0 = cmp.gtu(r2,
213 if (!p0.new) jump:nt .L14
214 }
215 r3 = and(r6,
216 if (r3==
217 {
218 memd(r6++
219 r2 = add(r2,
220 }
221 r3 = and(r6,
222 if (r3==
223 {
224 memd(r6++
225 r2 = add(r2,
226 }
227 r3 = and(r6,
228 if (r3==
229 {
230 memd(r6++
231 r2 = add(r2,
232 }
233.L17:
234 {
235 r3 = lsr(r2,
236 if (r1!=
237 }
238 {
239 r8 = r3
240 r3 = r6
241 loop0(.L46,r3)
242 }
243 .falign
244.L46:
245 {
246 dczeroa(r6)
247 r6 = add(r6,
248 r2 = add(r2,
249 }:endloop0
250.L14:
251 {
252 p0 = cmp.gtu(r2,
253 if (!p0.new) jump:nt .L28
254 r8 = lsr(r2,
255 }
256 loop0(.L44,r8)
257 .falign
258.L44:
259 {
260 memd(r6++
261 r2 = add(r2,
262 }:endloop0
263.L28:
264 {
265 p0 = tstbit(r2,
266 if (!p0.new) jump:nt .L33
267 }
268 {
269 r2 = add(r2,
270 memw(r6++
271 }
272.L33:
273 {
274 p0 = tstbit(r2,
275 if (!p0.new) jump:nt .L35
276 }
277 {
278 r2 = add(r2,
279 memh(r6++
280 }
281.L35:
282 p0 = cmp.eq(r2,
283 if (p0) memb(r6) = r1
284.L1:
285 jumpr r31
286.L18:
287 loop0(.L45,r3)
288 .falign
289.L45:
290 dczeroa(r6)
291 {
292 memd(r6++
293 r2 = add(r2,
294 }
295 memd(r6++
296 memd(r6++
297 {
298 memd(r6++
299 }:endloop0
300 jump .L14
301HEXAGON_OPT_FUNC_FINISH memset
302#endif
303