1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
8 void * memcpy( void * restrict s1, const void * restrict s2, size_t n ) { /* TODO */ };
13 const char * src = (const char *) s2;
14 char * dst = (char *) s1;
23 /* PDPC code - unreviewed
24 void *memcpy(void *s1, const void *s2, size_t n)
26 register const unsigned char *f = s2;
27 register const unsigned char *fe;
28 register unsigned char *t = s1;
38 void *memcpy(void *s1, const void *s2, size_t n)
40 register unsigned int *p = (unsigned int *)s1;
41 register unsigned int *cs2 = (unsigned int *)s2;
42 register unsigned int *endi;
44 endi = (unsigned int *)((char *)p + (n & ~0x03));
54 *(char *)p = *(char *)cs2;
57 *(char *)p = *(char *)cs2;
58 p = (unsigned int *)((char *)p + 1);
59 cs2 = (unsigned int *)((char *)cs2 + 1);
60 *(char *)p = *(char *)cs2;
63 *(char *)p = *(char *)cs2;
64 p = (unsigned int *)((char *)p + 1);
65 cs2 = (unsigned int *)((char *)cs2 + 1);
66 *(char *)p = *(char *)cs2;
67 p = (unsigned int *)((char *)p + 1);
68 cs2 = (unsigned int *)((char *)cs2 + 1);
69 *(char *)p = *(char *)cs2;