Repository navigation
bugc: point at packed words' parts as their own regions - #398
Merged
Merged
Conversation
A local of bytes or a string in calldata is one word: the offset in its high 16 bytes, the length in its low 16. Name each half as its own region (x-offset, x-length) and have the calldata region read them, instead of reading the whole word and taking ~quotient and ~remainder by 2^128.
gnidan
force-pushed
the
bugc-split-word-regions
branch
from
October 15, 2026 18:28
ac9bcf8 to
2824f27
Compare
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A local of bytes or a string in calldata is held as one word: the offset of the bytes in its high 16 bytes and their length in its low 16 bytes. Its pointer used to name that whole word and have the
calldataregion compute its offset and length as~quotientand~remainderof the word by 2^128.Now each half of the word is a region of its own,
x-offset(bytes 0–15 of the word) andx-length(bytes 16–31), in memory or on the stack, andx-datareads them directly:{ "group": [ { "name": "text-offset", "location": "stack", "slot": 2, "offset": 0, "length": 16 }, { "name": "text-length", "location": "stack", "slot": 2, "offset": 16, "length": 16 }, { "name": "text-data", "location": "calldata", "offset": { "~read": "text-offset" }, "length": { "~read": "text-length" } } ] }The whole-word region
xis gone, since nothing reads it any more. Code generation is unchanged, and the pointers read the same bytes as before at every level. The case study and the soundness harness are updated to match.