Skip to content

feat: extend register splitting#1934

Merged
DavePearce merged 4 commits into
mainfrom
1872-feat-register-splitting-for-add-instructions
Jul 6, 2026
Merged

feat: extend register splitting#1934
DavePearce merged 4 commits into
mainfrom
1872-feat-register-splitting-for-add-instructions

Conversation

@DavePearce

Copy link
Copy Markdown
Contributor

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.

@DavePearce DavePearce linked an issue Jun 26, 2026 that may be closed by this pull request
@DavePearce DavePearce force-pushed the 1872-feat-register-splitting-for-add-instructions branch 5 times, most recently from a7e03f5 to c9c151b Compare July 1, 2026 07:24
@DavePearce DavePearce changed the title feat: split add instructions feat: extend register splitting Jul 1, 2026
@DavePearce DavePearce force-pushed the 1872-feat-register-splitting-for-add-instructions branch 4 times, most recently from 109487a to 4c02c88 Compare July 1, 2026 08:41
@DavePearce DavePearce force-pushed the 1872-feat-register-splitting-for-add-instructions branch 3 times, most recently from 858b43b to 0e408fd Compare July 2, 2026 23:58
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>
@DavePearce DavePearce force-pushed the 1872-feat-register-splitting-for-add-instructions branch 3 times, most recently from 0dbae2b to 82944f9 Compare July 3, 2026 00:30
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>
@DavePearce DavePearce force-pushed the 1872-feat-register-splitting-for-add-instructions branch 5 times, most recently from 6e07bfd to da2656b Compare July 6, 2026 06:29
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>
@DavePearce DavePearce force-pushed the 1872-feat-register-splitting-for-add-instructions branch from da2656b to cff88fb Compare July 6, 2026 07:56
@DavePearce DavePearce enabled auto-merge (squash) July 6, 2026 08:13
@DavePearce DavePearce merged commit ff392f3 into main Jul 6, 2026
19 checks passed
@DavePearce DavePearce deleted the 1872-feat-register-splitting-for-add-instructions branch July 6, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: register splitting for add instructions

2 participants