diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-11-17 17:56:41 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-11-17 17:56:41 +0000 |
commit | 644c442da3f0cea2a2aa591f57726e3e6de823e2 (patch) | |
tree | f8d49598d16d350059059ce23b758da4afde7b15 /libc/string/generic/memcopy.h | |
parent | e0c796f1422f3617302e4ecafef6d1f461499eba (diff) | |
download | uClibc-alpine-644c442da3f0cea2a2aa591f57726e3e6de823e2.tar.bz2 uClibc-alpine-644c442da3f0cea2a2aa591f57726e3e6de823e2.tar.xz |
Synch with trunk @ 24075.
Step 4
libc/string and asm implementation
Diffstat (limited to 'libc/string/generic/memcopy.h')
-rw-r--r-- | libc/string/generic/memcopy.h | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/libc/string/generic/memcopy.h b/libc/string/generic/memcopy.h index fa3bc4e8d..df1ba9a97 100644 --- a/libc/string/generic/memcopy.h +++ b/libc/string/generic/memcopy.h @@ -107,6 +107,24 @@ typedef unsigned char byte; } \ } while (0) +/* Copy *up to* NBYTES bytes from SRC_BP to DST_BP, with + the assumption that DST_BP is aligned on an OPSIZ multiple. If + not all bytes could be easily copied, store remaining number of bytes + in NBYTES_LEFT, otherwise store 0. */ +/* extern void _wordcopy_fwd_aligned __P ((long int, long int, size_t)); */ +/* extern void _wordcopy_fwd_dest_aligned __P ((long int, long int, size_t)); */ +#define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \ + do \ + { \ + if (src_bp % OPSIZ == 0) \ + _wordcopy_fwd_aligned (dst_bp, src_bp, (nbytes) / OPSIZ); \ + else \ + _wordcopy_fwd_dest_aligned (dst_bp, src_bp, (nbytes) / OPSIZ); \ + src_bp += (nbytes) & -OPSIZ; \ + dst_bp += (nbytes) & -OPSIZ; \ + (nbytes_left) = (nbytes) % OPSIZ; \ + } while (0) + /* Copy *up to* NBYTES_TO_COPY bytes from SRC_END_PTR to DST_END_PTR, beginning at the words (of type op_t) right before the pointers and continuing towards smaller addresses. May take advantage of that @@ -130,26 +148,3 @@ typedef unsigned char byte; /* Threshold value for when to enter the unrolled loops. */ #define OP_T_THRES 16 - -#ifdef __ARCH_HAS_BWD_MEMCPY__ - -/* Copy *up to* NBYTES bytes from SRC_BP to DST_BP, with - the assumption that DST_BP is aligned on an OPSIZ multiple. If - not all bytes could be easily copied, store remaining number of bytes - in NBYTES_LEFT, otherwise store 0. */ -/* extern void _wordcopy_fwd_aligned __P ((long int, long int, size_t)); */ -/* extern void _wordcopy_fwd_dest_aligned __P ((long int, long int, size_t)); */ -#define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \ - do \ - { \ - if (src_bp % OPSIZ == 0) \ - _wordcopy_fwd_aligned (dst_bp, src_bp, (nbytes) / OPSIZ); \ - else \ - _wordcopy_fwd_dest_aligned (dst_bp, src_bp, (nbytes) / OPSIZ); \ - src_bp += (nbytes) & -OPSIZ; \ - dst_bp += (nbytes) & -OPSIZ; \ - (nbytes_left) = (nbytes) % OPSIZ; \ - } while (0) - -#endif /* __ARCH_HAS_BWD_MEMCPY__ */ - |