diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-03-16 09:11:31 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-03-16 09:11:31 +0000 |
commit | 1cd785fe106389b7cc708d1c413eb8bfbc95ff43 (patch) | |
tree | 01a20f24c6cac36568a0c96ce76578fe8b8f47f8 /libc/string/avr32/memset.S | |
parent | b892d0f9caca5d891d7ce615e3df518b3870b36b (diff) | |
download | uClibc-alpine-1cd785fe106389b7cc708d1c413eb8bfbc95ff43.tar.bz2 uClibc-alpine-1cd785fe106389b7cc708d1c413eb8bfbc95ff43.tar.xz |
Merge nptl branch tree with trunk.
Step 8: add xtensa, cris and avr32 architecture dependent
files, as is.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/string/avr32/memset.S')
-rw-r--r-- | libc/string/avr32/memset.S | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/libc/string/avr32/memset.S b/libc/string/avr32/memset.S new file mode 100644 index 000000000..964bf4834 --- /dev/null +++ b/libc/string/avr32/memset.S @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2004-2007 Atmel Corporation + * + * This file is subject to the terms and conditions of the GNU Lesser General + * Public License. See the file "COPYING.LIB" in the main directory of this + * archive for more details. + */ + +#include <features.h> + +#define s r12 +#define c r11 +#define n r10 + + .text + .global memset + .type memset, @function + + .align 1 +memset: + cp.w n, 32 + mov r9, s + brge .Llarge_memset + + sub n, 1 + retlt s +1: st.b s++, c + sub n, 1 + brge 1b + + retal r9 + +.Llarge_memset: + mov r8, r11 + mov r11, 3 + bfins r8, r8, 8, 8 + bfins r8, r8, 16, 16 + tst s, r11 + breq 2f + +1: st.b s++, r8 + sub n, 1 + tst s, r11 + brne 1b + +2: mov r11, r9 + mov r9, r8 + sub n, 8 + +3: st.d s++, r8 + sub n, 8 + brge 3b + + /* If we are done, n == -8 and we'll skip all st.b insns below */ + neg n + lsl n, 1 + add pc, n + .rept 7 + st.b s++, r8 + .endr + retal r11 + + .size memset, . - memset + +libc_hidden_def(memset) |