Skip to content

Add Optional 128-bit Integer Support to C++ Runtime#239

Open
AaronWebster wants to merge 4 commits intomasterfrom
int128-runtime-support
Open

Add Optional 128-bit Integer Support to C++ Runtime#239
AaronWebster wants to merge 4 commits intomasterfrom
int128-runtime-support

Conversation

@AaronWebster
Copy link
Collaborator

This pull request introduces support for 128-bit integers in the C++ runtime, enabling the handling of types larger than 64 bits (up to 128 bits) when the environment supports it, specifically gcc's __uint128_t and __int128_t.

AaronWebster and others added 4 commits December 3, 2025 13:27
- Update prelude.emb to allow UInt and Int sizes up to 128 bits
  (previously limited to 64 bits). Added documentation noting that
  128-bit support requires platform support (__uint128_t/__int128_t).

- Update constraints_test.py to test with sizes > 128 bits now that
  128-bit fields are valid.

- Add comprehensive unit tests for 128-bit integer support:
  - emboss_bit_util_test.cc: ByteSwap, MaskToNBits, IsPowerOfTwo tests
  - emboss_memory_util_test.cc: MemoryAccessor, BitBlock tests for
    128-bit values including non-full-width (72, 96 bits) and
    cross-64-bit-boundary operations
  - emboss_prelude_test.cc: UIntView and IntView tests for 128-bit
    read/write, sign extension, and CouldWriteValue

- Add int128_sizes_test.cc integration test for generated code with
  128-bit integer fields (UInt128Sizes, Int128Sizes, big-endian
  variants, and arrays).

- Update int128_sizes.emb documentation and remove AnonymousBits128
  struct (128-bit bits types require separate implementation work).
@AaronWebster AaronWebster self-assigned this Jan 29, 2026
@AaronWebster AaronWebster added the enhancement New feature or request label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant