1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // See memmove Go doc for important implementation constraints.
9 // void runtime·memmove(void*, void*, uintptr)
10 TEXT runtime·memmove<ABIInternal>(SB),NOSPLIT,$-0-24
17 // If the destination is ahead of the source, start at the end of the
18 // buffer and go backward.
19 BGTU X10, X11, backward
21 // If less than 8 bytes, do single byte copies.
23 BLT X12, X9, f_loop4_check
25 // Check alignment - if alignment differs we have to do one byte at a time.
28 BNE X5, X6, f_loop8_unaligned_check
31 // Move one byte at a time until we reach 8 byte alignment.
44 BLT X12, X9, f_loop8_check
46 BLT X12, X9, f_loop16_check
48 BLT X12, X9, f_loop32_check
74 BLT X12, X9, f_loop16_check
92 BLT X12, X9, f_loop8_check
101 BGE X12, X9, f_loop16
106 BLT X12, X9, f_loop4_check
117 f_loop8_unaligned_check:
119 BLT X12, X9, f_loop4_check
140 BGE X12, X9, f_loop8_unaligned
172 // If less than 8 bytes, do single byte copies.
174 BLT X12, X9, b_loop4_check
176 // Check alignment - if alignment differs we have to do one byte at a time.
179 BNE X5, X6, b_loop8_unaligned_check
180 BEQZ X5, b_loop_check
182 // Move one byte at a time until we reach 8 byte alignment.
194 BLT X12, X9, b_loop8_check
196 BLT X12, X9, b_loop16_check
198 BLT X12, X9, b_loop32_check
219 BGE X12, X9, b_loop64
224 BLT X12, X9, b_loop16_check
237 BGE X12, X9, b_loop32
242 BLT X12, X9, b_loop8_check
251 BGE X12, X9, b_loop16
256 BLT X12, X9, b_loop4_check
267 b_loop8_unaligned_check:
269 BLT X12, X9, b_loop4_check
290 BGE X12, X9, b_loop8_unaligned