1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #include <linux/linkage.h>
8 /* Test if len less than 4 bytes. */
18 /* Test if s1 is not 4 bytes aligned. */
19 bnez r13, .L_s1_not_aligned
23 /* If dest is aligned, then copy. */
25 /* Test if len less than 16 bytes. */
26 bez r18, .L_compare_by_word
29 /* If aligned, load word each time. */
32 /* If s1[i] != s2[i], goto .L_byte_check. */
55 BNEZAD (r18, .L_compare_by_4word)
59 bez r18, .L_compare_by_byte
60 .L_compare_by_word_loop:
68 BNEZAD (r18, .L_compare_by_word_loop)
73 .L_compare_by_byte_loop:
81 BNEZAD (r18, .L_compare_by_byte_loop)
88 /* d[i] != s[i] in word, so we check byte 0. */
112 /* s1[i] != s2[i] in word, so we check byte 3. */
136 # endif /* !__CSKYBE__ */
138 /* Compare when s1 is not aligned. */
142 .L_s1_not_aligned_loop:
150 BNEZAD (r13, .L_s1_not_aligned_loop)