2 * "memset" implementation for SH4
4 * Copyright (C) 1999 Niibe Yutaka
5 * Copyright (c) 2009 STMicroelectronics Limited
6 * Author: Stuart Menefy <stuart.menefy:st.com>
10 * void *memset(void *s, int c, size_t n);
13 #include <linux/linkage.h>
19 bt/s 40f ! if it's too small, set a byte at once
23 bt/s 2f ! It's aligned
36 ! Check if enough bytes need to be copied to be worth the big loop
38 cmp/gt r6,r0 ! (MT) 64 > len => slow loop
43 ! align the dst to the cache block size if necessary
50 bt/s 11f ! dst is already aligned
51 sub r1, r3 ! r3-r1 -> r3
52 shlr2 r3 ! number of loops
59 11: ! dst is 32byte aligned
62 shld r0,r2 ! number of loops
88 shlr r0 ! r0 = r6 >> 3
91 mov.l r5,@-r4 ! set 8-byte at once
98 ! fill bytes (length may be zero)