<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/test/src/string, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] add an SVE implementation of strlen (#167259)</title>
<updated>2025-11-11T00:15:34+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-11-11T00:15:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8751f26a1bfac82703aaa36c61edf8771ef9e77f'/>
<id>8751f26a1bfac82703aaa36c61edf8771ef9e77f</id>
<content type='text'>
This PR creates an SVE-based implementation for strlen by translating
from the AOR code in tree. Microbenchmark shows improvements against
NEON when N&gt;=64. Although both implementations fall behind glibc by a
large margin,
this may be a good start point to explore SVE implementations.

Together with the PR:

1. Added two more tests of strlen with special nul symbols.
2. Added strlen's fuzzer and fix a typo in previous heap fuzzer.

```
=== strlen(16 bytes) ===
libc: 1.56115 ns/call, 9.54499 GiB/s
neon: 1.59393 ns/call, 9.34867 GiB/s
sve: 1.66097 ns/call, 8.97134 GiB/s

=== strlen(64 bytes) ===
libc: 2.06967 ns/call, 28.7991 GiB/s
neon: 2.59914 ns/call, 22.9325 GiB/s
sve: 2.58628 ns/call, 23.0465 GiB/s

=== strlen(256 bytes) ===
libc: 3.74165 ns/call, 63.7202 GiB/s
neon: 8.98243 ns/call, 26.5428 GiB/s
sve: 7.36426 ns/call, 32.3751 GiB/s

=== strlen(1024 bytes) ===
libc: 10.5327 ns/call, 90.5438 GiB/s
neon: 34.363 ns/call, 27.7529 GiB/s
sve: 26.9329 ns/call, 35.4092 GiB/s

=== strlen(4096 bytes) ===
libc: 37.7304 ns/call, 101.104 GiB/s
neon: 145.911 ns/call, 26.144 GiB/s
sve: 103.208 ns/call, 36.9612 GiB/s

=== strlen(1048576 bytes) ===
libc: 9623.4 ns/call, 101.478 GiB/s
neon: 36138.2 ns/call, 27.023 GiB/s
sve: 26605.6 ns/call, 36.7051 GiB/s
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR creates an SVE-based implementation for strlen by translating
from the AOR code in tree. Microbenchmark shows improvements against
NEON when N&gt;=64. Although both implementations fall behind glibc by a
large margin,
this may be a good start point to explore SVE implementations.

Together with the PR:

1. Added two more tests of strlen with special nul symbols.
2. Added strlen's fuzzer and fix a typo in previous heap fuzzer.

```
=== strlen(16 bytes) ===
libc: 1.56115 ns/call, 9.54499 GiB/s
neon: 1.59393 ns/call, 9.34867 GiB/s
sve: 1.66097 ns/call, 8.97134 GiB/s

=== strlen(64 bytes) ===
libc: 2.06967 ns/call, 28.7991 GiB/s
neon: 2.59914 ns/call, 22.9325 GiB/s
sve: 2.58628 ns/call, 23.0465 GiB/s

=== strlen(256 bytes) ===
libc: 3.74165 ns/call, 63.7202 GiB/s
neon: 8.98243 ns/call, 26.5428 GiB/s
sve: 7.36426 ns/call, 32.3751 GiB/s

=== strlen(1024 bytes) ===
libc: 10.5327 ns/call, 90.5438 GiB/s
neon: 34.363 ns/call, 27.7529 GiB/s
sve: 26.9329 ns/call, 35.4092 GiB/s

=== strlen(4096 bytes) ===
libc: 37.7304 ns/call, 101.104 GiB/s
neon: 145.911 ns/call, 26.144 GiB/s
sve: 103.208 ns/call, 36.9612 GiB/s

=== strlen(1048576 bytes) ===
libc: 9623.4 ns/call, 101.478 GiB/s
neon: 36138.2 ns/call, 27.023 GiB/s
sve: 26605.6 ns/call, 36.7051 GiB/s
```</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix stale char_ptr for find_first_character_wide read (#166594)</title>
<updated>2025-11-06T14:48:14+00:00</updated>
<author>
<name>Sterling-Augustine</name>
<email>saugustine@google.com</email>
</author>
<published>2025-11-06T14:48:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7ff8a5175428361e90c7bd7fd765192bec42be42'/>
<id>7ff8a5175428361e90c7bd7fd765192bec42be42</id>
<content type='text'>
On exit from the loop, char_ptr had not been updated to match block_ptr,
resulting in erroneous results. Moving all updates out of the loop fixes
that.

Adjust derefences to always be inside bounds checks.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On exit from the loop, char_ptr had not been updated to match block_ptr,
resulting in erroneous results. Moving all updates out of the loop fixes
that.

Adjust derefences to always be inside bounds checks.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][NFC] Remove usage of the C keyword `I`. (#160567)</title>
<updated>2025-09-24T18:18:32+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-09-24T18:18:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3c53adec68b3e7be3d69bc4e24168e530097fce0'/>
<id>3c53adec68b3e7be3d69bc4e24168e530097fce0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add -Wextra for libc tests (#153321)</title>
<updated>2025-09-22T16:56:38+00:00</updated>
<author>
<name>Vinay Deshmukh</name>
<email>vinay_deshmukh@outlook.com</email>
</author>
<published>2025-09-22T16:56:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=beb743b9823d0ea6ce2e25c8520b588db8aa2314'/>
<id>beb743b9823d0ea6ce2e25c8520b588db8aa2314</id>
<content type='text'>
RE apply https://github.com/llvm/llvm-project/pull/133643/commits#top</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RE apply https://github.com/llvm/llvm-project/pull/133643/commits#top</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Use anonymous namespace for test helper code (#157203)</title>
<updated>2025-09-06T00:14:55+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>mcgrathr@google.com</email>
</author>
<published>2025-09-06T00:14:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9789abb2b9ad0a3d3a2af3cc63d027ec20156650'/>
<id>9789abb2b9ad0a3d3a2af3cc63d027ec20156650</id>
<content type='text'>
Tests can be at top-level or inside an anonymous namespace,
doesn't matter.  But putting their helper code inside anonymous
namespaces both makes the code compatible with compiling using
-Wmissing-declarations and might let the compiler optimize the
test good a bit better.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tests can be at top-level or inside an anonymous namespace,
doesn't matter.  But putting their helper code inside anonymous
namespaces both makes the code compatible with compiling using
-Wmissing-declarations and might let the compiler optimize the
test good a bit better.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] fixed signed char issues in strsep()/strtok()/strtok_r(). (#156705)</title>
<updated>2025-09-03T18:00:38+00:00</updated>
<author>
<name>enh-google</name>
<email>enh@google.com</email>
</author>
<published>2025-09-03T18:00:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ded5f433dedf4a3419548929ac3dfa826e11d2e1'/>
<id>ded5f433dedf4a3419548929ac3dfa826e11d2e1</id>
<content type='text'>
Also add the missing tests for all the related functions (even the ones
that were already right), and add the missing bazel build rules.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also add the missing tests for all the related functions (even the ones
that were already right), and add the missing bazel build rules.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] fix strsep()/strtok()/strtok_r() "subsequent searches" behavior. (#154370)</title>
<updated>2025-08-21T13:32:35+00:00</updated>
<author>
<name>enh-google</name>
<email>enh@google.com</email>
</author>
<published>2025-08-21T13:32:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=71dd4e17dd6493986e4b3647288d8e4c22a86c44'/>
<id>71dd4e17dd6493986e4b3647288d8e4c22a86c44</id>
<content type='text'>
These functions turned out to have the same bug that was in wcstok()
(fixed by 4fc9801), so add the missing tests and fix the code in a way
that matches wcstok().

Also fix incorrect test expectations in existing tests.

Also update the BUILD.bazel files to actually build the strsep() test.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions turned out to have the same bug that was in wcstok()
(fixed by 4fc9801), so add the missing tests and fix the code in a way
that matches wcstok().

Also fix incorrect test expectations in existing tests.

Also update the BUILD.bazel files to actually build the strsep() test.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc] Add -Wextra for libc tests" (#153169)</title>
<updated>2025-08-12T11:40:14+00:00</updated>
<author>
<name>William Huynh</name>
<email>William.Huynh@arm.com</email>
</author>
<published>2025-08-12T11:40:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=33fe6353ef02c7d76c61eca7a136b7fb92b12450'/>
<id>33fe6353ef02c7d76c61eca7a136b7fb92b12450</id>
<content type='text'>
Reverts llvm/llvm-project#133643</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#133643</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add -Wextra for libc tests (#133643)</title>
<updated>2025-08-12T11:27:13+00:00</updated>
<author>
<name>Vinay Deshmukh</name>
<email>32487576+vinay-deshmukh@users.noreply.github.com</email>
</author>
<published>2025-08-12T11:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e617dc80bf9376ca948ee7af8304ea00b2263b51'/>
<id>e617dc80bf9376ca948ee7af8304ea00b2263b51</id>
<content type='text'>
* Relates to: https://github.com/llvm/llvm-project/issues/119281</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Relates to: https://github.com/llvm/llvm-project/issues/119281</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Don't rely on LIBC_HAS_SANITIZER when enabling null checks. (#150341)</title>
<updated>2025-07-24T21:15:46+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-07-24T21:15:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5e01797cd035cd1b86beb0ad3fb24277531dff66'/>
<id>5e01797cd035cd1b86beb0ad3fb24277531dff66</id>
<content type='text'>
LIBC_HAS_SANITIZER (which is defined if ASan, MSan, or UBSan is enabled)
is currently used to implicitly disable null checks, normally enabled
via LIBC_ADD_NULL_CHECKS config value. Remove this condition, and rely
purely on the config value instead:

* LIBC_HAS_SANITIZER will be true even for UBSan modes which doesn't
rely on null checks at all (e.g. -fsanitize=alignment)
* null checks today (implemented via __builtin_trap) should function
normally today even when sanitizer is enabled - trap is still a trap
* tests have been migrated to WITH_SIGNAL(-1) which doesn't prescript a
particular signal / exit-code, and thus should pass even if sanitizers
override the default ones.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LIBC_HAS_SANITIZER (which is defined if ASan, MSan, or UBSan is enabled)
is currently used to implicitly disable null checks, normally enabled
via LIBC_ADD_NULL_CHECKS config value. Remove this condition, and rely
purely on the config value instead:

* LIBC_HAS_SANITIZER will be true even for UBSan modes which doesn't
rely on null checks at all (e.g. -fsanitize=alignment)
* null checks today (implemented via __builtin_trap) should function
normally today even when sanitizer is enabled - trap is still a trap
* tests have been migrated to WITH_SIGNAL(-1) which doesn't prescript a
particular signal / exit-code, and thus should pass even if sanitizers
override the default ones.</pre>
</div>
</content>
</entry>
</feed>
