This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, AArch64] Improve strcpy performance for short strings


Some further benchmarking and experimentation has shown that the
previously submitted strcpy code can be significantly improved for
shorter strings.  The improvements are based around the following changes:

- Reduce the number of unpredictable branches
- Reduce the number of byte accesses.

The first is done by increasing the amount of conditional selection when
dealing with top and bottom halves of a 16-byte substring and by
improving the entry sequence to check for a strings that cannot cross a
page boundary (this check is likely to be very predictable, even when
the alignment of strings is not).

The second is done by using misaligned accesses to load and store values
whenever possible; this ensures we never have to loop over a sequence of
byte accesses and helps to further reduce the number of unpredictable
branches.

Tested on both big and little-endian systems and committed to trunk.

R.

2014-12-16  Richard Earnshaw  <rearnsha@arm.com>

	* libc/machine/aarch64/strcpy.S: Improve handling of short strings.

Attachment: a64-strcpy.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]