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]

Re: ARM Patch: correctly deal with big-endian string termination


Patch checked in.

-- Jeff J.

Richard Earnshaw wrote:
If a word loaded from the string being compared contains the byte-pair
0x01000 at any position within the word (ie 0xXXXX0100, 0xXX0100XX or
0x0100XXXX) then the syndrome value calculated by the zero-detection
algorithm will contain 0x8080 at the position of these two bytes.

On a little-endian machine this makes no difference to the behaviour of
the algorithm because the interesting bytes (if any) are in the least
significant part of the word; but on big-endian machines the 0x01 byte
is the last byte in the string.  We therefore have to handle this case
by testing each of the last bytes explicitly.

2009-03-24 Richard Earnshaw <rearnsha@arm.com>

	* libc/machine/arm/strcmp.c (strcmp_unaligned): Correctly
	detect the nul-byte in a big-endian string.




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