Skip to content

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

Description

@moonheart08

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.

Activity

  1. cuviper commented on Oct 5, 2018

    @cuviper
    Member
  2. added
    needs-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.
    on Jul 1, 2021
  3. programmerjake commented on Jul 26, 2021

    @programmerjake
    Member

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

  4. programmerjake commented on Jul 26, 2021

    @programmerjake
    Member

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

  5. darleybarreto commented on Jul 27, 2021

    @darleybarreto

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language teamneeds-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions