cpu: bind two ordinary import slots in one jump-table translation #779
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/785"
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 lukaslw-lab on 2026-11-23T03:10:25Z.
Change
tools/cpu_switch_aot.pybinds two ordinary IAT slots in one translation.--bind PROVIDER SYMBOLis repeatable; with several, the--link-name,--import-argumentsand--return-bytesafter each--bindbelong to it. Each binding names a distinct ordinary import of the image and binds the slot that holds it, with its own argument count and guaranteed return bytes. A single--bindparses and translates as before: all 15 single-binding translations in the build (13 named, 2 ordinal) are byte-identical to the output of the translator at761e323.cpu_translation()forwards a second binding fromSECOND_*. Fixes #767. Refs #317, #572, #655.--bindgroups does not change the source.--bind, an option given twice for one--bind, and a--bindwithout its numbers are errors.Verification
Full runs at commit
a61fe79(onupstream/maina4c6c06), on Windows 10 Pro 22H2 (build 19045.7846), Visual Studio 2026 18.12 (MSVC 19.52.37029), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7, both presets configured withDXC_EXECUTABLEset to DXC 1.9.2609.dev: 304 passed, 40 skipped (exit 77), 1 failed.release: 130 passed, 6 skipped.After rebasing onto
81cf1e3(shader and tooling commits only, no overlap with the translator or its fixtures), commit522e0a4was rebuilt and the import tests and the link check rerun:cpu_aot_two_slots,cpu_aot_import_call,cpu_aot_import_callsandcpu_aot_import_tail_jumppass in both presets. Skips are capability skips of this machine (Windows 10 in-box runtime without SM 6.5/6.6 or DXR, a 32-lane GPU without native wave64, and CPU features such as SHA, ADX, CLWB and CLFLUSHOPT).gpu_alias_lookup_writes_warpfails on main too: Windows 10 in-box WARP appliesInterlockedAddthrough a dynamically indexed buffer array four times (#332).A local
git merge-tree(ata61fe79) against the heads of the 52 open PRs that also editCMakeLists.txtordocs/experiments.mdgave the same conflicting files and hunk counts with and without this commit, so it adds no conflict to them. No open PR touchescpu_switch_aot.py,cpu_call_aot.pyor the import fixtures.Evidence and follow-up
New source-built fixture (MIT):
two_slots.asmandslot_provider.cpp(fold4, four arguments, 16-bit result), reusing themix3providers ofcpu_aot_import_tail_jump. Callers: named,mix3altered,fold4altered, andmix3by ordinal#3(link namemix3).route2reachesmix3by an ordinary call andfold4by a tail jump after the epilogue and by a thunk call;call_bothcalls both on one path.cpu_aot_two_slotsfold4's R9) and RBX/RSImix3changes only themix3path, alteredfold4only the twofold4paths; ordinal caller = named callermix3(rcx, rdx, r8)andfold4(rcx, rdx, r8, r9);route2width 2 (8 whenfold4states 8) from the tail jump; too few bytes stated for either binding, or four arguments formix3, are rejected#3with link namemix3next to namedfold4;#3without its link name rejectedcall or tail jump through a second IAT slot RVA 0x2000two bindings of …!mix3(read as two bindings of one import, here with 8 and 1 bytes)binding …!fold4 names no ordinary import of the image(wrong provider), same forfold3(wrong symbol)cpu_aot_import_call,cpu_aot_import_calls,cpu_aot_import_tail_jumpunchanged and passing indevandrelease; their generated sources are byte-identical to the previous translator's--bind, single-binding command unchanged--bindafter its options translates as before--return-bytesare refuseddevandrelease, first diagnosticcpu_aot_two_slots; results above; before the change the two-group command failed withunbound import cpu_tail_named_provider.dll!mix3 at IAT slot RVA 0x2010(only the last--bindcounted)Checklist
AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.
🤖 Generated with Claude Code