<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/__support, 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] Fix internal alignment in allcoator (#146738)</title>
<updated>2025-07-02T17:29:01+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-07-02T17:29:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=50f40a5327ad9f8a4a57bb2bf7679f489f86b726'/>
<id>50f40a5327ad9f8a4a57bb2bf7679f489f86b726</id>
<content type='text'>
Summary:
The allocator interface is supposed to have 16 byte alignment (to keep
it consistent with the CPU allocator. We could probably drop this to 8
if desires.) But this was not enforced because the number of bytes used
for the bitfield sometimes resulted in alignment of 8 instead of 16.
Explicitly align the number of bytes to be a multiple of 16 even if
unused.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
The allocator interface is supposed to have 16 byte alignment (to keep
it consistent with the CPU allocator. We could probably drop this to 8
if desires.) But this was not enforced because the number of bytes used
for the bitfield sometimes resulted in alignment of 8 instead of 16.
Explicitly align the number of bytes to be a multiple of 16 even if
unused.</pre>
</div>
</content>
</entry>
<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] Use is aligned builtin instead of ptrtoint (#146402)</title>
<updated>2025-07-02T12:03:11+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-07-02T12:03:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dea4f3213d84507ca9741faccab789f48c44e00d'/>
<id>dea4f3213d84507ca9741faccab789f48c44e00d</id>
<content type='text'>
Summary:
This avoids a ptrtoint by just using the clang builtin. This is clang
specific but only clang can compile GPU code anyway so I do not bother
with a fallback.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This avoids a ptrtoint by just using the clang builtin. This is clang
specific but only clang can compile GPU code anyway so I do not bother
with a fallback.</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] Changed CharacterConverter returns (#146130)</title>
<updated>2025-06-27T21:50:09+00:00</updated>
<author>
<name>sribee8</name>
<email>sriya.pratipati@gmail.com</email>
</author>
<published>2025-06-27T21:50:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f58caed1bc509e5b0f3ab4e875afc1c85183ec55'/>
<id>f58caed1bc509e5b0f3ab4e875afc1c85183ec55</id>
<content type='text'>
changed internal CharacterConverter returns to return errno macro when
necessary for consistency.

---------

Co-authored-by: Sriya Pratipati &lt;sriyap@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
changed internal CharacterConverter returns to return errno macro when
necessary for consistency.

---------

Co-authored-by: Sriya Pratipati &lt;sriyap@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add and use 'cpp::launder' to guard placement new (#146123)</title>
<updated>2025-06-27T19:34:33+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-06-27T19:34:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d34214a85e3b9b94c2ccc6d63f3592be7eca0c24'/>
<id>d34214a85e3b9b94c2ccc6d63f3592be7eca0c24</id>
<content type='text'>
Summary:
In the GPU allocator we reinterpret cast from a void pointer. We know
that an actual object was constructed there according to the C++ object
model, but to make it fully standards compliant we need to 'launder' it
to forward that information to the compiler. Add this function and call
it as appropriate.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
In the GPU allocator we reinterpret cast from a void pointer. We know
that an actual object was constructed there according to the C++ object
model, but to make it fully standards compliant we need to 'launder' it
to forward that information to the compiler. Add this function and call
it as appropriate.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix the risc-v half precison float feature check (#145894)</title>
<updated>2025-06-26T14:32:21+00:00</updated>
<author>
<name>Hans Wennborg</name>
<email>hans@hanshq.net</email>
</author>
<published>2025-06-26T14:32:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=58b7d200aa513faaf0a9ddb280e904cc63ad40a2'/>
<id>58b7d200aa513faaf0a9ddb280e904cc63ad40a2</id>
<content type='text'>
This is a follow-up to #145169, which would break compiles when
__riscv_zfhmin is not defined.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow-up to #145169, which would break compiles when
__riscv_zfhmin is not defined.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Improve memcpy for ARM Cortex-M supporting unaligned accesses. (#144872)</title>
<updated>2025-06-26T08:18:02+00:00</updated>
<author>
<name>Guillaume Chatelet</name>
<email>gchatelet@google.com</email>
</author>
<published>2025-06-26T08:18:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7289b6789ef3297f8de30a9d94c7dabc6c35931e'/>
<id>7289b6789ef3297f8de30a9d94c7dabc6c35931e</id>
<content type='text'>
This implementation has been compiled with the [pigweed toolchain](https://pigweed.dev/toolchain.html) and tested on:
 - Raspberry Pi Pico 2 with the following options\
`--target=armv8m.main-none-eabi`
`-march=armv8m.main+fp+dsp`
`-mcpu=cortex-m33` 
 - Raspberry Pi Pico with the following options\
`--target=armv6m-none-eabi`
`-march=armv6m`
`-mcpu=cortex-m0+` 

They both compile down to a little bit more than 200 bytes and are between 2 and 10 times faster than byte per byte copies.

For best performance the following options can be set in the `libc/config/baremetal/arm/config.json`
```
{
  "codegen": {
    "LIBC_CONF_KEEP_FRAME_POINTER": {
      "value": false
    }
  },
  "general": {
    "LIBC_ADD_NULL_CHECKS": {
      "value": false
    }
  }
}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implementation has been compiled with the [pigweed toolchain](https://pigweed.dev/toolchain.html) and tested on:
 - Raspberry Pi Pico 2 with the following options\
`--target=armv8m.main-none-eabi`
`-march=armv8m.main+fp+dsp`
`-mcpu=cortex-m33` 
 - Raspberry Pi Pico with the following options\
`--target=armv6m-none-eabi`
`-march=armv6m`
`-mcpu=cortex-m0+` 

They both compile down to a little bit more than 200 bytes and are between 2 and 10 times faster than byte per byte copies.

For best performance the following options can be set in the `libc/config/baremetal/arm/config.json`
```
{
  "codegen": {
    "LIBC_CONF_KEEP_FRAME_POINTER": {
      "value": false
    }
  },
  "general": {
    "LIBC_ADD_NULL_CHECKS": {
      "value": false
    }
  }
}
```</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Error fixes for mbrtowc and wcrtomb (#145785)</title>
<updated>2025-06-25T21:37:41+00:00</updated>
<author>
<name>sribee8</name>
<email>sriya.pratipati@gmail.com</email>
</author>
<published>2025-06-25T21:37:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bd86fc9252384f4b3174f07a615ffe371788584b'/>
<id>bd86fc9252384f4b3174f07a615ffe371788584b</id>
<content type='text'>
Invalid mbstate_t should set errno to EINVAL.
Changed Error return for the internal functions and added tests for the
public functions.

Co-authored-by: Sriya Pratipati &lt;sriyap@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Invalid mbstate_t should set errno to EINVAL.
Changed Error return for the internal functions and added tests for the
public functions.

Co-authored-by: Sriya Pratipati &lt;sriyap@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Added isValidState to CharacterConverter class to ensure a provided mbstate is valid (#145564)</title>
<updated>2025-06-25T19:06:22+00:00</updated>
<author>
<name>Uzair Nawaz</name>
<email>uzairnawaz@google.com</email>
</author>
<published>2025-06-25T19:06:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1c56d101a2140b14dec62097849493ed2ea6cc7f'/>
<id>1c56d101a2140b14dec62097849493ed2ea6cc7f</id>
<content type='text'>
Added isValidState to CharacterConverter class to ensure a provided
mbstate is valid</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added isValidState to CharacterConverter class to ensure a provided
mbstate is valid</pre>
</div>
</content>
</entry>
</feed>
