C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Modular integers

From: Hans Åberg <haberg_1_at_[hidden]>
Date: Wed, 14 Jan 2026 18:19:27 +0100
> On 14 Jan 2026, at 18:09, Thiago Macieira <thiago_at_[hidden]> wrote:
>
> On Wednesday, 14 January 2026 09:00:37 Pacific Standard Time Hans Åberg 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.
>
> I didn't ask if it is difficult. I asked if it is impossible. Given a specific
> size, if necessary, they could just do copy & paste.

And insert the expanded code for the smaller size. Have fun!

> You're also missing the point that the implementation doesn't have to call
> into the runtime library. The compiler itself could insert inline the
> necessary computation at the point of call, just like a template would. The
> implementation may not want to do that, as a trade-off, because of code bloat.

This was also discussed in this thread.

Received on 2026-01-14 17:19:48