1#define SYSCLIB_DISABLE_BUILTINS
5void *memset(
void *dest,
int c,
size_t n)
7 unsigned char *s = dest;
17 if (n <= 2)
return dest;
22 if (n <= 6)
return dest;
25 if (n <= 8)
return dest;
32 k = -(uintptr_t)s & 3;
41 u32 c32 = ((u32)-1)/255 * (
unsigned char)c;
50 *(u32 *)(s+n-4) = c32;
51 if (n <= 8)
return dest;
54 *(u32 *)(s+n-12) = c32;
55 *(u32 *)(s+n-8) = c32;
56 if (n <= 24)
return dest;
61 *(u32 *)(s+n-28) = c32;
62 *(u32 *)(s+n-24) = c32;
63 *(u32 *)(s+n-20) = c32;
64 *(u32 *)(s+n-16) = c32;
70 k = 24 + ((uintptr_t)s & 4);
78 u64 c64 = c32 | ((u64)c32 << 32);
79 for (; n >= 32; n-=32, s+=32) {
87 for (; n; n--, s++) *s = c;