1 /* The assembly function for memcpy. C-SKY ABIV2 version.
2 Copyright (C) 2018-2019 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
22 /* Test if len less than 4 bytes. */
29 /* Test if dest is not 4 bytes aligned. */
30 bnez r13, .L_dest_not_aligned
32 /* If dest is aligned, then copy. */
34 /* Test if len less than 16 bytes. */
35 bez r18, .L_len_less_16bytes
39 .L_len_larger_16bytes:
40 #if defined (__CSKY_VDSPV2__)
46 #elif defined (__csky_fpuv2__) && defined(__CK810__)
54 #elif defined (__CK860__)
78 BNEZAD (r18, .L_len_larger_16bytes)
82 bez r18, .L_copy_by_byte
83 .L_len_less_16bytes_loop:
89 BNEZAD (r18, .L_len_less_16bytes_loop)
91 /* Test if len less than 4 bytes. */
101 BNEZAD (r18, .L_copy_by_byte_loop)
107 /* If dest is not aligned, just copying some bytes makes the dest
113 .L_dest_not_aligned_loop:
114 /* Makes the dest align. */
120 BNEZAD (r13, .L_dest_not_aligned_loop)
124 /* Check whether the src is aligned. */
128 libc_hidden_builtin_def (memcpy)
141 /* Test if len less than 4 bytes. */
146 /* Test if dest is not 4 bytes aligned. */
147 bnez r13, .L_dest_not_aligned_m
149 /* If dest is aligned, then copy. */
151 /* Test if len less than 16 bytes. */
152 bez r18, .L_len_less_16bytes_m
157 .L_len_larger_16bytes_m:
160 #if defined (__CSKY_VDSPV2__)
161 vldx.8 vr0, (r1), r19
163 vstx.8 vr0, (r0), r19
164 #elif defined (__csky_fpuv2__) && defined(__CK810__)
170 #elif defined (__CK860__)
190 BNEZAD (r18, .L_len_larger_16bytes_m)
192 .L_len_less_16bytes_m:
194 bez r18, .L_copy_by_byte_m
195 .L_len_less_16bytes_loop_m:
201 BNEZAD (r18, .L_len_less_16bytes_loop_m)
203 /* Test if len less than 4 bytes. */
207 .L_copy_by_byte_loop_m:
213 BNEZAD (r18, .L_copy_by_byte_loop_m)
219 /* If dest is not aligned, just copying some bytes makes the dest
221 .L_dest_not_aligned_m:
223 .L_dest_not_aligned_loop_m:
226 /* Makes the dest align. */
230 BNEZAD (r13, .L_dest_not_aligned_loop_m)
233 /* Check whether the src is aligned. */
237 libc_hidden_builtin_def (memmove)