5
memset (void *dst, int c, size_t len)
9
asm volatile ("tst %0, #0x3"
10
#ifndef __OPTIMIZE_SIZE__
22
# At this point we know that %2 == len == -1 (since the SUB has already taken\n\
23
# place). If we fall through to the 1: label (as the code used to do), the\n\
24
# CMP will detect this negative value and branch to the 2: label. This will\n\
25
# test %2 again, but this time against 0. The test will fail and the loop\n\
26
# at 2: will go on for (almost) ever. Hence the explicit branch to the end\n\
27
# of the hand written assembly code.\n\
33
orr lr, %1, %1, asl #8\n\
35
orr lr, lr, lr, asl #16\n\
42
stmia %0!, { r3, r4, r5, lr }\n\
51
stmia %0!, { r3, lr }\n\
63
#endif /* !__OPTIMIZE_SIZE__ */
76
: "=&r" (dummy), "=&r" (c), "=&r" (len)
77
: "0" (dst), "1" (c), "2" (len)
78
: "memory", "r3", "r4", "r5", "lr");