cpu: lower signed 32-bit comparison branches in cpu_leaf_aot #258
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/261"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:38:05Z.
Change
jl0x7c,jge0x7d,jle0x7e,jg0x7f) aftercmp eax, imm8/cmp eax, imm32intools/cpu_leaf_aot.py, emittingstatic_cast<std::int32_t>comparisons.tests/cpu/branch.asmwith two signed stages —cmp eax, -12(jl/jge, sign-extendedimm8) andcmp eax, -300(jle/jg,imm32) — in both the normal andINVERT_BRANCHbuilds.tests/cpu/branches.pyto model the signed stages and verify native, translated, and inverted outputs across 367 inputs hitting<,==, and>at every threshold (including0x7fffffffand0x80000000).Verification
Tested on Windows 11 (VS 2022 Build Tools 17.14, MSVC 19.44, ML64 14.44, Windows SDK 10.0.26100, Python 3.12):
cpu_leaf_original_liftedfailed with:cmake --build --preset dev --target cpu_leaf_original_lifted cpu_leaf_inverted_liftedsucceeded.ctest --preset dev --no-tests=error -R "^cpu_leaf_aot_branches$" -V: passed (367 native/translated matches and 367 inverted-branch differences across jb/jae, je/jne, jbe/ja, jl/jge, jle/jg, 32-bit immediates and sign-extended imm8).Evidence and follow-up
tools/cpu_leaf_aot.pypreviously lowered the six unsigned/equality short conditional jumps (0x72..0x77) aftercmp eax, imm8/imm32but rejected the four signed counterparts (0x7c..0x7f).Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:44:20Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
4dc7c97c97ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:40:49Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
4dc7c97ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:47:54Z.
Updated the leaf-recompilation section in
docs/experiments.mdto documentjl/jgeandjle/jg, bothimm8andimm32compare encodings, and the 367-input signed-boundary and inverted-branch coverage.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:44:20Z.
Code review location:
tools/cpu_leaf_aot.py; line 50Adding these signed jump forms changes the public capability of the leaf translator, but neither the README nor the experiment notes are updated:
docs/experiments.md:71–73still describes unsigned JB/JAE support and unsigned-only fixture validation. RootAGENTS.mdexplicitly requires a documentation update when a public capability changes. Update the leaf-recompilation section to describejl/jge,jle/jg, both immediate encodings, and the signed-boundary/inverted-control coverage so contributors can discover and reproduce the newly supported behavior.AGENTS.md reference: AGENTS.md:L145-L146
Useful? React with 👍 / 👎.