OSDN Git Service

Create arch specific versions of strcmp.
authorChristopher Ferris <cferris@google.com>
Sat, 9 Mar 2013 00:50:31 +0000 (16:50 -0800)
committerChristopher Ferris <cferris@google.com>
Tue, 12 Mar 2013 17:25:11 +0000 (10:25 -0700)
commita9a5870d166f8060a8182cd61e5536b0becea74e
tree0b023e86033a66b89ae746df04932251ead009bb
parent70d97ae3d0e0c707fadbc41067c8ad8fa39a0f9c
Create arch specific versions of strcmp.

This uses the new strcmp.a15.S code as the basis for new versions
of strcmp.S.

The cortex-a15 code is the performance optimized version of strcmp.a15.S
taken with only the addition of a few pld instructions.
The cortex-a9 code is the same as the cortex-a15 code except that the
unaligned strcmp code was taken from the original strcmp.S.
The krait code is the same as the cortex-a15 code except that one path
in the unaligned strcmp code was taken from the original strcmp.S code
(the 2 byte overlap case).
The generic code is the original unmodified strmp.S from the bionic
subdirectory.

All three new versions underwent these test cases:

Strings the same, all same size:
- Both pointers double word aligned.
- One pointer double word aligned, one pointer word aligned.
- Both pointers word aligned.
- One pointer double word aligned, one pointer 1 off a word alignment.
- One pointer double word aligned, one pointer 2 off a word alignment.
- One pointer double word aligned, one pointer 3 off a word alignment.
- One pointer word aligned, one pointer 1 off a word alignment.
- One pointer word aligned, one pointer 2 off a word alignment.
- One pointer word aligned, one pointer 3 off a word alignment.
For all cases where it made sense, the two pointers were also tested
swapped.

Different strings, all same size:
- Single difference at double word boundary.
- Single difference at word boudary.
- Single difference at 1 off a word alignment.
- Single difference at 2 off a word alignment.
- Single difference at 3 off a word alignment.

Different sized strings, strings the same until the end:
- Shorter string ends on a double word boundary.
- Shorter string ends on word boundary.
- Shorter string ends at 1 off a word boundary.
- Shorter string ends at 2 off a word boundary.
- Shorter string ends at 3 off a word boundary.

For all different cases, run them through the same pointer alignment
cases when the strings are the same size.
For all cases the two pointers were also tested swapped.

Bug: 8005082
Change-Id: I5f3dc02b48afba2cb9c13332ab45c828ff171a1c
libc/arch-arm/arm.mk
libc/arch-arm/cortex-a15/bionic/strcmp.S [new file with mode: 0644]
libc/arch-arm/cortex-a15/cortex-a15.mk
libc/arch-arm/cortex-a9/bionic/strcmp.S [new file with mode: 0644]
libc/arch-arm/cortex-a9/cortex-a9.mk
libc/arch-arm/generic/bionic/strcmp.S [new file with mode: 0644]
libc/arch-arm/generic/generic.mk
libc/arch-arm/krait/bionic/strcmp.S [new file with mode: 0644]
libc/arch-arm/krait/krait.mk