mirror of git://sourceware.org/git/glibc.git
alpha: Use saturating arithmetic in memchr
This commit is contained in:
parent
4283b38725
commit
9c8e644853
|
|
@ -1,3 +1,8 @@
|
||||||
|
2017-02-01 Richard Henderson <rth@twiddle.net>
|
||||||
|
|
||||||
|
* sysdeps/alpha/memchr.c (__memchr): Use saturating arithmetic
|
||||||
|
adjusting the byte count.
|
||||||
|
|
||||||
2017-02-01 Andreas Schwab <schwab@linux-m68k.org>
|
2017-02-01 Andreas Schwab <schwab@linux-m68k.org>
|
||||||
|
|
||||||
* conform/Makefile (linknamespace-libs): Define.
|
* conform/Makefile (linknamespace-libs): Define.
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,10 @@ __memchr (const void *s, int xc, size_t n)
|
||||||
/* Align the source, and decrement the count by the number
|
/* Align the source, and decrement the count by the number
|
||||||
of bytes searched in the first word. */
|
of bytes searched in the first word. */
|
||||||
s_align = (const word *)((word)s & -8);
|
s_align = (const word *)((word)s & -8);
|
||||||
n += ((word)s & 7);
|
{
|
||||||
|
size_t inc = n + ((word)s & 7);
|
||||||
|
n = inc | -(inc < n);
|
||||||
|
}
|
||||||
|
|
||||||
/* Deal with misalignment in the first word for the comparison. */
|
/* Deal with misalignment in the first word for the comparison. */
|
||||||
mask = (1ul << ((word)s & 7)) - 1;
|
mask = (1ul << ((word)s & 7)) - 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue