1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #include <linux/linkage.h>
18 /* Test if len less than 4 bytes. */
23 /* Test if dest is not 4 bytes aligned. */
24 bnez r13, .L_dest_not_aligned
25 /* 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
35 .L_len_larger_16bytes:
38 #if defined(__CK860__)
58 BNEZAD (r18, .L_len_larger_16bytes)
62 bez r18, .L_copy_by_byte
63 .L_len_less_16bytes_loop:
69 BNEZAD (r18, .L_len_less_16bytes_loop)
71 /* Test if len less than 4 bytes. */
81 BNEZAD (r18, .L_copy_by_byte_loop)
87 /* If dest is not aligned, just copy some bytes makes the dest
91 .L_dest_not_aligned_loop:
94 /* Makes the dest align. */
98 BNEZAD (r13, .L_dest_not_aligned_loop)
101 /* Check whether the src is aligned. */