<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/stdlib, branch users/nico/python-2</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] Efficiently implement `aligned_alloc` for AMDGPU (#146585)</title>
<updated>2025-07-02T14:25:57+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-07-02T14:25:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=24828c8c45d7f258159afca251aa853a5fc59150'/>
<id>24828c8c45d7f258159afca251aa853a5fc59150</id>
<content type='text'>
Summary:
This patch uses the actual allocator interface to implement
`aligned_alloc`. We do this by simply rounding up the amount allocated.
Because of how index calculation works, any offset within an allocated
pointer will still map to the same chunk, so we can just adjust
internally and it will free all the same.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This patch uses the actual allocator interface to implement
`aligned_alloc`. We do this by simply rounding up the amount allocated.
Because of how index calculation works, any offset within an allocated
pointer will still map to the same chunk, so we can just adjust
internally and it will free all the same.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Efficiently implement 'realloc' for AMDGPU devices (#145960)</title>
<updated>2025-06-30T13:39:40+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-06-30T13:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=10445acfa64a80800272e09f70be4799877a237f'/>
<id>10445acfa64a80800272e09f70be4799877a237f</id>
<content type='text'>
Summary:
Now that we have `malloc` we can implement `realloc` efficiently. This
uses the known chunk sizes to avoid unnecessary allocations. We just
return nullptr for NVPTX. I'd remove the list for the entrypoint but
then the libc++ code would stop working. When someone writes the NVPTX
support this will be trivial.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Now that we have `malloc` we can implement `realloc` efficiently. This
uses the known chunk sizes to avoid unnecessary allocations. We just
return nullptr for NVPTX. I'd remove the list for the entrypoint but
then the libc++ code would stop working. When someone writes the NVPTX
support this will be trivial.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187)</title>
<updated>2025-06-11T20:25:27+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-11T20:25:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d87eea35fac5a34a841c637db8908128409a184e'/>
<id>d87eea35fac5a34a841c637db8908128409a184e</id>
<content type='text'>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</pre>
</div>
</content>
</entry>
<entry>
<title>qsort_r.h: qsort_r() is POSIX now. (#138545)</title>
<updated>2025-05-05T20:19:58+00:00</updated>
<author>
<name>enh-google</name>
<email>enh@google.com</email>
</author>
<published>2025-05-05T20:19:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=673047ea2b49439d8b746adc03eb882d582e0625'/>
<id>673047ea2b49439d8b746adc03eb882d582e0625</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] implement `memalignment` (#132493)</title>
<updated>2025-03-28T23:07:57+00:00</updated>
<author>
<name>Mohamed Emad</name>
<email>73320969+hulxv@users.noreply.github.com</email>
</author>
<published>2025-03-28T23:07:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=48408954670e1f564bd92eed6b54bf155238201c'/>
<id>48408954670e1f564bd92eed6b54bf155238201c</id>
<content type='text'>
This patch adds the `memalignment` function to LLVM-libc, following its
description in [WG14 N3220,
§7.24.2.1](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf#page=387).

- [x] Add the implementation of `memalignment` in
[`/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/src/stdlib)
- [x] Add tests for `memalignment` in
[`/test/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/test/src/stdlib)
- [x] Add `memalignment` to
[`entrypoints.txt`](https://github.com/llvm/llvm-project/blob/main/libc/config/linux/x86_64/entrypoints.txt)
for at least x86_64 and whatever you're building on
- [x] Add `memalignment` to
[`include/stdlib.yaml`](https://github.com/llvm/llvm-project/blob/main/libc/include/stdlib.yaml)




Closes #132300

---------

Co-authored-by: Joseph Huber &lt;huberjn@outlook.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the `memalignment` function to LLVM-libc, following its
description in [WG14 N3220,
§7.24.2.1](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf#page=387).

- [x] Add the implementation of `memalignment` in
[`/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/src/stdlib)
- [x] Add tests for `memalignment` in
[`/test/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/test/src/stdlib)
- [x] Add `memalignment` to
[`entrypoints.txt`](https://github.com/llvm/llvm-project/blob/main/libc/config/linux/x86_64/entrypoints.txt)
for at least x86_64 and whatever you're building on
- [x] Add `memalignment` to
[`include/stdlib.yaml`](https://github.com/llvm/llvm-project/blob/main/libc/include/stdlib.yaml)




Closes #132300

---------

Co-authored-by: Joseph Huber &lt;huberjn@outlook.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Template the writing mode for the writer class (#111559)</title>
<updated>2025-03-12T18:51:44+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-03-12T18:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=598e882ee88a1e3349fb6d8dcd68f6d3b1c6334f'/>
<id>598e882ee88a1e3349fb6d8dcd68f6d3b1c6334f</id>
<content type='text'>
Summary:
Currently we dispatch the writing mode off of a runtime enum passed in
by the constructor. This causes very unfortunate codegen for the GPU
targets where we get worst-case codegen because of the unused function
pointer for `sprintf`. Instead, this patch moves all of this to a
template so it can be masked out. This results in no dynamic stack and
uses 60 VGPRs instead of 117. It also compiles about 5x as fast.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Currently we dispatch the writing mode off of a runtime enum passed in
by the constructor. This causes very unfortunate codegen for the GPU
targets where we get worst-case codegen because of the unused function
pointer for `sprintf`. Instead, this patch moves all of this to a
template so it can be masked out. This results in no dynamic stack and
uses 60 VGPRs instead of 117. It also compiles about 5x as fast.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add `-Wno-sign-conversion` &amp; re-attempt `-Wconversion` (#129811)</title>
<updated>2025-03-10T15:57:09+00:00</updated>
<author>
<name>Vinay Deshmukh</name>
<email>32487576+vinay-deshmukh@users.noreply.github.com</email>
</author>
<published>2025-03-10T15:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=257e48371546f75623482071fc39eef4b64fbd88'/>
<id>257e48371546f75623482071fc39eef4b64fbd88</id>
<content type='text'>
Relates to
https://github.com/llvm/llvm-project/issues/119281#issuecomment-2699470459</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relates to
https://github.com/llvm/llvm-project/issues/119281#issuecomment-2699470459</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc]  Enable -Wconversion for tests. (#127523)"</title>
<updated>2025-03-05T21:42:40+00:00</updated>
<author>
<name>Augie Fackler</name>
<email>augie@google.com</email>
</author>
<published>2025-03-05T18:52:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da61b0ddc5dcc8f1ac64eaddabdbfec5aa23f22b'/>
<id>da61b0ddc5dcc8f1ac64eaddabdbfec5aa23f22b</id>
<content type='text'>
This reverts commit 1e6e845d49a336e9da7ca6c576ec45c0b419b5f6 because it
changed the 1st parameter of adjust() to be unsigned, but libc itself
calls adjust() with a negative argument in align_backward() in
op_generic.h.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 1e6e845d49a336e9da7ca6c576ec45c0b419b5f6 because it
changed the 1st parameter of adjust() to be unsigned, but libc itself
calls adjust() with a negative argument in align_backward() in
op_generic.h.
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc]  Enable -Wconversion for tests. (#127523)</title>
<updated>2025-03-04T15:24:35+00:00</updated>
<author>
<name>Vinay Deshmukh</name>
<email>32487576+vinay-deshmukh@users.noreply.github.com</email>
</author>
<published>2025-03-04T15:24:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1e6e845d49a336e9da7ca6c576ec45c0b419b5f6'/>
<id>1e6e845d49a336e9da7ca6c576ec45c0b419b5f6</id>
<content type='text'>
Relates to: #119281</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relates to: #119281</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add a missing include</title>
<updated>2025-03-04T07:54:46+00:00</updated>
<author>
<name>Dmitri Gribenko</name>
<email>gribozavr@gmail.com</email>
</author>
<published>2025-03-04T07:54:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9084d2a0a11d8e12ac02f8870c418073985c2e59'/>
<id>9084d2a0a11d8e12ac02f8870c418073985c2e59</id>
<content type='text'>
This is a fixup for
https://github.com/llvm/llvm-project/commit/da6d5fa79a558b66c281bed3f5ce848a69a65208.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a fixup for
https://github.com/llvm/llvm-project/commit/da6d5fa79a558b66c281bed3f5ce848a69a65208.
</pre>
</div>
</content>
</entry>
</feed>
