C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Modular integers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 14 Jan 2026 09:09:29 -0800
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.

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.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-01-14 17:09:35