Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/arm/string/strlen.S
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | ENTRY(strlen) | ||||
bgt .Ldo_1 | bgt .Ldo_1 | ||||
/* So that the N bit is set. */ | /* So that the N bit is set. */ | ||||
cmp r3, #0 | cmp r3, #0 | ||||
b .Ldo_2 | b .Ldo_2 | ||||
.Loop: | .Loop: | ||||
ldr r2, [r0] | ldr r2, [r0] | ||||
add r0, r0, #4 | add r0, r0, #4 | ||||
#ifndef __ARMEB__ | |||||
ands r3, r2, #0x000000ff | ands r3, r2, #0x000000ff | ||||
#else | |||||
ands r3, r2, #0xff000000 | |||||
#endif | |||||
it ne | it ne | ||||
addne r1, r1, #1 | addne r1, r1, #1 | ||||
.Ldo_3: | .Ldo_3: | ||||
itt ne | itt ne | ||||
#ifndef __ARMEB__ | |||||
andsne r3, r2, #0x0000ff00 | andsne r3, r2, #0x0000ff00 | ||||
#else | |||||
andsne r3, r2, #0x00ff0000 | |||||
#endif | |||||
addne r1, r1, #1 | addne r1, r1, #1 | ||||
.Ldo_2: | .Ldo_2: | ||||
itt ne | itt ne | ||||
#ifndef __ARMEB__ | |||||
andsne r3, r2, #0x00ff0000 | andsne r3, r2, #0x00ff0000 | ||||
#else | |||||
andsne r3, r2, #0x0000ff00 | |||||
#endif | |||||
addne r1, r1, #1 | addne r1, r1, #1 | ||||
.Ldo_1: | .Ldo_1: | ||||
ittt ne | ittt ne | ||||
#ifndef __ARMEB__ | |||||
andsne r3, r2, #0xff000000 | andsne r3, r2, #0xff000000 | ||||
#else | |||||
andsne r3, r2, #0x000000ff | |||||
#endif | |||||
addne r1, r1, #1 | addne r1, r1, #1 | ||||
bne .Loop | bne .Loop | ||||
.Lexit: | .Lexit: | ||||
mov r0, r1 | mov r0, r1 | ||||
RET | RET | ||||
END(strlen) | END(strlen) | ||||
.section .note.GNU-stack,"",%progbits | .section .note.GNU-stack,"",%progbits |