<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/string, branch v1.2.1</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>add optimized aarch64 memcpy and memset</title>
<updated>2020-06-26T21:49:51+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2020-06-26T21:37:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=fdf8b2ad9c5ae6adf3a91c0043eb898badee46d1'/>
<id>fdf8b2ad9c5ae6adf3a91c0043eb898badee46d1</id>
<content type='text'>
these are based on the ARM optimized-routines repository v20.05
(ef907c7a799a), with macro dependencies flattened out and memmove code
removed from memcpy. this change is somewhat unfortunate since having
the branch for memmove support in the large n case of memcpy is the
performance-optimal and size-optimal way to do both, but it makes
memcpy alone (static-linked) about 40% larger and suggests a policy
that use of memcpy as memmove is supported.

tabs used for alignment have also been replaced with spaces.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
these are based on the ARM optimized-routines repository v20.05
(ef907c7a799a), with macro dependencies flattened out and memmove code
removed from memcpy. this change is somewhat unfortunate since having
the branch for memmove support in the large n case of memcpy is the
performance-optimal and size-optimal way to do both, but it makes
memcpy alone (static-linked) about 40% larger and suggests a policy
that use of memcpy as memmove is supported.

tabs used for alignment have also been replaced with spaces.
</pre>
</div>
</content>
</entry>
<entry>
<title>add big-endian support to ARM assembler memcpy</title>
<updated>2020-06-25T23:11:13+00:00</updated>
<author>
<name>Andre McCurdy</name>
<email>armccurdy@gmail.com</email>
</author>
<published>2020-01-21T18:52:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=9dce93ac7f7a76978b70581c6f073f671b583347'/>
<id>9dce93ac7f7a76978b70581c6f073f671b583347</id>
<content type='text'>
Allow the existing ARM assembler memcpy implementation to be used for
both big and little endian targets.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow the existing ARM assembler memcpy implementation to be used for
both big and little endian targets.
</pre>
</div>
</content>
</entry>
<entry>
<title>handle possibility that SIGEMT replaces SIGSTKFLT in strsignal</title>
<updated>2020-05-21T20:25:12+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2020-05-21T17:14:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=09c54607e372336c243a4b0b52f7a0b579eba73e'/>
<id>09c54607e372336c243a4b0b52f7a0b579eba73e</id>
<content type='text'>
presently all archs define SIGSTKFLT but this is not correct. change
strsignal as a prerequisite for fixing that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
presently all archs define SIGSTKFLT but this is not correct. change
strsignal as a prerequisite for fixing that.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix undefined behavior from signed overflow in strstr and memmem</title>
<updated>2020-05-01T01:52:28+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2020-05-01T01:36:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=593caa456309714402ca4cb77c3770f4c24da9da'/>
<id>593caa456309714402ca4cb77c3770f4c24da9da</id>
<content type='text'>
unsigned char promotes to int, which can overflow when shifted left by
24 bits or more. this has been reported multiple times but then
forgotten. it's expected to be benign UB, but can trap when built with
explicit overflow catching (ubsan or similar). fix it now.

note that promotion to uint32_t is safe and portable even outside of
the assumptions usually made in musl, since either uint32_t has rank
at least unsigned int, so that no further default promotions happen,
or int is wide enough that the shift can't overflow. this is a
desirable property to have in case someone wants to reuse the code
elsewhere.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unsigned char promotes to int, which can overflow when shifted left by
24 bits or more. this has been reported multiple times but then
forgotten. it's expected to be benign UB, but can trap when built with
explicit overflow catching (ubsan or similar). fix it now.

note that promotion to uint32_t is safe and portable even outside of
the assumptions usually made in musl, since either uint32_t has rank
at least unsigned int, so that no further default promotions happen,
or int is wide enough that the shift can't overflow. this is a
desirable property to have in case someone wants to reuse the code
elsewhere.
</pre>
</div>
</content>
</entry>
<entry>
<title>remove redundant condition in memccpy</title>
<updated>2020-03-20T19:45:08+00:00</updated>
<author>
<name>Alexander Monakov</name>
<email>amonakov@ispras.ru</email>
</author>
<published>2020-03-09T18:32:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=526df238d0d05fe4e8446720d9d0374646f82f82'/>
<id>526df238d0d05fe4e8446720d9d0374646f82f82</id>
<content type='text'>
Commit d9bdfd164 ("fix memccpy to not access buffer past given size")
correctly added a check for 'n' nonzero, but made the pre-existing test
'*s==c' redundant: n!=0 implies *s==c. Remove the unnecessary check.

Reported by Alexey Izbyshev.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit d9bdfd164 ("fix memccpy to not access buffer past given size")
correctly added a check for 'n' nonzero, but made the pre-existing test
'*s==c' redundant: n!=0 implies *s==c. Remove the unnecessary check.

Reported by Alexey Izbyshev.
</pre>
</div>
</content>
</entry>
<entry>
<title>add thumb2 support to arm assembler memcpy</title>
<updated>2020-01-16T20:44:26+00:00</updated>
<author>
<name>Andre McCurdy</name>
<email>armccurdy@gmail.com</email>
</author>
<published>2019-09-13T18:44:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=91e662d1d941215eb024787db5e910dbfb5b169f'/>
<id>91e662d1d941215eb024787db5e910dbfb5b169f</id>
<content type='text'>
For Thumb2 compatibility, replace two instances of a single
instruction "orr with a variable shift" with the two instruction
equivalent. Neither of the replacements are in a performance critical
loop.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For Thumb2 compatibility, replace two instances of a single
instruction "orr with a variable shift" with the two instruction
equivalent. Neither of the replacements are in a performance critical
loop.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix memccpy to not access buffer past given size</title>
<updated>2018-12-02T14:24:15+00:00</updated>
<author>
<name>Quentin Rameau</name>
<email>quinq@fifth.space</email>
</author>
<published>2018-11-11T08:25:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=d9bdfd1644320ab916ea31d95da4bf641042209a'/>
<id>d9bdfd1644320ab916ea31d95da4bf641042209a</id>
<content type='text'>
memccpy would return a pointer over the given size when c is not
found in the source buffer and n reaches 0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
memccpy would return a pointer over the given size when c is not
found in the source buffer and n reaches 0.
</pre>
</div>
</content>
</entry>
<entry>
<title>optimize two-way strstr and memmem bad character shift</title>
<updated>2018-11-08T20:22:22+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2018-11-08T20:00:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=122d67f846cb0be2c9e1c3880db9eb9545bbe38c'/>
<id>122d67f846cb0be2c9e1c3880db9eb9545bbe38c</id>
<content type='text'>
first, the condition (mem &amp;&amp; k &lt; p) is redundant, because mem being
nonzero implies the needle is periodic with period exactly p, in which
case any byte that appears in the needle must appear in the last p
bytes of the needle, bounding the shift (k) by p.

second, the whole point of replacing the shift k by mem (=l-p) is to
prevent shifting by less than mem when discarding the memory on shift,
in which case linear time could not be guaranteed. but as written, the
check also replaced shifts greater than mem by mem, reducing the
benefit of the shift. there is no possible benefit to this reduction of
the shift; since mem is being cleared, the full shift is valid and
more optimal. so only replace the shift by mem when it would be less
than mem.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
first, the condition (mem &amp;&amp; k &lt; p) is redundant, because mem being
nonzero implies the needle is periodic with period exactly p, in which
case any byte that appears in the needle must appear in the last p
bytes of the needle, bounding the shift (k) by p.

second, the whole point of replacing the shift k by mem (=l-p) is to
prevent shifting by less than mem when discarding the memory on shift,
in which case linear time could not be guaranteed. but as written, the
check also replaced shifts greater than mem by mem, reducing the
benefit of the shift. there is no possible benefit to this reduction of
the shift; since mem is being cleared, the full shift is valid and
more optimal. so only replace the shift by mem when it would be less
than mem.
</pre>
</div>
</content>
</entry>
<entry>
<title>remove commented-out debug printf from strstr</title>
<updated>2018-11-02T16:04:41+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2018-11-02T16:04:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=0239cd0681e889a269fb7691f60e81ef8d081e6b'/>
<id>0239cd0681e889a269fb7691f60e81ef8d081e6b</id>
<content type='text'>
this was leftover from before the initial commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this was leftover from before the initial commit.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix spuriously slow check in twoway strstr/memmem cores</title>
<updated>2018-11-02T16:02:09+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2018-11-02T16:01:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=8f5a820d147da36bcdbddd201b35d293699dacd8'/>
<id>8f5a820d147da36bcdbddd201b35d293699dacd8</id>
<content type='text'>
mem0 &amp;&amp; mem &amp;&amp; ... is redundant since mem can only be nonzero when
mem0 is nonzero.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mem0 &amp;&amp; mem &amp;&amp; ... is redundant since mem can only be nonzero when
mem0 is nonzero.
</pre>
</div>
</content>
</entry>
</feed>
