Skip to content

Claude/vc6 passes - #6

Merged
MrSapps merged 7 commits into
claude/blissful-johnson-1w5a5vfrom
claude/vc6-passes
Oct 12, 2026
Merged

MrSapps merged 7 commits into
claude/blissful-johnson-1w5a5vfrom
claude/vc6-passes

Conversation

@MrSapps

@MrSapps MrSapps commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

No description provided.

claude added 7 commits October 5, 2026 19:32
Rewrites that produced gta2_re matches by hand:
- bool_assign: 'x = a < b;' <-> 'if (a < b) x = 1; else x = 0;' (and
  'x = 0; if (c) x = 1;'): VC6 if-converts a flag set differently.
- reuse_local / split_local: one local for two values or two locals: which
  register holds the array base and which the walking pointer.
- inline_use: read a local's initializer again at one use: whether VC6
  keeps the value in a register across calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
swap_logical swaps the operands of && and || (which test VC6 lays out
first), do_while turns a while loop into a guarded do-while and back,
and noop_node adds or drops redundant parentheses and f32 casts of f32
values, which move the x87 scheduler's 81-node window breaks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goto_exit turns a loop's breaks into a goto to a label after the loop
(all of them or one) and back: a break's exit is a jump-only block whose
jumps VC6 retargets. tail_return copies the return after an if into one
branch, or drops such a copy, which decides the tail VC6's cross-jumping
keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…her calling convention

Each declaration line of the function and of the functions it calls (in
the source and its headers) becomes a region holding the text between
the return type and the name; all the declarations of one function get
the same choice of none, __cdecl, __stdcall or __fastcall. In a __cdecl
function VC6 gives the instructions after a call no call-clobber
latency, so the convention changes the schedule even without
parameters: gta2_re's GetLayout_4D6000 is found again in two compiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
switch_dup runs the statement after a switch in each case before its
break (adding a default for it) or hoists a statement every break
shares out of the switch. --op-alias now also takes a method name
(Normalize=Normalize_406C20 renames the call), and
--auto-method-aliases finds the pairs of an inline method and its
named out-of-line copy in the included headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…) / if (1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MrSapps
MrSapps merged commit 59a4fea into claude/blissful-johnson-1w5a5v Oct 12, 2026
5 checks passed
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.

2 participants