C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D3666R0 Bit-precise integers

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Fri, 5 Sep 2025 13:32:50 -0400
On Fri, Sep 5, 2025 at 1:03 PM Tiago Freire <tmiguelf_at_[hidden]> wrote:
>
> This is the C++ standard mailing list, not your microcontroller implementation mailing list.
>
> Decisions affect everyone not just FPGAs.

Sure, but the need of FPGAs are one of the driving justifications for
`_BitInt`. Like, it's in the very first paper for the C standard
discussing it:

https://open-std.org/JTC1/SC22/WG14/www/docs/n2763%2epdf

Blog posts and forum discussions revolving around this feature
frequently bring up FPGAs and other specialized hardware as a primary
justification for it:

https://blog.tal.bi/posts/c23-bitint/

https://www.reddit.com/r/Compilers/comments/15az5kf/what_is_the_nature_of_bitint_in_c23_at_low_level/

And these are just the first few hits I got when I searched for this
feature. So it seems pretty clear that the needs of FPGAs are in fact
a core pillar of this feature. Given that fact, it seems a bit
wrong-headed to ignore them when discussing the merits of that
feature, yes?

> extended registers are a standard thing on most CPUs now a days, it's not like this is some hypothetical or anything.

So... what hardware *are* you talking about? Is this hardware that
actually exists, or are you speculating about what *might* happen?

> And even for your microcontroller there is absolutely no reason why they would give you _BitInt- whatever to access specialized registers as opposed to giving specialized concrete types. Considering also that BitInt is to implement integer arithmetic, and you can't do general arithmetic with a sha register, so why even bother to do that instead of... you know... be optimized to use your arithmetic unit.
>
> This idea that _BitInt if available would allow you to use exotic registers is pure fantasy.

Can you give me a good reason to consider your ideas and expertise to
be more valid than the people who invented the feature, shepherded it
through the C committee, and are currently using it within that
context? I'm not being snide here; we're talking about something
that's had substantial discussion already. This isn't a hypothetical
feature with a nebulous consequence; it's in the *past tense*. It's a
thing people are actually using already, just in C rather than C++.

Received on 2025-09-05 17:33:02