1 /* SPDX-License-Identifier: GPL-2.0 */
3 * arch/alpha/lib/memmove.S
5 * Barely optimized memmove routine for Alpha EV5.
7 * This is hand-massaged output from the original memcpy.c. We defer to
8 * memcpy whenever possible; the backwards copy loops are not unrolled.
10 #include <asm/export.h>
26 cmpule $4,$17,$1 /* dest + n <= src */
27 cmpule $5,$16,$2 /* dest >= src + n */
34 and $2,7,$2 /* Test for src/dest co-alignment. */
37 bne $3,$memmove_up /* dest < src */
42 beq $1,$skip_aligned_byte_loop_head_dn
44 $aligned_byte_loop_head_dn:
61 bne $6,$aligned_byte_loop_head_dn
63 $skip_aligned_byte_loop_head_dn:
65 blt $18,$skip_aligned_word_loop_dn
67 $aligned_word_loop_dn:
76 bge $18,$aligned_word_loop_dn
78 $skip_aligned_word_loop_dn:
80 bgt $18,$byte_loop_tail_dn
104 bgt $18,$byte_loop_tail_dn
110 bne $2,$misaligned_up
111 beq $1,$skip_aligned_byte_loop_head_up
113 $aligned_byte_loop_head_up:
130 bne $6,$aligned_byte_loop_head_up
132 $skip_aligned_byte_loop_head_up:
134 blt $18,$skip_aligned_word_loop_up
136 $aligned_word_loop_up:
145 bge $18,$aligned_word_loop_up
147 $skip_aligned_word_loop_up:
149 bgt $18,$byte_loop_tail_up
174 bgt $18,$byte_loop_tail_up
183 EXPORT_SYMBOL(memmove)