test(relinker): run the lowering execution checks on Windows #17548
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17548"
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 boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-11-08T21:39:53Z.
What
The lowering tests' execution parts were compiled out on Windows:
LoweringExecution.hpponly mapped pages withmmap/mprotectand called the generated wrapper with the host calling convention. This makes them run on Windows x86-64 with GCC or Clang:VirtualAlloc/VirtualProtect(plusFlushInstructionCache), behind smallAllocatePages/ProtectPages/FreePageshelpers that keep usingmmapon Linux and macOS;rsiandrdi(callee-saved there), passes the argument inrdiwhere the wrapper reads it, and keeps the stack aligned, so no compiler extension is needed (the first version usedsysv_abi, which the current conventions check rejects);The ANDN, BLS, bitfield and shift tests on
mainpick this up. MULX already had its own Windows path, and the masked store test keeps its own Linux/macOS guard (it needs SIGSEGV handling). The approach is @gabichuuuuu's, from the review of #17132; credit is in the commit message.Overlap: #16236 (also mine) adds a POSIX-only
HostExecutesunder the sameLOWERING_EXECUTION_AVAILABLEguard. Whichever of the two lands second, I'll update the other soHostExecutesstays out of the Windows build (or gets a Windows probe).Tested
Windows 11, i7 (BMI1/2), WinLibs GCC 15.2 UCRT, Release,
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON, head055b22208f(this PR withmain22ae9a397dmerged):andn_lowering,bls_lowering,bitfield_lowering,shift_lowering: pass 3 of 3 runs each, and none prints the skip message any more, so their execution parts ran.mulx_lowering(73,868 cases) andmasked_store_loweringpass unchanged.AND(0x23) changed toOR(0x0B),andn_lowering_tests.exefails on Windows with "ANDN changed a source/scratch register or produced an incorrect result". It passes again once restored.055b22208f(checked to contain this PR's helper):andn_lowering,bitfield_lowering,bls_lowering,shift_loweringandmulx_lowering(73,868 cases) pass in 3 of 3 runs each, so the movedmmap/mprotect/munmappath still works. (An earlier version of this description listed Linux runs that had testedmainby mistake; these replace them.)masked_store_loweringisn't affected here: it doesn't include this helper and needs an AVX host.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T22:00:53Z.
Review: COMMENTED
Windows run of head
15c43ef4f1, merged ontomain0bae53facdin one tree with eight other open PRs that touch different files (all nine merged cleanly). Setup: Windows 11, WinLibs GCC 15.2 r7 (x86_64-ucrt-posix-seh, the CI toolchain), Release,BUILD_TESTING=ON.andn_loweringwith--repeat until-fail:5: 5 / 5 pass.bitfield_loweringwith--repeat until-fail:5: 5 / 5 pass.bls_loweringwith--repeat until-fail:5: 5 / 5 pass.shift_loweringwith--repeat until-fail:5: 5 / 5 pass.On
mainthese execution checks compile out on Windows (LOWERING_EXECUTION_AVAILABLEis 0 there). With this PR they run the generated code throughVirtualAlloc/VirtualProtectand thesysv_abientry, and all four pass.