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(__CSKY_VDSPV2__)
42 #elif defined(__CK860__)
62 BNEZAD (r18, .L_len_larger_16bytes)
66 bez r18, .L_copy_by_byte
67 .L_len_less_16bytes_loop:
73 BNEZAD (r18, .L_len_less_16bytes_loop)
75 /* Test if len less than 4 bytes. */
85 BNEZAD (r18, .L_copy_by_byte_loop)
91 /* If dest is not aligned, just copy some bytes makes the dest
95 .L_dest_not_aligned_loop:
98 /* Makes the dest align. */
102 BNEZAD (r13, .L_dest_not_aligned_loop)
105 /* Check whether the src is aligned. */