]> sourceware.org Git - glibc.git/blame - sysdeps/sparc/sparc32/memcpy.S
Update.
[glibc.git] / sysdeps / sparc / sparc32 / memcpy.S
CommitLineData
ae6b8730
RH
1/* Copy SIZE bytes from SRC to DEST.
2 For SPARC v7.
62f29da7 3 Copyright (C) 1996, 1999, 2003 Free Software Foundation, Inc.
ae6b8730
RH
4 This file is part of the GNU C Library.
5 Contributed by David S. Miller <davem@caip.rutgers.edu>,
6 Eddie C. Dost <ecd@skynet.be> and
7 Jakub Jelinek <jj@ultra.linux.cz>.
8
9 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
ae6b8730
RH
13
14 The GNU C Library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 17 Lesser General Public License for more details.
ae6b8730 18
41bdb6e2
AJ
19 You should have received a copy of the GNU Lesser General Public
20 License along with the GNU C Library; if not, write to the Free
21 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 02111-1307 USA. */
ae6b8730
RH
23
24#include <sysdep.h>
25
26/* Both these macros have to start with exactly the same insn */
27#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
28 ldd [%src + offset + 0x00], %t0; \
29 ldd [%src + offset + 0x08], %t2; \
30 ldd [%src + offset + 0x10], %t4; \
31 ldd [%src + offset + 0x18], %t6; \
32 st %t0, [%dst + offset + 0x00]; \
33 st %t1, [%dst + offset + 0x04]; \
34 st %t2, [%dst + offset + 0x08]; \
35 st %t3, [%dst + offset + 0x0c]; \
36 st %t4, [%dst + offset + 0x10]; \
37 st %t5, [%dst + offset + 0x14]; \
38 st %t6, [%dst + offset + 0x18]; \
39 st %t7, [%dst + offset + 0x1c];
40
41#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
42 ldd [%src + offset + 0x00], %t0; \
43 ldd [%src + offset + 0x08], %t2; \
44 ldd [%src + offset + 0x10], %t4; \
45 ldd [%src + offset + 0x18], %t6; \
46 std %t0, [%dst + offset + 0x00]; \
47 std %t2, [%dst + offset + 0x08]; \
48 std %t4, [%dst + offset + 0x10]; \
49 std %t6, [%dst + offset + 0x18];
50
51#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
52 ldd [%src - offset - 0x10], %t0; \
53 ldd [%src - offset - 0x08], %t2; \
54 st %t0, [%dst - offset - 0x10]; \
55 st %t1, [%dst - offset - 0x0c]; \
56 st %t2, [%dst - offset - 0x08]; \
57 st %t3, [%dst - offset - 0x04];
58
59#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
60 ldd [%src - offset - 0x10], %t0; \
61 ldd [%src - offset - 0x08], %t2; \
62 std %t0, [%dst - offset - 0x10]; \
63 std %t2, [%dst - offset - 0x08];
64
65#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
66 ldub [%src - offset - 0x02], %t0; \
67 ldub [%src - offset - 0x01], %t1; \
68 stb %t0, [%dst - offset - 0x02]; \
69 stb %t1, [%dst - offset - 0x01];
70
71/* Both these macros have to start with exactly the same insn */
72#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
73 ldd [%src - offset - 0x20], %t0; \
74 ldd [%src - offset - 0x18], %t2; \
75 ldd [%src - offset - 0x10], %t4; \
76 ldd [%src - offset - 0x08], %t6; \
77 st %t0, [%dst - offset - 0x20]; \
78 st %t1, [%dst - offset - 0x1c]; \
79 st %t2, [%dst - offset - 0x18]; \
80 st %t3, [%dst - offset - 0x14]; \
81 st %t4, [%dst - offset - 0x10]; \
82 st %t5, [%dst - offset - 0x0c]; \
83 st %t6, [%dst - offset - 0x08]; \
84 st %t7, [%dst - offset - 0x04];
85
86#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
87 ldd [%src - offset - 0x20], %t0; \
88 ldd [%src - offset - 0x18], %t2; \
89 ldd [%src - offset - 0x10], %t4; \
90 ldd [%src - offset - 0x08], %t6; \
91 std %t0, [%dst - offset - 0x20]; \
92 std %t2, [%dst - offset - 0x18]; \
93 std %t4, [%dst - offset - 0x10]; \
94 std %t6, [%dst - offset - 0x08];
95
96#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
97 ldd [%src + offset + 0x00], %t0; \
98 ldd [%src + offset + 0x08], %t2; \
99 st %t0, [%dst + offset + 0x00]; \
100 st %t1, [%dst + offset + 0x04]; \
101 st %t2, [%dst + offset + 0x08]; \
102 st %t3, [%dst + offset + 0x0c];
103
104#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
105 ldub [%src + offset + 0x00], %t0; \
106 ldub [%src + offset + 0x01], %t1; \
107 stb %t0, [%dst + offset + 0x00]; \
108 stb %t1, [%dst + offset + 0x01];
109
110#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
111 ldd [%src + offset + 0x00], %t0; \
112 ldd [%src + offset + 0x08], %t2; \
113 srl %t0, shir, %t5; \
114 srl %t1, shir, %t6; \
115 sll %t0, shil, %t0; \
116 or %t5, %prev, %t5; \
117 sll %t1, shil, %prev; \
118 or %t6, %t0, %t0; \
119 srl %t2, shir, %t1; \
120 srl %t3, shir, %t6; \
121 sll %t2, shil, %t2; \
122 or %t1, %prev, %t1; \
123 std %t4, [%dst + offset + offset2 - 0x04]; \
124 std %t0, [%dst + offset + offset2 + 0x04]; \
125 sll %t3, shil, %prev; \
126 or %t6, %t2, %t4;
127
128#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
129 ldd [%src + offset + 0x00], %t0; \
130 ldd [%src + offset + 0x08], %t2; \
131 srl %t0, shir, %t4; \
132 srl %t1, shir, %t5; \
133 sll %t0, shil, %t6; \
134 or %t4, %prev, %t0; \
135 sll %t1, shil, %prev; \
136 or %t5, %t6, %t1; \
137 srl %t2, shir, %t4; \
138 srl %t3, shir, %t5; \
139 sll %t2, shil, %t6; \
140 or %t4, %prev, %t2; \
141 sll %t3, shil, %prev; \
142 or %t5, %t6, %t3; \
143 std %t0, [%dst + offset + offset2 + 0x00]; \
144 std %t2, [%dst + offset + offset2 + 0x08];
145
146 .text
147 .align 4
148
14970: andcc %o1, 1, %g0
150 be 4f
151 andcc %o1, 2, %g0
152
153 ldub [%o1 - 1], %g2
154 sub %o1, 1, %o1
155 stb %g2, [%o0 - 1]
156 sub %o2, 1, %o2
157 be 3f
158 sub %o0, 1, %o0
1594: lduh [%o1 - 2], %g2
160 sub %o1, 2, %o1
161 sth %g2, [%o0 - 2]
162 sub %o2, 2, %o2
163 b 3f
164 sub %o0, 2, %o0
165
ae6b8730
RH
166ENTRY(bcopy)
167 mov %o0, %o3
168 mov %o1, %o0
169 mov %o3, %o1
ae6b8730
RH
170END(bcopy)
171ENTRY(memmove)
172 cmp %o0, %o1
173 st %o0, [%sp + 64]
174 bleu 9f
175 sub %o0, %o1, %o4
176
177 add %o1, %o2, %o3
178 cmp %o3, %o0
179 bleu 0f
180 andcc %o4, 3, %o5
181
182 add %o1, %o2, %o1
183 add %o0, %o2, %o0
184 bne 77f
185 cmp %o2, 15
186 bleu 91f
187 andcc %o1, 3, %g0
188 bne 70b
1893: andcc %o1, 4, %g0
190
191 be 2f
192 mov %o2, %g1
193
194 ld [%o1 - 4], %o4
195 sub %g1, 4, %g1
196 st %o4, [%o0 - 4]
197 sub %o1, 4, %o1
198 sub %o0, 4, %o0
62f29da7 1992: andcc %g1, 0xffffff80, %g6
ae6b8730
RH
200 be 3f
201 andcc %o0, 4, %g0
202
203 be 74f + 4
2045: RMOVE_BIGCHUNK(o1, o0, 0x00, o2, o3, o4, o5, g2, g3, g4, g5)
205 RMOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
206 RMOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
207 RMOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
62f29da7 208 subcc %g6, 128, %g6
ae6b8730
RH
209 sub %o1, 128, %o1
210 bne 5b
211 sub %o0, 128, %o0
212
62f29da7 2133: andcc %g1, 0x70, %g6
ae6b8730
RH
214 be 72f
215 andcc %g1, 8, %g0
216
62f29da7 217 srl %g6, 1, %o4
ae6b8730 218 mov %o7, %g2
62f29da7 219 add %g6, %o4, %o4
ae6b8730 220101: call 100f
62f29da7 221 sub %o1, %g6, %o1
ae6b8730
RH
222 mov %g2, %o7
223 jmpl %o5 + (72f - 101b), %g0
62f29da7 224 sub %o0, %g6, %o0
ae6b8730
RH
225
22671: RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g4, g5)
227 RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g4, g5)
228 RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g4, g5)
229 RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g4, g5)
230 RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g4, g5)
231 RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g4, g5)
232 RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g4, g5)
23372: be 73f
234 andcc %g1, 4, %g0
235
236 ldd [%o1 - 0x08], %g2
237 sub %o0, 8, %o0
238 sub %o1, 8, %o1
239 st %g2, [%o0]
240 st %g3, [%o0 + 0x04]
24173: be 1f
242 andcc %g1, 2, %g0
243
244 ld [%o1 - 4], %g2
245 sub %o1, 4, %o1
246 st %g2, [%o0 - 4]
247 sub %o0, 4, %o0
2481: be 1f
249 andcc %g1, 1, %g0
250
251 lduh [%o1 - 2], %g2
252 sub %o1, 2, %o1
253 sth %g2, [%o0 - 2]
254 sub %o0, 2, %o0
2551: be 1f
256 nop
257
258 ldub [%o1 - 1], %g2
259 stb %g2, [%o0 - 1]
2601: retl
261 ld [%sp + 64], %o0
262
26374: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, o2, o3, o4, o5, g2, g3, g4, g5)
264 RMOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
265 RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
266 RMOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
62f29da7 267 subcc %g6, 128, %g6
ae6b8730
RH
268 sub %o1, 128, %o1
269 bne 74b
270 sub %o0, 128, %o0
271
62f29da7 272 andcc %g1, 0x70, %g6
ae6b8730
RH
273 be 72b
274 andcc %g1, 8, %g0
275
62f29da7 276 srl %g6, 1, %o4
ae6b8730 277 mov %o7, %g2
62f29da7 278 add %g6, %o4, %o4
ae6b8730 279102: call 100f
62f29da7 280 sub %o1, %g6, %o1
ae6b8730
RH
281 mov %g2, %o7
282 jmpl %o5 + (72b - 102b), %g0
62f29da7 283 sub %o0, %g6, %o0
ae6b8730
RH
284
28575: and %o2, 0xe, %o3
286 mov %o7, %g2
287 sll %o3, 3, %o4
288 sub %o0, %o3, %o0
289103: call 100f
290 sub %o1, %o3, %o1
291 mov %g2, %o7
292 jmpl %o5 + (76f - 103b), %g0
293 andcc %o2, 1, %g0
294
295 RMOVE_SHORTCHUNK(o1, o0, 0x0c, g2, g3)
296 RMOVE_SHORTCHUNK(o1, o0, 0x0a, g2, g3)
297 RMOVE_SHORTCHUNK(o1, o0, 0x08, g2, g3)
298 RMOVE_SHORTCHUNK(o1, o0, 0x06, g2, g3)
299 RMOVE_SHORTCHUNK(o1, o0, 0x04, g2, g3)
300 RMOVE_SHORTCHUNK(o1, o0, 0x02, g2, g3)
301 RMOVE_SHORTCHUNK(o1, o0, 0x00, g2, g3)
302
30376: be 1f
304 nop
305 ldub [%o1 - 1], %g2
306 stb %g2, [%o0 - 1]
3071: retl
308 ld [%sp + 64], %o0
309
31091: bne 75b
311 andcc %o2, 8, %g0
312
313 be 1f
314 andcc %o2, 4, %g0
315
316 ld [%o1 - 0x08], %g2
317 ld [%o1 - 0x04], %g3
318 sub %o1, 8, %o1
319 st %g2, [%o0 - 0x08]
320 st %g3, [%o0 - 0x04]
321 sub %o0, 8, %o0
3221: b 73b
323 mov %o2, %g1
324
32577: cmp %o2, 15
326 bleu 75b
327 andcc %o0, 3, %g0
328 be 64f
329 andcc %o0, 1, %g0
330 be 63f
331 andcc %o0, 2, %g0
332 ldub [%o1 - 1], %g5
333 sub %o1, 1, %o1
334 stb %g5, [%o0 - 1]
335 sub %o0, 1, %o0
336 be 64f
337 sub %o2, 1, %o2
338
33963: ldub [%o1 - 1], %g5
340 sub %o1, 2, %o1
341 stb %g5, [%o0 - 1]
342 sub %o0, 2, %o0
343 ldub [%o1], %g5
344 sub %o2, 2, %o2
345 stb %g5, [%o0]
34664: and %o1, 3, %g2
347 and %o1, -4, %o1
348 and %o2, 0xc, %g3
349 add %o1, 4, %o1
350 cmp %g3, 4
351 sll %g2, 3, %g4
352 mov 32, %g2
353 be 4f
62f29da7 354 sub %g2, %g4, %g6
ae6b8730
RH
355
356 blu 3f
357 cmp %g3, 8
358
359 be 2f
360 srl %o2, 2, %g3
361
362 ld [%o1 - 4], %o3
363 add %o0, -8, %o0
364 ld [%o1 - 8], %o4
365 add %o1, -16, %o1
366 b 7f
367 add %g3, 1, %g3
3682: ld [%o1 - 4], %o4
369 add %o0, -4, %o0
370 ld [%o1 - 8], %g1
371 add %o1, -12, %o1
372 b 8f
373 add %g3, 2, %g3
3743: ld [%o1 - 4], %o5
375 add %o0, -12, %o0
376 ld [%o1 - 8], %o3
377 add %o1, -20, %o1
378 b 6f
379 srl %o2, 2, %g3
3804: ld [%o1 - 4], %g1
381 srl %o2, 2, %g3
382 ld [%o1 - 8], %o5
383 add %o1, -24, %o1
384 add %o0, -16, %o0
385 add %g3, -1, %g3
386
387 ld [%o1 + 12], %o3
3885: sll %o5, %g4, %g2
62f29da7 389 srl %g1, %g6, %g5
ae6b8730
RH
390 or %g2, %g5, %g2
391 st %g2, [%o0 + 12]
3926: ld [%o1 + 8], %o4
393 sll %o3, %g4, %g2
62f29da7 394 srl %o5, %g6, %g5
ae6b8730
RH
395 or %g2, %g5, %g2
396 st %g2, [%o0 + 8]
3977: ld [%o1 + 4], %g1
398 sll %o4, %g4, %g2
62f29da7 399 srl %o3, %g6, %g5
ae6b8730
RH
400 or %g2, %g5, %g2
401 st %g2, [%o0 + 4]
4028: ld [%o1], %o5
403 sll %g1, %g4, %g2
62f29da7 404 srl %o4, %g6, %g5
ae6b8730
RH
405 addcc %g3, -4, %g3
406 or %g2, %g5, %g2
407 add %o1, -16, %o1
408 st %g2, [%o0]
409 add %o0, -16, %o0
410 bne,a 5b
411 ld [%o1 + 12], %o3
412 sll %o5, %g4, %g2
62f29da7 413 srl %g1, %g6, %g5
ae6b8730
RH
414 srl %g4, 3, %g3
415 or %g2, %g5, %g2
416 add %o1, %g3, %o1
417 andcc %o2, 2, %g0
418 st %g2, [%o0 + 12]
419 be 1f
420 andcc %o2, 1, %g0
421
422 ldub [%o1 + 15], %g5
423 add %o1, -2, %o1
424 stb %g5, [%o0 + 11]
425 add %o0, -2, %o0
426 ldub [%o1 + 16], %g5
427 stb %g5, [%o0 + 12]
4281: be 1f
429 nop
430 ldub [%o1 + 15], %g5
431 stb %g5, [%o0 + 11]
4321: retl
433 ld [%sp + 64], %o0
434
43578: andcc %o1, 1, %g0
436 be 4f
437 andcc %o1, 2, %g0
438
439 ldub [%o1], %g2
440 add %o1, 1, %o1
441 stb %g2, [%o0]
442 sub %o2, 1, %o2
443 bne 3f
444 add %o0, 1, %o0
4454: lduh [%o1], %g2
446 add %o1, 2, %o1
447 sth %g2, [%o0]
448 sub %o2, 2, %o2
449 b 3f
450 add %o0, 2, %o0
451END(memmove)
452
453ENTRY(memcpy) /* %o0=dst %o1=src %o2=len */
454 sub %o0, %o1, %o4
455 st %o0, [%sp + 64]
4569: andcc %o4, 3, %o5
4570: bne 86f
458 cmp %o2, 15
459
460 bleu 90f
461 andcc %o1, 3, %g0
462
463 bne 78b
4643: andcc %o1, 4, %g0
465
466 be 2f
467 mov %o2, %g1
468
469 ld [%o1], %o4
470 sub %g1, 4, %g1
471 st %o4, [%o0]
472 add %o1, 4, %o1
473 add %o0, 4, %o0
62f29da7 4742: andcc %g1, 0xffffff80, %g6
ae6b8730
RH
475 be 3f
476 andcc %o0, 4, %g0
477
478 be 82f + 4
4795: MOVE_BIGCHUNK(o1, o0, 0x00, o2, o3, o4, o5, g2, g3, g4, g5)
480 MOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
481 MOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
482 MOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
62f29da7 483 subcc %g6, 128, %g6
ae6b8730
RH
484 add %o1, 128, %o1
485 bne 5b
486 add %o0, 128, %o0
62f29da7 4873: andcc %g1, 0x70, %g6
ae6b8730
RH
488 be 80f
489 andcc %g1, 8, %g0
490
62f29da7 491 srl %g6, 1, %o4
ae6b8730 492 mov %o7, %g2
62f29da7
UD
493 add %g6, %o4, %o4
494 add %o1, %g6, %o1
ae6b8730 495104: call 100f
62f29da7 496 add %o0, %g6, %o0
ae6b8730
RH
497 jmpl %o5 + (80f - 104b), %g0
498 mov %g2, %o7
499
50079: MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g4, g5)
501 MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g4, g5)
502 MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g4, g5)
503 MOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g4, g5)
504 MOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g4, g5)
505 MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g4, g5)
506 MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g4, g5)
507
50880: be 81f
509 andcc %g1, 4, %g0
510
511 ldd [%o1], %g2
512 add %o0, 8, %o0
513 st %g2, [%o0 - 0x08]
514 add %o1, 8, %o1
515 st %g3, [%o0 - 0x04]
516
51781: be 1f
518 andcc %g1, 2, %g0
519
520 ld [%o1], %g2
521 add %o1, 4, %o1
522 st %g2, [%o0]
523 add %o0, 4, %o0
5241: be 1f
525 andcc %g1, 1, %g0
526
527 lduh [%o1], %g2
528 add %o1, 2, %o1
529 sth %g2, [%o0]
530 add %o0, 2, %o0
5311: be 1f
532 nop
533
534 ldub [%o1], %g2
535 stb %g2, [%o0]
5361: retl
537 ld [%sp + 64], %o0
538
53982: /* ldd_std */
540 MOVE_BIGALIGNCHUNK(o1, o0, 0x00, o2, o3, o4, o5, g2, g3, g4, g5)
541 MOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
542 MOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
543 MOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
62f29da7 544 subcc %g6, 128, %g6
ae6b8730
RH
545 add %o1, 128, %o1
546 bne 82b
547 add %o0, 128, %o0
548
62f29da7 549 andcc %g1, 0x70, %g6
ae6b8730
RH
550 be 84f
551 andcc %g1, 8, %g0
552
553 mov %o7, %g2
554111: call 110f
62f29da7 555 add %o1, %g6, %o1
ae6b8730
RH
556 mov %g2, %o7
557 jmpl %o5 + (84f - 111b), %g0
62f29da7 558 add %o0, %g6, %o0
ae6b8730
RH
559
56083: MOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3, g4, g5)
561 MOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3, g4, g5)
562 MOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3, g4, g5)
563 MOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5)
564 MOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5)
565 MOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5)
566 MOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5)
567
56884: be 85f
569 andcc %g1, 4, %g0
570
571 ldd [%o1], %g2
572 add %o0, 8, %o0
573 std %g2, [%o0 - 0x08]
574 add %o1, 8, %o1
57585: be 1f
576 andcc %g1, 2, %g0
577
578 ld [%o1], %g2
579 add %o1, 4, %o1
580 st %g2, [%o0]
581 add %o0, 4, %o0
5821: be 1f
583 andcc %g1, 1, %g0
584
585 lduh [%o1], %g2
586 add %o1, 2, %o1
587 sth %g2, [%o0]
588 add %o0, 2, %o0
5891: be 1f
590 nop
591
592 ldub [%o1], %g2
593 stb %g2, [%o0]
5941: retl
595 ld [%sp + 64], %o0
596
59786: cmp %o2, 6
598 bleu 88f
599
600 cmp %o2, 256
601 bcc 87f
602
603 andcc %o0, 3, %g0
604 be 61f
605 andcc %o0, 1, %g0
606 be 60f
607 andcc %o0, 2, %g0
608
609 ldub [%o1], %g5
610 add %o1, 1, %o1
611 stb %g5, [%o0]
612 sub %o2, 1, %o2
613 bne 61f
614 add %o0, 1, %o0
61560: ldub [%o1], %g3
616 add %o1, 2, %o1
617 stb %g3, [%o0]
618 sub %o2, 2, %o2
619 ldub [%o1 - 1], %g3
620 add %o0, 2, %o0
621 stb %g3, [%o0 - 1]
62261: and %o1, 3, %g2
623 and %o2, 0xc, %g3
624 and %o1, -4, %o1
625 cmp %g3, 4
626 sll %g2, 3, %g4
627 mov 32, %g2
628 be 4f
62f29da7 629 sub %g2, %g4, %g6
ae6b8730
RH
630
631 blu 3f
632 cmp %g3, 0x8
633
634 be 2f
635 srl %o2, 2, %g3
636
637 ld [%o1], %o3
638 add %o0, -8, %o0
639 ld [%o1 + 4], %o4
640 b 8f
641 add %g3, 1, %g3
6422: ld [%o1], %o4
643 add %o0, -12, %o0
644 ld [%o1 + 4], %o5
645 add %g3, 2, %g3
646 b 9f
647 add %o1, -4, %o1
6483: ld [%o1], %g1
649 add %o0, -4, %o0
650 ld [%o1 + 4], %o3
651 srl %o2, 2, %g3
652 b 7f
653 add %o1, 4, %o1
6544: ld [%o1], %o5
655 cmp %o2, 7
656 ld [%o1 + 4], %g1
657 srl %o2, 2, %g3
658 bleu 10f
659 add %o1, 8, %o1
660
661 ld [%o1], %o3
662 add %g3, -1, %g3
6635: sll %o5, %g4, %g2
62f29da7 664 srl %g1, %g6, %g5
ae6b8730
RH
665 or %g2, %g5, %g2
666 st %g2, [%o0]
6677: ld [%o1 + 4], %o4
668 sll %g1, %g4, %g2
62f29da7 669 srl %o3, %g6, %g5
ae6b8730
RH
670 or %g2, %g5, %g2
671 st %g2, [%o0 + 4]
6728: ld [%o1 + 8], %o5
673 sll %o3, %g4, %g2
62f29da7 674 srl %o4, %g6, %g5
ae6b8730
RH
675 or %g2, %g5, %g2
676 st %g2, [%o0 + 8]
6779: ld [%o1 + 12], %g1
678 sll %o4, %g4, %g2
62f29da7 679 srl %o5, %g6, %g5
ae6b8730
RH
680 addcc %g3, -4, %g3
681 or %g2, %g5, %g2
682 add %o1, 16, %o1
683 st %g2, [%o0 + 12]
684 add %o0, 16, %o0
685 bne,a 5b
686 ld [%o1], %o3
68710: sll %o5, %g4, %g2
62f29da7
UD
688 srl %g1, %g6, %g5
689 srl %g6, 3, %g3
ae6b8730
RH
690 or %g2, %g5, %g2
691 sub %o1, %g3, %o1
692 andcc %o2, 2, %g0
693 st %g2, [%o0]
694 be 1f
695 andcc %o2, 1, %g0
696
697 ldub [%o1], %g2
698 add %o1, 2, %o1
699 stb %g2, [%o0 + 4]
700 add %o0, 2, %o0
701 ldub [%o1 - 1], %g2
702 stb %g2, [%o0 + 3]
7031: be 1f
704 nop
705 ldub [%o1], %g2
706 stb %g2, [%o0 + 4]
7071: retl
708 ld [%sp + 64], %o0
709
71087: andcc %o1, 3, %g0
711 be 3f
712 andcc %o1, 1, %g0
713
714 be 4f
715 andcc %o1, 2, %g0
716
717 ldub [%o1], %g2
718 add %o1, 1, %o1
719 stb %g2, [%o0]
720 sub %o2, 1, %o2
721 bne 3f
722 add %o0, 1, %o0
7234: lduh [%o1], %g2
724 add %o1, 2, %o1
725 srl %g2, 8, %g3
726 sub %o2, 2, %o2
727 stb %g3, [%o0]
728 add %o0, 2, %o0
729 stb %g2, [%o0 - 1]
7303: andcc %o1, 4, %g0
731
732 bne 2f
733 cmp %o5, 1
734
735 ld [%o1], %o4
736 srl %o4, 24, %g2
737 stb %g2, [%o0]
738 srl %o4, 16, %g3
739 stb %g3, [%o0 + 1]
740 srl %o4, 8, %g2
741 stb %g2, [%o0 + 2]
742 sub %o2, 4, %o2
743 stb %o4, [%o0 + 3]
744 add %o1, 4, %o1
745 add %o0, 4, %o0
7462: be 33f
747 cmp %o5, 2
748 be 32f
749 sub %o2, 4, %o2
75031: ld [%o1], %g2
751 add %o1, 4, %o1
752 srl %g2, 24, %g3
753 and %o0, 7, %g5
754 stb %g3, [%o0]
755 cmp %g5, 7
756 sll %g2, 8, %g1
757 add %o0, 4, %o0
758 be 41f
759 and %o2, 0xffffffc0, %o3
760 ld [%o0 - 7], %o4
62f29da7
UD
7614: SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
762 SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
763 SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
764 SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
ae6b8730
RH
765 subcc %o3, 64, %o3
766 add %o1, 64, %o1
767 bne 4b
768 add %o0, 64, %o0
769
770 andcc %o2, 0x30, %o3
771 be,a 1f
772 srl %g1, 16, %g2
62f29da7 7734: SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
ae6b8730
RH
774 subcc %o3, 16, %o3
775 add %o1, 16, %o1
776 bne 4b
777 add %o0, 16, %o0
778
779 srl %g1, 16, %g2
7801: st %o4, [%o0 - 7]
781 sth %g2, [%o0 - 3]
782 srl %g1, 8, %g4
783 b 88f
784 stb %g4, [%o0 - 1]
78532: ld [%o1], %g2
786 add %o1, 4, %o1
787 srl %g2, 16, %g3
788 and %o0, 7, %g5
789 sth %g3, [%o0]
790 cmp %g5, 6
791 sll %g2, 16, %g1
792 add %o0, 4, %o0
793 be 42f
794 and %o2, 0xffffffc0, %o3
795 ld [%o0 - 6], %o4
62f29da7
UD
7964: SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
797 SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
798 SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
799 SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
ae6b8730
RH
800 subcc %o3, 64, %o3
801 add %o1, 64, %o1
802 bne 4b
803 add %o0, 64, %o0
804
805 andcc %o2, 0x30, %o3
806 be,a 1f
807 srl %g1, 16, %g2
62f29da7 8084: SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
ae6b8730
RH
809 subcc %o3, 16, %o3
810 add %o1, 16, %o1
811 bne 4b
812 add %o0, 16, %o0
813
814 srl %g1, 16, %g2
8151: st %o4, [%o0 - 6]
816 b 88f
817 sth %g2, [%o0 - 2]
81833: ld [%o1], %g2
819 sub %o2, 4, %o2
820 srl %g2, 24, %g3
821 and %o0, 7, %g5
822 stb %g3, [%o0]
823 cmp %g5, 5
824 srl %g2, 8, %g4
825 sll %g2, 24, %g1
826 sth %g4, [%o0 + 1]
827 add %o1, 4, %o1
828 be 43f
829 and %o2, 0xffffffc0, %o3
830
831 ld [%o0 - 1], %o4
832 add %o0, 4, %o0
62f29da7
UD
8334: SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
834 SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
835 SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
836 SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
ae6b8730
RH
837 subcc %o3, 64, %o3
838 add %o1, 64, %o1
839 bne 4b
840 add %o0, 64, %o0
841
842 andcc %o2, 0x30, %o3
843 be,a 1f
844 srl %g1, 24, %g2
62f29da7 8454: SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, -1)
ae6b8730
RH
846 subcc %o3, 16, %o3
847 add %o1, 16, %o1
848 bne 4b
849 add %o0, 16, %o0
850
851 srl %g1, 24, %g2
8521: st %o4, [%o0 - 5]
853 b 88f
854 stb %g2, [%o0 - 1]
62f29da7
UD
85541: SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
856 SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
857 SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
858 SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
ae6b8730
RH
859 subcc %o3, 64, %o3
860 add %o1, 64, %o1
861 bne 41b
862 add %o0, 64, %o0
863
864 andcc %o2, 0x30, %o3
865 be,a 1f
866 srl %g1, 16, %g2
62f29da7 8674: SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
ae6b8730
RH
868 subcc %o3, 16, %o3
869 add %o1, 16, %o1
870 bne 4b
871 add %o0, 16, %o0
872
873 srl %g1, 16, %g2
8741: sth %g2, [%o0 - 3]
875 srl %g1, 8, %g4
876 b 88f
877 stb %g4, [%o0 - 1]
62f29da7
UD
87843: SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
879 SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
880 SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
881 SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
ae6b8730
RH
882 subcc %o3, 64, %o3
883 add %o1, 64, %o1
884 bne 43b
885 add %o0, 64, %o0
886
887 andcc %o2, 0x30, %o3
888 be,a 1f
889 srl %g1, 24, %g2
62f29da7 8904: SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 24, 8, 3)
ae6b8730
RH
891 subcc %o3, 16, %o3
892 add %o1, 16, %o1
893 bne 4b
894 add %o0, 16, %o0
895
896 srl %g1, 24, %g2
8971: stb %g2, [%o0 + 3]
898 b 88f
899 add %o0, 4, %o0
62f29da7
UD
90042: SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
901 SMOVE_ALIGNCHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
902 SMOVE_ALIGNCHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
903 SMOVE_ALIGNCHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
ae6b8730
RH
904 subcc %o3, 64, %o3
905 add %o1, 64, %o1
906 bne 42b
907 add %o0, 64, %o0
908
909 andcc %o2, 0x30, %o3
910 be,a 1f
911 srl %g1, 16, %g2
62f29da7 9124: SMOVE_ALIGNCHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 16, 16, -2)
ae6b8730
RH
913 subcc %o3, 16, %o3
914 add %o1, 16, %o1
915 bne 4b
916 add %o0, 16, %o0
917
918 srl %g1, 16, %g2
9191: sth %g2, [%o0 - 2]
920
921 /* Fall through */
922
92388: and %o2, 0xe, %o3
924 mov %o7, %g2
925 sll %o3, 3, %o4
926 add %o0, %o3, %o0
927106: call 100f
928 add %o1, %o3, %o1
929 mov %g2, %o7
930 jmpl %o5 + (89f - 106b), %g0
931 andcc %o2, 1, %g0
932
933 MOVE_SHORTCHUNK(o1, o0, 0x0c, g2, g3)
934 MOVE_SHORTCHUNK(o1, o0, 0x0a, g2, g3)
935 MOVE_SHORTCHUNK(o1, o0, 0x08, g2, g3)
936 MOVE_SHORTCHUNK(o1, o0, 0x06, g2, g3)
937 MOVE_SHORTCHUNK(o1, o0, 0x04, g2, g3)
938 MOVE_SHORTCHUNK(o1, o0, 0x02, g2, g3)
939 MOVE_SHORTCHUNK(o1, o0, 0x00, g2, g3)
940
94189: be 1f
942 nop
943
944 ldub [%o1], %g2
945 stb %g2, [%o0]
9461: retl
947 ld [%sp + 64], %o0
948
94990: bne 88b
950 andcc %o2, 8, %g0
951
952 be 1f
953 andcc %o2, 4, %g0
954
955 ld [%o1 + 0x00], %g2
956 ld [%o1 + 0x04], %g3
957 add %o1, 8, %o1
958 st %g2, [%o0 + 0x00]
959 st %g3, [%o0 + 0x04]
960 add %o0, 8, %o0
9611: b 81b
962 mov %o2, %g1
963
964100: retl
965 sub %o7, %o4, %o5
966110: retl
62f29da7 967 sub %o7, %g6, %o5
ae6b8730 968END(memcpy)
This page took 0.302131 seconds and 5 git commands to generate.