Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using types like i1, u24, or other nonstandard integer sizes. #54855

Open
moonheart08 opened this issue Oct 5, 2018 · 4 comments
Open

Using types like i1, u24, or other nonstandard integer sizes. #54855

moonheart08 opened this issue Oct 5, 2018 · 4 comments
Labels
needs-rfc This change is large or controversial enough that it should have an RFC accepted before doing it. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@moonheart08
Copy link
Contributor

LLVM itself supports arbitrary bitlength integers, however Rust does not. This would be useful for some less common, but still fairly normal cases, like 24-bit integers for emulating CPUs like the MC68000 (Some models use 24-bit address busses instead of 32-bit), or for memory constrained systems where you need all the space you can get, and as such packed bitfields are the best for storing data.

@cuviper
Copy link
Member

cuviper commented Oct 5, 2018

There's a similar discussion here:
https://internals.rust-lang.org/t/pre-rfc-generic-integers-uint-n-and-int-n/7641

@estebank estebank added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Jan 19, 2019
@jonas-schievink jonas-schievink added the needs-rfc This change is large or controversial enough that it should have an RFC accepted before doing it. label Jul 1, 2021
@programmerjake
Copy link
Member

There is a postponed RFC: rust-lang/rfcs#2581

@programmerjake
Copy link
Member

C is getting generic integers: rust-lang/rfcs#2581 (comment)

@darleybarreto
Copy link

Does it make sense to make a full featured PoC crate for integers of any size (<=128) and eventually merge into the compiler? Or something like that should be built directly inside of rustc from the ground up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rfc This change is large or controversial enough that it should have an RFC accepted before doing it. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants