1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #include <linux/linkage.h>
10 /* Test if len less than 4 bytes. */
17 /* Test if dest is not 4 bytes aligned. */
18 bnez r13, .L_dest_not_aligned
19 /* Hardware can handle unaligned access directly. */
27 /* If dest is aligned, then copy. */
29 /* Test if len less than 16 bytes. */
30 bez r18, .L_len_less_16bytes
33 .L_len_larger_16bytes:
40 BNEZAD (r18, .L_len_larger_16bytes)
45 bez r18, .L_set_by_byte
46 .L_len_less_16bytes_loop:
50 BNEZAD (r18, .L_len_less_16bytes_loop)
52 /* Test if len less than 4 bytes. */
60 BNEZAD (r18, .L_set_by_byte_loop)
66 /* If dest is not aligned, just set some bytes makes the dest
72 .L_dest_not_aligned_loop:
73 /* Makes the dest align. */
77 BNEZAD (r13, .L_dest_not_aligned_loop)
80 /* Check whether the src is aligned. */