Date: Wed, 14 Jan 2026 19:07:06 +0100
On 14/01/2026 18:31, Hans Åberg via Std-Proposals wrote:
>
>
>> On 14 Jan 2026, at 18:19, Alejandro Colomar <une+cxx_std-
>> proposals_at_[hidden]> wrote:
>>
>> Hi Hans,
>
> Hi,
>
>> On Wed, Jan 14, 2026 at 06:00:37PM +0100, Hans Åberg via Std-
>> Proposals wrote:
>>>
>>>> On 14 Jan 2026, at 16:34, Thiago Macieira via Std-Proposals
>>>> <std-proposals_at_[hidden]> wrote:
>>>>
>>>> What Hans has to show and has so far failed to do is that it
>>>> would be *impossible* for LLVM to match the performance of his
>>>> code, providing a reason why that would be the case.
>>>
>>> It looks difficult to do in C in the absence of templates,
>>> unlike C++ then, because the code should be expanded statically
>>> for pipelining, even though there are suggestions in this thread
>>> that it might be possible.
>>
>> LLVM should be able to implement _BinInt() as a template if it
>> would make it more efficient. That's an implementation detail.
>> The fact that it's *currently* written in C doesn't prevent them
>> from rewriting it in C++, or in assembly.
>
> Indeed, it is a C compatibility type, intended to work exactly in C,
> which imposes some limitations. Discussions in the past focused on
> making a separate C++ type for bit interesting, which I think would
> be good.
>
What limitations do you think are imposed by compatibility with C _BitInt ?
There are plenty of things that will be nicer in C++ if these are also
available as a C++ template - std::bitint<N>. But in what way do you
think things would be limited if it is an identical type to C23's
_BitInt(N), and that the two names can be used interchangeably in C++ ?
>
>
>> On 14 Jan 2026, at 18:19, Alejandro Colomar <une+cxx_std-
>> proposals_at_[hidden]> wrote:
>>
>> Hi Hans,
>
> Hi,
>
>> On Wed, Jan 14, 2026 at 06:00:37PM +0100, Hans Åberg via Std-
>> Proposals wrote:
>>>
>>>> On 14 Jan 2026, at 16:34, Thiago Macieira via Std-Proposals
>>>> <std-proposals_at_[hidden]> wrote:
>>>>
>>>> What Hans has to show and has so far failed to do is that it
>>>> would be *impossible* for LLVM to match the performance of his
>>>> code, providing a reason why that would be the case.
>>>
>>> It looks difficult to do in C in the absence of templates,
>>> unlike C++ then, because the code should be expanded statically
>>> for pipelining, even though there are suggestions in this thread
>>> that it might be possible.
>>
>> LLVM should be able to implement _BinInt() as a template if it
>> would make it more efficient. That's an implementation detail.
>> The fact that it's *currently* written in C doesn't prevent them
>> from rewriting it in C++, or in assembly.
>
> Indeed, it is a C compatibility type, intended to work exactly in C,
> which imposes some limitations. Discussions in the past focused on
> making a separate C++ type for bit interesting, which I think would
> be good.
>
What limitations do you think are imposed by compatibility with C _BitInt ?
There are plenty of things that will be nicer in C++ if these are also
available as a C++ template - std::bitint<N>. But in what way do you
think things would be limited if it is an identical type to C23's
_BitInt(N), and that the two names can be used interchangeably in C++ ?
Received on 2026-01-14 18:07:13
