feat: extend register splitting#1934
Merged
DavePearce merged 4 commits intoJul 6, 2026
Merged
Conversation
a7e03f5 to
c9c151b
Compare
109487a to
4c02c88
Compare
11 tasks
858b43b to
0e408fd
Compare
This extends the register splitting algorithm to handle all cases which arise during tracing, and most which arise during fast execution. Specifically, this includes, add, sub, mul, cat, and, or, xor, cast and more. Some are outstanding, including switch, shl, and shr. There are currently also some critical problems yet to be resolved. Specifically, correctly handling of casted operands for read/write/call (and perhaps other cases); secondly, correct handling of "subtract with borrow" semantics. Signed-off-by: DavePearce <dave01001110@gmail.com> feat: add DivRem.String() Signed-off-by: DavePearce <dave01001110@gmail.com>
0dbae2b to
82944f9
Compare
For these bytecodes, splitting needs to be handled more carefully. Specifically, when arguments / returns have different sizes we may need to introduce zero arguments, assign registers with zero and/or check that registers are indeed zero. Signed-off-by: DavePearce <dave01001110@gmail.com>
6e07bfd to
da2656b
Compare
This puts in place preliminary support for "subtract with borrow" semantics. This is considered preliminary because it is not currently supported by the constraints and/or gogen. However, it is needed to implement register splitting correctly. Furthermore, a lowering phase will be required for constraint generation to ensure a sign bit always exists. Signed-off-by: DavePearce <dave01001110@gmail.com>
This puts through many improvements to the CLI and the BinaryFile API, such as better printing of compiled code, removal of WordMachine from many places and replacing with the vm.Program. Signed-off-by: DavePearce <dave01001110@gmail.com>
da2656b to
cff88fb
Compare
letypequividelespoubelles
approved these changes
Jul 6, 2026
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.
This puts in place a straightforward implementation of register splitting for addition instructions. At this stage, tests are failing for reasons unknown and support for native arithmetic is missing.