cpu: lower repeated string fills in control-flow functions #592
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/598"
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 Joacoorandom on 2026-11-22T15:00:50Z.
Change
Add REP STOSB/STOSW/STOSD/STOSQ to the control-flow CPU lifter. Fill from the low 1/2/4/8 bytes of RAX, advance RDI by the element width, exhaust RCX and preserve arithmetic flags. Zero count accesses no destination. Writes remain volatile under /O2; existing register-definedness and nonvolatile-save checks apply.
#597 is merged. Rebased this branch onto current
main, so the diff now contains the fill increment only (461a4f5). The original Windows verification was performed before the rebase. STD and non-repeated transfers remain rejected.Verification
Native Windows 11 26300.9974, MSVC/ML64 19.44.35230, Python 3.12.8. Commit
97f6ae8.Six selected CTests passed. The cumulative string comparison now covers ten exports, 3,804 native/AOT/reference cases and 63 access-violation comparisons, including /O2. This increment adds four fill exports, three distinct fill patterns, every element width, zero-count inaccessible destinations, guard bytes, final count/pointers and physical RSI/RDI/DF observations. Both compiled semantic negative controls continue to mismatch.
Linux:
All passed.
Evidence and follow-up
Original MIT source-built fixtures and byte-array reference, reusing #597's harness. No title code or external project source. Pointer validity, ABI assumptions and exception-resumption limits are documented in the updated README/experiment entry. AI-assisted.
Checklist
Conflict-resolution update (2026-11-22)
Rebased onto current upstream
mainafter #597 was merged, preserving each increment in stack order. Local checks passed:form_coverage_check.py,docs_links_check.py,bidi_controls_check.py,cpu/lower_prefixes_check.py, plusgit diff --check. Previous native-Windows results describe the original commits; the official Windows CI on the new head provides independent revalidation. No workflow or unrelated files were edited.Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-22T17:34:40Z.
Verification of
97f6ae8on an Intel Core i7-6820HQ (Skylake). Windows 11 26100.9168, MSVC/ML64 19.52.37029,devpreset:The fixture's built-in mutations cover the copy foundation from #597. To check that the fill increment in this commit is pinned, I mutated
tools/cpu_switch_aot.pyone detail at a time, rebuilt, and rancpu_aot_switch_strings. Afterwards I restored the file, verified its hash, and confirmed the test passed again.STOSWelement width 1 instead of 2STOSQelement width 4 instead of 8Now that #597 has landed,
97f6ae8no longer merges cleanly withmain(git merge-tree), so the branch needs the update mentioned in the description.AI-assisted: run and summarized with Claude Code; outputs copied from the local runs.