1 /* The assembly function for memset. C-SKY ABIV2 version.
2 Copyright (C) 2018-2022 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 <https://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
31 /* Hardware can handle unaligned access directly. */
40 /* If dest is aligned, then copy. */
42 /* Test if len less than 16 bytes. */
43 bez r18, .L_len_less_16bytes
46 .L_len_larger_16bytes:
53 BNEZAD (r18, .L_len_larger_16bytes)
58 bez r18, .L_set_by_byte
59 .L_len_less_16bytes_loop:
63 BNEZAD (r18, .L_len_less_16bytes_loop)
65 /* Test if len less than 4 bytes. */
73 BNEZAD (r18, .L_set_by_byte_loop)
79 /* If dest is not aligned, just set some bytes makes the dest
85 .L_dest_not_aligned_loop:
86 /* Makes the dest align. */
90 BNEZAD (r13, .L_dest_not_aligned_loop)
93 /* Check whether the src is aligned. */
97 libc_hidden_builtin_def (memset)