OLD | NEW |
1 /* | 1 /* |
2 FUNCTION | 2 FUNCTION |
3 <<memcpy>>---copy memory regions | 3 <<memcpy>>---copy memory regions |
4 | 4 |
5 ANSI_SYNOPSIS | 5 ANSI_SYNOPSIS |
6 #include <string.h> | 6 #include <string.h> |
7 void* memcpy(void *restrict <[out]>, const void *restrict <[in]>, | 7 void* memcpy(void *restrict <[out]>, const void *restrict <[in]>, |
8 size_t <[n]>); | 8 size_t <[n]>); |
9 | 9 |
10 TRAD_SYNOPSIS | 10 TRAD_SYNOPSIS |
(...skipping 18 matching lines...) Expand all Loading... |
29 <<memcpy>> is ANSI C. | 29 <<memcpy>> is ANSI C. |
30 | 30 |
31 <<memcpy>> requires no supporting OS subroutines. | 31 <<memcpy>> requires no supporting OS subroutines. |
32 | 32 |
33 QUICKREF | 33 QUICKREF |
34 memcpy ansi pure | 34 memcpy ansi pure |
35 */ | 35 */ |
36 | 36 |
37 /* | 37 /* |
38 * The body of this function should not appear in PNaCl bitcode. | 38 * The body of this function should not appear in PNaCl bitcode. |
| 39 * We use PNACL_BITCODE instead of __le32__ or __pnacl__ since this |
| 40 * should also apply to biased bitcode. |
39 * See https://code.google.com/p/nativeclient/issues/detail?id=3493 | 41 * See https://code.google.com/p/nativeclient/issues/detail?id=3493 |
40 */ | 42 */ |
41 #ifndef __pnacl__ | 43 #ifndef PNACL_BITCODE |
42 | 44 |
43 #include <_ansi.h> | 45 #include <_ansi.h> |
44 #include <string.h> | 46 #include <string.h> |
45 | 47 |
46 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ | 48 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ |
47 #define UNALIGNED(X, Y) \ | 49 #define UNALIGNED(X, Y) \ |
48 (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) | 50 (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) |
49 | 51 |
50 /* How many bytes are copied each iteration of the 4X unrolled loop. */ | 52 /* How many bytes are copied each iteration of the 4X unrolled loop. */ |
51 #define BIGBLOCKSIZE (sizeof (long) << 2) | 53 #define BIGBLOCKSIZE (sizeof (long) << 2) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 src = (char*)aligned_src; | 111 src = (char*)aligned_src; |
110 } | 112 } |
111 | 113 |
112 while (len0--) | 114 while (len0--) |
113 *dst++ = *src++; | 115 *dst++ = *src++; |
114 | 116 |
115 return dst0; | 117 return dst0; |
116 #endif /* not PREFER_SIZE_OVER_SPEED */ | 118 #endif /* not PREFER_SIZE_OVER_SPEED */ |
117 } | 119 } |
118 | 120 |
119 #endif /* __pnacl__ */ | 121 #endif /* PNACL_BITCODE */ |
OLD | NEW |